From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.bugs 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 Message-ID: References: <83obqeiwb0.fsf@gnu.org> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1336154426 15571 80.91.229.3 (4 May 2012 18:00:26 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Fri, 4 May 2012 18:00:26 +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 Fri May 04 20:00:25 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 1SQMnp-0000B2-Ab for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2012 20:00:25 +0200 Original-Received: from localhost ([::1]:52395 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQMno-0007LC-JV for geb-bug-gnu-emacs@m.gmane.org; Fri, 04 May 2012 14:00:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:44682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQMnl-0007L4-HN for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 14:00:23 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SQMni-0008QT-3n for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 14:00:21 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:35272) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SQMni-0008QE-0o for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 14:00:18 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SQMpO-00076w-BK for bug-gnu-emacs@gnu.org; Fri, 04 May 2012 14:02:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 04 May 2012 18:02: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.133615449727303 (code B ref 11348); Fri, 04 May 2012 18:02:02 +0000 Original-Received: (at 11348) by debbugs.gnu.org; 4 May 2012 18:01:37 +0000 Original-Received: from localhost ([127.0.0.1]:36306 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQMoz-00076J-HN for submit@debbugs.gnu.org; Fri, 04 May 2012 14:01:37 -0400 Original-Received: from ironport-out.teksavvy.com ([206.248.143.162]:58062) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SQMox-000766-EZ for 11348@debbugs.gnu.org; Fri, 04 May 2012 14:01:35 -0400 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AjEKACxOgk9MCqD5/2dsb2JhbABDtheCDAOBDIEIggkBAQQBViMFCws0EhQYDSSIHAW2MothhHkEpEWBXYMD X-IronPort-AV: E=Sophos;i="4.75,391,1330923600"; d="scan'208";a="178370241" Original-Received: from 76-10-160-249.dsl.teksavvy.com (HELO ceviche.home) ([76.10.160.249]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 04 May 2012 13:59:44 -0400 Original-Received: by ceviche.home (Postfix, from userid 20848) id EFED666109; Fri, 4 May 2012 13:59:43 -0400 (EDT) In-Reply-To: <83obqeiwb0.fsf@gnu.org> (Eli Zaretskii's message of "Thu, 26 Apr 2012 14:09:39 +0300") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.1.50 (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:59753 Archived-At: > 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)