help / color / mirror / code / Atom feed
From: Marlon Richert <marlon.richert@gmail.com>
To: Oliver Kiddle <opk@zsh.org>
Cc: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: [PATCH] Make _expand_alias more usable as a completer
Date: Fri, 4 Jun 2021 00:42:55 +0300	[thread overview]
Message-ID: <CAHLkEDvYRtQETQfEGUA9FEcseRNT7kAhoiGM4KRANmi2aLq1sA@mail.gmail.com> (raw)
In-Reply-To: <36227-1622676235.815398@zrY_.ZerV.zhJL>

On Thu, Jun 3, 2021 at 2:24 AM Oliver Kiddle <opk@zsh.org> wrote:
> In practical tests, I'm not finding that this works too well, it ends up
> removing the characters typed.

I cannot reproduce that. Here's what I tried:

% cd $(mktemp -d)
% print "PS1='%# ' PS2='' RPS2='< %^'\nsetopt transientrprompt" > .zshrc
% exec env -i HOME=$PWD TERM=$TERM zsh -d
% autoload -Uz compinit
% compinit
% _foo() {
compadd -QU 'ls -al'
compadd -Q lsusb lsvfs
% compdef _foo foo
% foo <tab>
% foo ls<tab>
ls -al  lsusb   lsvfs

It inserts the unambiguous prefix and cycles through the three
choices, without removing any characters I've typed. Am I missing

> I also wonder if this would be better done from within _command_names
> directly but I'm not sure.

Actually, I feel like it could instead be added to the _expand
completer. Would that be a better idea than what I presented in this
patch? I could, for example, move the actual business logic for
expanding aliases from _expand_alias to _expand, and then have
_expand_alias call _expand to do the work.

  reply	other threads:[~2021-06-03 21:43 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-28 21:59 Marlon Richert
2021-06-02 23:23 ` Oliver Kiddle
2021-06-03 21:42   ` Marlon Richert [this message]
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
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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAHLkEDvYRtQETQfEGUA9FEcseRNT7kAhoiGM4KRANmi2aLq1sA@mail.gmail.com \
    --to=marlon.richert@gmail.com \
    --cc=opk@zsh.org \
    --cc=zsh-workers@zsh.org \


* 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


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).