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: Mon, 07 May 2012 20:40:12 +0300 Message-ID: <83d36f3n5v.fsf@gnu.org> References: <83obqeiwb0.fsf@gnu.org> <83mx5n6ceu.fsf@gnu.org> <83fwbf5e8v.fsf@gnu.org> <87k40ov2r8.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org X-Trace: dough.gmane.org 1336412590 30428 80.91.229.3 (7 May 2012 17:43:10 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 May 2012 17:43:10 +0000 (UTC) Cc: 11348@debbugs.gnu.org To: Chong Yidong Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 07 19:43:09 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 1SRRxj-0000e9-17 for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 May 2012 19:43:07 +0200 Original-Received: from localhost ([::1]:38987 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRRxi-0003ja-CJ for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 May 2012 13:43:06 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:49773) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRRxf-0003jM-Cq for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 13:43:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRRxd-0004EU-Ju for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 13:43:02 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38759) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRRxd-0004EM-Gv for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 13:43:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SRRza-0007En-Ay for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 13:45:02 -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: Mon, 07 May 2012 17:45:02 +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.133641265827754 (code B ref 11348); Mon, 07 May 2012 17:45:02 +0000 Original-Received: (at 11348) by debbugs.gnu.org; 7 May 2012 17:44:18 +0000 Original-Received: from localhost ([127.0.0.1]:39793 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRRyr-0007Db-NJ for submit@debbugs.gnu.org; Mon, 07 May 2012 13:44:17 -0400 Original-Received: from mtaout22.012.net.il ([80.179.55.172]:62552) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRRyp-0007DM-7t for 11348@debbugs.gnu.org; Mon, 07 May 2012 13:44:16 -0400 Original-Received: from conversion-daemon.a-mtaout22.012.net.il by a-mtaout22.012.net.il (HyperSendmail v2007.08) id <0M3N00M00YECK900@a-mtaout22.012.net.il> for 11348@debbugs.gnu.org; Mon, 07 May 2012 20:42:07 +0300 (IDT) Original-Received: from HOME-C4E4A596F7 ([87.69.210.75]) by a-mtaout22.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0M3N00K8LYI6IA31@a-mtaout22.012.net.il>; Mon, 07 May 2012 20:42:07 +0300 (IDT) In-reply-to: <87k40ov2r8.fsf@gnu.org> 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:59844 Archived-At: > From: Chong Yidong > Cc: Stefan Monnier , 11348@debbugs.gnu.org > Date: Mon, 07 May 2012 16:01:15 +0800 > > Eli Zaretskii 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 fixes the recipe in the original bug report (I get d:\gnu/), but again fails in this variant: M-! cd "d:\gnu TAB It produces "d:\/gnu/ (with the leading quote) instead of "d:\gnu/ If I type M-! cd "d:/gnu TAB I get "d:/gnu/, as expected. Thanks.