From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Joost Kremers Newsgroups: gmane.emacs.bugs Subject: bug#15385: [Eshell] Directory completion overwrites preceding characters Date: Sat, 21 Sep 2013 16:42:46 +0200 Message-ID: <87pps29qxl.fsf@fastmail.fm> References: <87d2o2ddjh.fsf@dimension8.tehua.net> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1379774594 819 80.91.229.3 (21 Sep 2013 14:43:14 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 21 Sep 2013 14:43:14 +0000 (UTC) Cc: 15385@debbugs.gnu.org To: Aidan Gauland Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Sep 21 16:43:17 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 1VNOOz-0001vx-A3 for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 16:43:17 +0200 Original-Received: from localhost ([::1]:60407 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNOOy-0003dz-SY for geb-bug-gnu-emacs@m.gmane.org; Sat, 21 Sep 2013 10:43:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:41760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNOOq-0003cu-9p for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:43:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VNOOl-0000b8-2L for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:43:08 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:45388) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VNOOk-0000ay-RW for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:43:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1VNOOk-0002YH-C4 for bug-gnu-emacs@gnu.org; Sat, 21 Sep 2013 10:43:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Joost Kremers Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 21 Sep 2013 14:43: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.13797745799800 (code B ref 15385); Sat, 21 Sep 2013 14:43:02 +0000 Original-Received: (at 15385) by debbugs.gnu.org; 21 Sep 2013 14:42:59 +0000 Original-Received: from localhost ([127.0.0.1]:53681 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNOOh-0002Y0-2a for submit@debbugs.gnu.org; Sat, 21 Sep 2013 10:42:59 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]:41402) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1VNOOc-0002Xm-8g for 15385@debbugs.gnu.org; Sat, 21 Sep 2013 10:42:55 -0400 Original-Received: from compute5.internal (compute5.nyi.mail.srv.osa [10.202.2.45]) by gateway1.nyi.mail.srv.osa (Postfix) with ESMTP id 4AA9C21913; Sat, 21 Sep 2013 10:42:51 -0400 (EDT) Original-Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Sat, 21 Sep 2013 10:42:52 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=fastmail.fm; h= references:from:to:cc:subject:in-reply-to:date:message-id :mime-version:content-type; s=mesmtp; bh=95Iwr2lxRfjuFf99ygyBBXW xsu4=; b=MhYamiP+ZqM6u51PW92F+ITCpAaJWGF6IH2QVYcat2IxUCJDnKjRYca pFg4p9ivzM5G56HmJbRepi89B4SFaJs9eMFU/3H+Syj+qy6mgPGhWSF7Y8qnX1ZN 1TMzHqaXfdXFSG9Vv5bkuihpiFXC0/fvnETqQD4/Z2GgczDHciNI= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=references:from:to:cc:subject:in-reply-to :date:message-id:mime-version:content-type; s=smtpout; bh=95Iwr2 lxRfjuFf99ygyBBXWxsu4=; b=Kj4X1/ghynK9NNcYUZtjtQK434DxiVTWDugF5w YhUbUxyxummYPRevtGzJaEWyWzvdCdXLcroKudDof5f4xeRTEo93uKXw8w9XoFUD /8Z+SJ3+LxrPCskIBsKV64uMaKgoAeUWoybO5hYDkEYFPvOg3rUaJp4sSteP63FO S2IQs= X-Sasl-enc: Qmxx1LJqX2AlaEtwedqQri/MypOx3DwFg1k+we5wDuQk 1379774570 Original-Received: from eeenterprise.messagingengine.com (unknown [93.130.87.139]) by mail.messagingengine.com (Postfix) with ESMTPA id A34A4680198; Sat, 21 Sep 2013 10:42:50 -0400 (EDT) User-agent: mu4e 0.9.9.5; emacs 24.3.1 In-reply-to: <87d2o2ddjh.fsf@dimension8.tehua.net> 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:78651 Archived-At: But that still does not explain why the problem only occurs with the second argument on the command line. The first argument is completed without any problem, and *without* expanding ~ to /home/joost. Joost On Sat, Sep 21 2013, aidalgol@no8wireless.co.nz wrote: > 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 -- Joost Kremers Life has its moments