bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#11348: 24.0.95; TAB-completion in shell-command produces d:\/foo on


From: Stefan Monnier
Subject: bug#11348: 24.0.95; TAB-completion in shell-command produces d:\/foo on MS-Windows
Date: Sat, 05 May 2012 00:20:17 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (gnu/linux)

>> This said, based on your description, the problem may simply come from
>> shell.el's setting of pcomplete-arg-quote-list which tells pcomplete
>> that \ is an escape char.
>> I.e. does the patch below fix the problem?
> No, I still get "d:\/gnu/".

I installed the patch below, which seems to fix this specific problem
(according to my testing under Wine ;-)

>> Which part is ugly?  The \, the /, or the use of a mix of them?
> The mix.

Yes, I think I agree.  I'll have to think about it some more.


        Stefan


=== modified file 'lisp/ChangeLog'
--- lisp/ChangeLog      2012-05-04 10:26:36 +0000
+++ lisp/ChangeLog      2012-05-05 04:16:59 +0000
@@ -1,3 +1,10 @@
+2012-05-05  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * shell.el (shell-completion-vars): Set pcomplete-arg-quote-list like
+       shell-delimiter-argument-list.
+       (shell-parse-pcomplete-arguments):
+       Obey pcomplete-arg-quote-list (bug#11348).
+
 2012-05-04  Chong Yidong  <cyd@gnu.org>
 
        * select.el (xselect--encode-string): Always use utf-8 for TEXT on

=== modified file 'lisp/shell.el'
--- lisp/shell.el       2012-02-28 08:17:21 +0000
+++ lisp/shell.el       2012-05-05 04:13:57 +0000
@@ -393,8 +393,11 @@
             (goto-char (match-end 0))
             (cond
              ((match-beginning 3)       ;Backslash escape.
-              (push (if (= (match-beginning 3) (match-end 3))
-                        "\\" (match-string 3))
+              (push (cond
+                     ((null pcomplete-arg-quote-list)
+                      (goto-char (match-beginning 3)) "\\")
+                     ((= (match-beginning 3) (match-end 3)) "\\")
+                     (t (match-string 3)))
                     arg))
              ((match-beginning 2)       ;Double quote.
               (push (replace-regexp-in-string
@@ -429,7 +432,7 @@
   (set (make-local-variable 'pcomplete-parse-arguments-function)
        #'shell-parse-pcomplete-arguments)
   (set (make-local-variable 'pcomplete-arg-quote-list)
-       (append "\\ \t\n\r\"'`$|&;(){}[]<>#" nil))
+       shell-delimiter-argument-list)
   (set (make-local-variable 'pcomplete-termination-string)
        (cond ((not comint-completion-addsuffix) "")
              ((stringp comint-completion-addsuffix)






reply via email to

[Prev in Thread] Current Thread [Next in Thread]