zsh-workers
 help / color / mirror / code / Atom feed
From: Marlon Richert <marlon.richert@gmail.com>
To: Bart Schaefer <schaefer@brasslantern.com>
Cc: "Lawrence Velázquez" <larryv@zsh.org>,
	"Zsh hackers list" <zsh-workers@zsh.org>
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	[thread overview]
Message-ID: <CAHLkEDteZ_CxinAuAym3Um+uE-MMDUEe-E0mErPKDwvDDNWPjA@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7btqB_f+tnOW22k_1479AnpX0hMyocd6TT9kOyUyLKMrA@mail.gmail.com>

On Fri, Apr 1, 2022 at 3:37 AM Bart Schaefer <schaefer@brasslantern.com> 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?


  reply	other threads:[~2022-05-06  5:58 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 21:59 [PATCH] Make _expand_alias more usable as a completer Marlon Richert
2021-06-02 23:23 ` Oliver Kiddle
2021-06-03 21:42   ` Marlon Richert
2021-06-20 19:49     ` Lawrence Velázquez
2021-06-20 21:08       ` Mikael Magnusson
2021-06-20 22:24         ` Marlon Richert
2021-07-18 23:34           ` Lawrence Velázquez
2021-07-28  3:23             ` Bart Schaefer
2021-08-01 18:50               ` [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer) Marlon Richert
2022-03-31 22:35                 ` Lawrence Velázquez
2022-04-01  0:37                   ` Bart Schaefer
2022-05-06  5:57                     ` Marlon Richert [this message]
2022-05-07 20:39                       ` Bart Schaefer
2022-05-11  7:32                         ` Marlon Richert

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=CAHLkEDteZ_CxinAuAym3Um+uE-MMDUEe-E0mErPKDwvDDNWPjA@mail.gmail.com \
    --to=marlon.richert@gmail.com \
    --cc=larryv@zsh.org \
    --cc=schaefer@brasslantern.com \
    --cc=zsh-workers@zsh.org \
    /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 public inbox

	https://git.vuxu.org/mirror/zsh/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).