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: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: 11348 <at> debbugs.gnu.org
Subject: bug#11348: 24.0.95; TAB-completion in shell-command produces d:\/foo on MS-Windows
Date: Fri, 04 May 2012 13:59:43 -0400
>  M-! cd d:\gnu TAB
> (A directory 'd:/gnu' exists on my disk.)
> After pressing the TAB key, the minibuffer displays this:
>   cd d:\/gnu/

Duh, I somehow assumed it was on the trunk (seeing how it was reported
soon after I modified code on the trunk in this area).

IIUC from the rest of the thread, the problem is in the pcomplete code
(it affects `cd' but not `toto').  That's bad because the pcomplete code
is even trickier than the rest.

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?

> This works better, it produces "cd d:\gnu/ ", which is ugly, but
> correct.

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

> Perhaps Stefan could at some point add some documentation about the
> internals, that would allow mere mortals such as myself debug the
> completion code.

I'd love to, but I'm much too deeply in it to know what needs more
documentation, so fire away your questions and I'll reply with
comments&docstrings.


        Stefan


=== modified file 'lisp/shell.el'
--- lisp/shell.el	2012-02-28 08:17:21 +0000
+++ lisp/shell.el	2012-05-04 17:57:59 +0000
@@ -429,7 +429,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)





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.