Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer)
- X-seq: zsh-workers 50175
- From: Marlon Richert <marlon.richert@xxxxxxxxx>
- To: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- Cc: Lawrence Velázquez <larryv@xxxxxxx>, Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer)
- Date: Fri, 6 May 2022 08:57:42 +0300
- Archived-at: <https://zsh.org/workers/50175>
- In-reply-to: <CAH+w=7btqB_f+tnOW22k_1479AnpX0hMyocd6TT9kOyUyLKMrA@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAHLkEDvg5-vdd_AHeiR9-TstXUh2-5j9yQNDns1mC2qR3zM_Tw@mail.gmail.com> <36227-1622676235.815398@zrY_.ZerV.zhJL> <CAHLkEDvYRtQETQfEGUA9FEcseRNT7kAhoiGM4KRANmi2aLq1sA@mail.gmail.com> <f67ff823-59fc-4271-8412-6fbbc07aacd3@www.fastmail.com> <CAHYJk3Sr1D2QJgT9pNduXLdpf8hBTsx558SVX+_QpSWkPN=9OA@mail.gmail.com> <CAHLkEDv5QTn_sPL7chv_YEbj3aGZ-hKJ5RbORyRaj4G=b91tpg@mail.gmail.com> <906332f9-027b-4b21-bb7f-3fd7118154af@www.fastmail.com> <CAH+w=7bhr0Gs1p1io6a9kG2bZS5Eqq9P+OD6y6NDRuNT36ZzUg@mail.gmail.com> <CAHLkEDs+4vv0xqq2u5g6msgpstrErFjqEFshHocfbqqYyh-SVQ@mail.gmail.com> <38d114d9-d4fc-4f50-bc55-2f8402ee126c@www.fastmail.com> <CAH+w=7btqB_f+tnOW22k_1479AnpX0hMyocd6TT9kOyUyLKMrA@mail.gmail.com>
On Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
> I'm uncomfortable with the change that expanding aliases in command
> position is the default behavior of _expand. It never did this
> before. It means that if there is an alias that is the prefix of
> another command name, expanding that alias will take precedence over
> completing the suffix, which i think is an undesirable effect as a new
> default.
Yes, I agree; that is indeed a problem. I hadn't considered that.
> Furthermore, the behavior is a bit odd. With the patch, given an
> alias named "xyz", and completer style _expand _complete, if you type
> TAB after "xy" you get "xyz " (with trailing space). Since TAB after
> "xyz" yields the the value of the alias, the added space feels wrong;
> the first TAB should stop before the space is appended so a second TAB
> can do the expanding. Perhaps there's a combination of the supported
> styles that provides this behavior, I didn't dig into it very far.
I don't like the way the space is added either, but it worked like
that before, too. I didn't want to change the logic. I think that's
better left to a separate patch.
In any case, perhaps moving alias expansion into _expand is not such a
good idea after all. I suppose it's better to be offered as part of
completing aliases, but listed separately, after the actual alias
completions.
Would it make more sense to fold alias expansion into _aliases?
Messages sorted by:
Reverse Date,
Date,
Thread,
Author