From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#11348: 24.0.95; TAB-completion in shell-command produces d:\/foo on MS-Windows Date: Sat, 05 May 2012 09:33:04 +0300 Message-ID: <83fwbf5e8v.fsf@gnu.org> References: <83obqeiwb0.fsf@gnu.org> <83mx5n6ceu.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1336199783 9269 80.91.229.3 (5 May 2012 06:36:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 5 May 2012 06:36:23 +0000 (UTC) Cc: 11348@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat May 05 08:36:22 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1SQYbM-0004nT-Th for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 May 2012 08:36:21 +0200 Original-Received: from localhost ([::1]:58292 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQYbM-0001Qp-7y for geb-bug-gnu-emacs@m.gmane.org; Sat, 05 May 2012 02:36:20 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:36764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQYbI-0001Q7-B5 for bug-gnu-emacs@gnu.org; Sat, 05 May 2012 02:36:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQYbG-0003hK-J3 for bug-gnu-emacs@gnu.org; Sat, 05 May 2012 02:36:15 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35676) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQYbG-0003hF-FA for bug-gnu-emacs@gnu.org; Sat, 05 May 2012 02:36:14 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SQYcz-0000jT-HP for bug-gnu-emacs@gnu.org; Sat, 05 May 2012 02:38:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 05 May 2012 06:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11348 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11348-submit@debbugs.gnu.org id=B11348.13361998252745 (code B ref 11348); Sat, 05 May 2012 06:38:01 +0000 Original-Received: (at 11348) by debbugs.gnu.org; 5 May 2012 06:37:05 +0000 Original-Received: from localhost ([127.0.0.1]:36710 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQYc4-0000iD-FK for submit@debbugs.gnu.org; Sat, 05 May 2012 02:37:04 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:34934) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQYc1-0000hi-Tz for 11348@debbugs.gnu.org; Sat, 05 May 2012 02:37:03 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M3J00A00E62GE00@a-mtaout22.012.net.il> for 11348@debbugs.gnu.org; Sat, 05 May 2012 09:35:07 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M3J00A5KEAHGM10@a-mtaout22.012.net.il>; Sat, 05 May 2012 09:35:06 +0300 (IDT) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:59771 Archived-At: > From: Stefan Monnier > Cc: 11348@debbugs.gnu.org > Date: Sat, 05 May 2012 00:20:17 -0400 > > >> 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 ;-) I'm not sure why it worked for you, because it still doesn't for me. Are you applying the changes to the emacs-24 branch? Because that's what I do, this bug being against Emacs 24.0.96 and a regression from Emacs 23.4. According to my debugging inside shell-parse-pcomplete-arguments, what happens there is that this fragment (while (looking-at (eval-when-compile (concat "\\(?:[^\s\t\n\\\"']+" "\\|'\\([^']*\\)'?" "\\|\"\\(\\(?:[^\"\\]\\|\\\\.\\)*\\)\"?" "\\|\\\\\\(\\(?:.\\|\n\\)?\\)\\)"))) decides that \g is an escape sequence. (Btw, what's the purpose of using eval-when-compile here?) Therefore, the value of args at the end of the loop is ("nu" "g" "d:") After this line: (push (mapconcat #'identity (nreverse arg) "") args))) it becomes ("d:" "g" "nu") and the result of the function is therefore (("cd" "d:gnu") 16 19) By contrast, if I type "M-! cd d:/gnu TAB", the results are, correspondingly, ("d:/gnu") and (("cd" "d:/gnu") 16 19) 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 ("). Thanks.