* tex-mode and shell-quote-argument
@ 2005-05-29 14:40 Stefan Monnier
2005-05-29 16:11 ` Karl Berry
0 siblings, 1 reply; 4+ messages in thread
From: Stefan Monnier @ 2005-05-29 14:40 UTC (permalink / raw)
Cc: Karl Berry
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 ()
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tex-mode and shell-quote-argument
2005-05-29 14:40 tex-mode and shell-quote-argument Stefan Monnier
@ 2005-05-29 16:11 ` Karl Berry
2005-05-30 7:39 ` Richard Stallman
2005-05-30 20:40 ` Stefan Monnier
0 siblings, 2 replies; 4+ messages in thread
From: Karl Berry @ 2005-05-29 16:11 UTC (permalink / raw)
Cc: emacs-devel
Could someone explain to me more clearly the justification/need for the
latest patch to tex-mode:
I give up.
Someone needs to maintain tex-mode.el who can actually use it and test
it. I can't. If you think it's the right thing to do to revert all or
most or part of the latest patch, please do.
Is it just a case of enthusiasm going a bit over and beyond the call
of duty?
I guess so. I really don't know any more.
Or am I missing something?
You probably aren't, but I don't feel competent to say.
The story is, as tersely explained in the ChangeLog:
1) Olive Lin contributed a small change back in March that added the
shell-quote-argument to tex-send-command.
2) More recently (May 18), Frederik Fouvry reported a problem with
double quoting on tex-print. His original report used 8-bit chars
in filenames, he later told me it happens with any non-posix-safe
char, such as @.
3) Olive, Frederik, rms and I batted it around and no one saw what you
did. For myself, I just said oh, well, here are more calls to
shell-quote-argument, let's remove them. I didn't notice that there
were different arguments involved.
4) Shoot me now.
karl
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tex-mode and shell-quote-argument
2005-05-29 16:11 ` Karl Berry
@ 2005-05-30 7:39 ` Richard Stallman
2005-05-30 20:40 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Richard Stallman @ 2005-05-30 7:39 UTC (permalink / raw)
Cc: monnier, emacs-devel
Don't feel bad--at least you tried to work on this;
nobody else was willing to do it.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: tex-mode and shell-quote-argument
2005-05-29 16:11 ` Karl Berry
2005-05-30 7:39 ` Richard Stallman
@ 2005-05-30 20:40 ` Stefan Monnier
1 sibling, 0 replies; 4+ messages in thread
From: Stefan Monnier @ 2005-05-30 20:40 UTC (permalink / raw)
Cc: emacs-devel
> Could someone explain to me more clearly the justification/need for the
> latest patch to tex-mode:
> I give up.
> Someone needs to maintain tex-mode.el who can actually use it and test it.
I use it and I'm probably as close as it gets to a "maintainer" of that
file. I exclusively use tex-compile to run jobs, tho, and can never figure
out how to use the other thingies like tex-print.
> I can't. If you think it's the right thing to do to revert all or
> most or part of the latest patch, please do.
> Is it just a case of enthusiasm going a bit over and beyond the call
> of duty?
> I guess so. I really don't know any more.
> Or am I missing something?
> You probably aren't, but I don't feel competent to say.
> The story is, as tersely explained in the ChangeLog:
> 1) Olive Lin contributed a small change back in March that added the
> shell-quote-argument to tex-send-command.
> 2) More recently (May 18), Frederik Fouvry reported a problem with
> double quoting on tex-print. His original report used 8-bit chars
> in filenames, he later told me it happens with any non-posix-safe
> char, such as @.
> 3) Olive, Frederik, rms and I batted it around and no one saw what you
> did. For myself, I just said oh, well, here are more calls to
> shell-quote-argument, let's remove them. I didn't notice that there
> were different arguments involved.
> 4) Shoot me now.
Thank you. So my understanding seems correct: only the part (that removed
a double quoting in tex-print) was needed. I've undone the other changes.
Stefan
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2005-05-30 20:40 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-05-29 14:40 tex-mode and shell-quote-argument Stefan Monnier
2005-05-29 16:11 ` Karl Berry
2005-05-30 7:39 ` Richard Stallman
2005-05-30 20:40 ` Stefan Monnier
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).