GNU bug report logs - #11348
24.0.95; TAB-completion in shell-command produces d:\/foo on MS-Windows

Previous Next

Package: emacs;

Reported by: Eli Zaretskii <eliz <at> gnu.org>

Date: Thu, 26 Apr 2012 11:12:02 UTC

Severity: normal

Found in version 24.0.95

Fixed in version 24.0.97

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Chong Yidong <cyd <at> gnu.org>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Stefan Monnier <monnier <at> iro.umontreal.ca>, 11348 <at> debbugs.gnu.org
Subject: bug#11348: 24.0.95; TAB-completion in shell-command produces d:\/foo on MS-Windows
Date: Mon, 07 May 2012 16:01:15 +0800
Eli Zaretskii <eliz <at> gnu.org> writes:

>> I installed the patch below, which seems to fix this specific problem
>> (according to my testing under Wine ;-)
>
> I'm not sure why it worked for you, because it still doesn't for me.

I also still see the bug, running under Wine.

> IOW, the problem is that shell-parse-pcomplete-arguments removes the
> backslash in "d:\gnu", because the last alternative in the above
> regexp treats backslashes as escape characters, which on MS-DOS and
> MS-Windows is true (for shell commands) only when the backslash
> precedes a quote character (").

How about something like the following?  (Works for me on Wine with your
test case, but I don't know if it breaks quoting.)


=== modified file 'lisp/shell.el'
*** lisp/shell.el	2012-05-05 04:18:49 +0000
--- lisp/shell.el	2012-05-07 07:59:33 +0000
***************
*** 397,402 ****
--- 397,408 ----
                       ((null pcomplete-arg-quote-list)
                        (goto-char (match-beginning 3)) "\\")
                       ((= (match-beginning 3) (match-end 3)) "\\")
+ 		     ;; On Windows, the backslash is an escape
+ 		     ;; character only if it precedes a quote char.
+ 		     ((and (memq system-type
+ 				 '(ms-dos windows-nt darwin cygwin))
+ 			   (not (equal (match-string 3) "\"")))
+ 		      (concat "/" (match-string 3)))
                       (t (match-string 3)))
                      arg))
               ((match-beginning 2)       ;Double quote.





This bug report was last modified 13 years and 93 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.