From: Joost Kremers <joostkremers@fastmail.fm>
To: Aidan Gauland <aidalgol@no8wireless.co.nz>
Cc: 15385@debbugs.gnu.org
Subject: bug#15385: [Eshell] Directory completion overwrites preceding characters
Date: Sat, 21 Sep 2013 16:42:46 +0200 [thread overview]
Message-ID: <87pps29qxl.fsf@fastmail.fm> (raw)
In-Reply-To: <87d2o2ddjh.fsf@dimension8.tehua.net>
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 <joostkremers@fastmail.fm> 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
next prev parent reply other threads:[~2013-09-21 14:42 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <mailman.2172.1379254394.10748.bug-gnu-emacs@gnu.org>
2013-09-21 4:06 ` bug#15385: [Eshell] Directory completion overwrites preceding characters Aidan Gauland
2013-09-15 14:11 ` Joost Kremers
2013-09-21 11:29 ` Thierry Volpiatto
2021-12-04 3:40 ` Lars Ingebrigtsen
2021-12-04 21:37 ` Joost Kremers
2021-12-04 22:14 ` Lars Ingebrigtsen
2013-09-21 14:42 ` Joost Kremers [this message]
[not found] ` <mailman.2634.1379763074.10748.bug-gnu-emacs@gnu.org>
2013-09-22 18:55 ` Aidan Gauland
[not found] ` <mailman.2651.1379774595.10748.bug-gnu-emacs@gnu.org>
2013-09-22 19:00 ` Aidan Gauland
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87pps29qxl.fsf@fastmail.fm \
--to=joostkremers@fastmail.fm \
--cc=15385@debbugs.gnu.org \
--cc=aidalgol@no8wireless.co.nz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.