bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19626: 25.0.50; eshell: extended directory syntax ("...") does not c


From: Michalis V.
Subject: bug#19626: 25.0.50; eshell: extended directory syntax ("...") does not complete
Date: Fri, 27 Aug 2021 18:28:16 +0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

Lars Ingebrigtsen <larsi@gnus.org> writes:

> "Michalis V." <mvar.40k@gmail.com> writes:
>
>> i cannot reproduce this in 28.0.50. Basically what i did was
>>
>> mkdir ...
>>
>> then repeat the steps above. Eshell autocompletes .../ fine, even adding
>> another similar directory will bring up the dialog:
>
> I think eshell has an "extended directory" concept where "..." is
> supposed to expand to (I think) all parent directories?  So there isn't
> supposed to be any directory literally called "...".
>
> I think.  But I'm not overly familiar with eshell.  Let's see...  Yup:
>
> (defun eshell-expand-multiple-dots (filename)
>   "Convert `...' to `../..', `....' to `../../..', etc..

oops, i wasn't even aware of this eshell feature, sorry about that!

I did some debugging into how completion works and it looks like
eshell-complete-parse-arguments in em-cmpl.el is responsible for
parsing the arguments before passing them to the generic(?) completion
code. Attached is a patch that adds an additional check at the end of
said defun that will substitute any .../ dots into the proper expanded
form before returning. There are some other defuns that are called by
eshell-complete-parse-arguments, namely eshell-parse-argument(s) but i
*think* this substitution is better suited (read: safer) to be placed to
their caller.
Note that this works for "cd .../", completion for other operations like
cp do not work currently (most probably because cd has its own
implementation in eshell/cd?)

i'm not sure whether this is the correct solution to this problem so if
there are any concerns please let me know and i'll continue the digging

thanks,
Michalis

Attachment: em-cmpl.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]