zsh-workers
 help / color / mirror / code / Atom feed
From: Bart Schaefer <schaefer@brasslantern.com>
To: "Lawrence Velázquez" <larryv@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>,
	Marlon Richert <marlon.richert@gmail.com>
Subject: Re: [PATCH] Make _expand handle aliases (was Re: [PATCH] Make _expand_alias more usable as a completer)
Date: Thu, 31 Mar 2022 17:37:15 -0700	[thread overview]
Message-ID: <CAH+w=7btqB_f+tnOW22k_1479AnpX0hMyocd6TT9kOyUyLKMrA@mail.gmail.com> (raw)
In-Reply-To: <38d114d9-d4fc-4f50-bc55-2f8402ee126c@www.fastmail.com>

On Thu, Mar 31, 2022 at 3:36 PM Lawrence Velázquez <larryv@zsh.org> wrote:
>
> On Sun, Aug 1, 2021, at 2:50 PM, Marlon Richert wrote:
> > Alright, here's a new patch, which moves the alias expansion code from
> > _expand_alias to _expand (and refactors it) and deprecates
> > _expand_alias's use as a completer. I also updated the documentation
> > and added tests.
>
> *bump*

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.

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.


  reply	other threads:[~2022-04-01  0:38 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 [this message]
2022-05-06  5:57                     ` Marlon Richert
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='CAH+w=7btqB_f+tnOW22k_1479AnpX0hMyocd6TT9kOyUyLKMrA@mail.gmail.com' \
    --to=schaefer@brasslantern.com \
    --cc=larryv@zsh.org \
    --cc=marlon.richert@gmail.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).