From: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: Karl Berry <karl@gnu.org>
Subject: tex-mode and shell-quote-argument
Date: Sun, 29 May 2005 10:40:51 -0400 [thread overview]
Message-ID: <87y89yw1pj.fsf-monnier+emacs@gnu.org> (raw)
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 ()
next reply other threads:[~2005-05-29 14:40 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-05-29 14:40 Stefan Monnier [this message]
2005-05-29 16:11 ` tex-mode and shell-quote-argument Karl Berry
2005-05-30 7:39 ` Richard Stallman
2005-05-30 20:40 ` Stefan Monnier
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y89yw1pj.fsf-monnier+emacs@gnu.org \
--to=monnier@iro.umontreal.ca \
--cc=karl@gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).