From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Chong Yidong 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 16:01:15 +0800 Message-ID: <87k40ov2r8.fsf@gnu.org> References: <83obqeiwb0.fsf@gnu.org> <83mx5n6ceu.fsf@gnu.org> <83fwbf5e8v.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336377743 13210 80.91.229.3 (7 May 2012 08:02:23 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 7 May 2012 08:02:23 +0000 (UTC) Cc: 11348@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon May 07 10:02: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 1SRIti-00064h-2e for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 May 2012 10:02:22 +0200 Original-Received: from localhost ([::1]:42642 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRIth-0002s6-HP for geb-bug-gnu-emacs@m.gmane.org; Mon, 07 May 2012 04:02:21 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:35957) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRItZ-0002ll-DE for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 04:02:19 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SRItP-0008E4-8A for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 04:02:12 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:38084) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SRItP-0008Dt-5N for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 04:02:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SRIvJ-0001W5-O9 for bug-gnu-emacs@gnu.org; Mon, 07 May 2012 04:04:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Chong Yidong Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 07 May 2012 08:04: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.13363778105788 (code B ref 11348); Mon, 07 May 2012 08:04:01 +0000 Original-Received: (at 11348) by debbugs.gnu.org; 7 May 2012 08:03:30 +0000 Original-Received: from localhost ([127.0.0.1]:39118 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRIun-0001VI-8N for submit@debbugs.gnu.org; Mon, 07 May 2012 04:03:29 -0400 Original-Received: from fencepost.gnu.org ([208.118.235.10]:46682 ident=Debian-exim) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SRIuj-0001VA-Ua for 11348@debbugs.gnu.org; Mon, 07 May 2012 04:03:27 -0400 Original-Received: from [155.69.19.224] (port=53313 helo=ulysses) by fencepost.gnu.org with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1SRIsm-00007a-Q5; Mon, 07 May 2012 04:01:25 -0400 In-Reply-To: <83fwbf5e8v.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 05 May 2012 09:33:04 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.96 (gnu/linux) 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:59833 Archived-At: 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.