[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
tex-mode and shell-quote-argument
From: |
Stefan Monnier |
Subject: |
tex-mode and shell-quote-argument |
Date: |
Sun, 29 May 2005 10:40:51 -0400 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) |
Could someone explain to me more clearly the justification/need for the
latest patch to tex-mode:
* textmodes/tex-mode.el: now that tex-send-command calls
shell-quote-argument (2005-03-31 change), remove all calls to
shell-quote-argument; they all end up invoking tex-send-command.
The double quoting loses on filenames with non-safe characters,
such as "@". Reported by Frederik Fouvry.
AFAICT tex-send-command only quotes its second (optional) argument, yet the
patch seems to remove calls to shell-quote-argument applied to parts of the
command line that are not passed via the second argument but via the first.
As a matter of fact, of all the hunks in the patch (which I attached below
for reference), I find that only the last one makes sense. Could someone
explain to me what's really going on? Is it just a case of enthusiasm going
a bit over and beyond the call of duty? Or am I missing something?
Stefan
Index: lisp/textmodes/tex-mode.el
===================================================================
RCS file: /cvsroot/emacs/emacs/lisp/textmodes/tex-mode.el,v
retrieving revision 1.163
retrieving revision 1.164
diff -u -r1.163 -r1.164
--- lisp/textmodes/tex-mode.el 27 May 2005 12:59:58 -0000 1.163
+++ lisp/textmodes/tex-mode.el 28 May 2005 16:57:21 -0000 1.164
@@ -1633,11 +1633,11 @@
(defvar tex-compile-commands
'(((concat "pdf" tex-command
" " (if (< 0 (length tex-start-commands))
- (shell-quote-argument tex-start-commands)) " %f")
+ tex-start-commands) " %f")
t "%r.pdf")
((concat tex-command
" " (if (< 0 (length tex-start-commands))
- (shell-quote-argument tex-start-commands)) " %f")
+ tex-start-commands) " %f")
t "%r.dvi")
("yap %r &" "%r.dvi")
("xdvi %r &" "%r.dvi")
@@ -1900,8 +1900,8 @@
(prog1 (file-name-directory (expand-file-name file))
(setq file (file-name-nondirectory file))))
(root (file-name-sans-extension file))
- (fspec (list (cons ?r (shell-quote-argument root))
- (cons ?f (shell-quote-argument file))))
+ (fspec (list (cons ?r root)
+ (cons ?f file)))
(default (tex-compile-default fspec)))
(list default-directory
(completing-read
@@ -1922,14 +1922,13 @@
(compile-command
(if star
(concat (substring command 0 star)
- (shell-quote-argument file)
+ file
(substring command (1+ star)))
(concat command " "
tex-start-options
(if (< 0 (length tex-start-commands))
- (concat
- (shell-quote-argument tex-start-commands) " "))
- (shell-quote-argument file)))))
+ (concat tex-start-commands " "))
+ file))))
(tex-send-tex-command compile-command dir)))
(defun tex-send-tex-command (cmd &optional dir)
@@ -2232,8 +2231,7 @@
(tex-start-shell))
(tex-send-command
(if alt tex-alt-dvi-print-command tex-dvi-print-command)
- (shell-quote-argument
- print-file-name-dvi)
+ print-file-name-dvi
t))))
(defun tex-alt-print ()
- tex-mode and shell-quote-argument,
Stefan Monnier <=