From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Aidan Gauland Newsgroups: gmane.emacs.bugs Subject: bug#15385: [Eshell] Directory completion overwrites preceding characters Date: Sat, 21 Sep 2013 16:06:10 +1200 Message-ID: <87d2o2ddjh.fsf@dimension8.tehua.net> References: NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379736436 12580 80.91.229.3 (21 Sep 2013 04:07:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2013 04:07:16 +0000 (UTC) Cc: Joost Kremers To: 15385@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 21 06:07:19 2013 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 1VNETW-0006W2-PE for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 06:07:18 +0200 Original-Received: from localhost ([::1]:58517 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNETW-0007sD-8e for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 00:07:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:38548) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNETN-0007s1-3R for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 00:07:15 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNETG-0007IC-L2 for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 00:07:09 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:44121) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNETG-0007HV-Hj for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 00:07:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VNETG-00038h-2y for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 00:07:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Aidan Gauland Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2013 04:07:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 15385 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 15385-submit@debbugs.gnu.org id=B15385.137973638512023 (code B ref 15385); Sat, 21 Sep 2013 04:07:02 +0000 Original-Received: (at 15385) by debbugs.gnu.org; 21 Sep 2013 04:06:25 +0000 Original-Received: from localhost ([127.0.0.1]:52413 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNESe-00037q-OX for submit@debbugs.gnu.org; Sat, 21 Sep 2013 00:06:25 -0400 Original-Received: from goat.amuri.net ([203.99.132.195]:59707) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNESb-00037e-2w for 15385@debbugs.gnu.org; Sat, 21 Sep 2013 00:06:22 -0400 Original-Received: from dimension8.tehua.net (unknown [49.143.231.163]) (using TLSv1 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) (Authenticated sender: aidalgol@amuri.net) by goat.amuri.net (Postfix) with ESMTPSA id 2ABE0FF389; Sat, 21 Sep 2013 16:08:07 +1200 (NZST) In-Reply-To: (Joost Kremers's message of "Sun, 15 Sep 2013 16:11:44 +0200") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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:78639 Archived-At: The bug seems to be in pcomplete, line 1140 of pcomplete.el, to be exact: (delete-char (- (length (comint-quote-filename stub)))) `comint-quote-filename' is given a relative path, "~/Dro", and returning an absolute path, "/home/joost/Dropbox/". The length of this is then passed to `delete-char' to clear the argument being completed, but the length is wrong when it's a relative path, because `comint-quote-filename' seems to always return an absolute path. I'm not sure how to fix this without breaking something else or leaving out other special cases, such as ${FOO}tm[TAB], because I still don't really understand how pcomplete works. I still want to sit down with pcomplete for a while and document it (it was left undocumented along with Eshell, of which it was originally a component), so unless someone else can come up with a good fix, this bug will have to remain outstanding for a while, unfortunately. --Aidan Joost Kremers writes: > Starting from `emacs -Q', if I do > > (setq eshell-cmpl-ignore-case t) > > and then start up a shell, TAB completion behaves incorrectly under some > conditions. > > Specifically, I type a command such as: > > $ cp ~/Dropbox/Work/Reading/Wilbur_Martinez2002.pdf ~/Dro > > At this point, I hit TAB to complete `~/Dro' and get: > > $ cp ~/Dropbox/Work/Reading/Wilbur_Martine/home/joost/Dropbox/ > > Note that the problem does *not* occur with the first file path. If I > hit TAB to complete > > $ cp ~/Dro > > then completion produces the correct result: > > $ cp ~/Dropbox/ > > It seems the problem occurs when the file path is the second argument on > the command line, because if I type: > > $ ls ~/Dropbox/Work/Literature/k/kim2002.pdf ~/dro > > and hit TAB to complete, the result is also: > > $ ls ~/Dropbox/Work/Literature/k/ki/home/joost/Dropbox/ > > It does not occur when there is a switch preceding the file path: > > $ ls -l ~/dro > > completes fine. > > Thanks, > > Joost Kremers