From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: tex-mode and shell-quote-argument Date: Sun, 29 May 2005 10:40:51 -0400 Message-ID: <87y89yw1pj.fsf-monnier+emacs@gnu.org> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1117378815 29684 80.91.229.2 (29 May 2005 15:00:15 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sun, 29 May 2005 15:00:15 +0000 (UTC) Cc: Karl Berry Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun May 29 17:00:13 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DcPGY-0005v4-PB for ged-emacs-devel@m.gmane.org; Sun, 29 May 2005 16:59:51 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcPLF-00049d-Mk for ged-emacs-devel@m.gmane.org; Sun, 29 May 2005 11:04:41 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DcPKx-00047E-NM for emacs-devel@gnu.org; Sun, 29 May 2005 11:04:23 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DcPKt-00043w-4o for emacs-devel@gnu.org; Sun, 29 May 2005 11:04:19 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DcPKs-00043H-Tw for emacs-devel@gnu.org; Sun, 29 May 2005 11:04:18 -0400 Original-Received: from [209.226.175.74] (helo=tomts20-srv.bellnexxia.net) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DcPGy-0003hE-4F; Sun, 29 May 2005 11:00:16 -0400 Original-Received: from alfajor ([67.71.24.149]) by tomts20-srv.bellnexxia.net (InterMail vM.5.01.06.10 201-253-122-130-110-20040306) with ESMTP id <20050529145853.WMFI19894.tomts20-srv.bellnexxia.net@alfajor>; Sun, 29 May 2005 10:58:53 -0400 Original-Received: by alfajor (Postfix, from userid 1000) id 93CDDD7403; Sun, 29 May 2005 10:40:53 -0400 (EDT) Original-To: emacs-devel@gnu.org User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:37855 X-Report-Spam: http://spam.gmane.org/gmane.emacs.devel:37855 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 ()