Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: Completion oddities
- X-seq: zsh-workers 52411
- From: Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx>
- To: Zsh hackers list <zsh-workers@xxxxxxx>
- Subject: Re: Completion oddities
- Date: Mon, 11 Dec 2023 22:11:48 -0800
- Archived-at: <https://zsh.org/workers/52411>
- In-reply-to: <CAH+w=7YWp-i5wJ_Pc3Do1v0M14twmjtCX3LuKsx6J6z8x9utEw@mail.gmail.com>
- List-id: <zsh-workers.zsh.org>
- References: <CAH+w=7YZRQru3D6Cb6G6PMzVpkG9fbeOwbG_3CR-WD8mTU4Uqw@mail.gmail.com> <36723-1702340891.599700@Cxey.Q8kE.H2LY> <CAH+w=7apngAvCPR+tVo=56aFMEmvQhr9iPX-JEDJM6dd3x+cow@mail.gmail.com> <CAH+w=7YWp-i5wJ_Pc3Do1v0M14twmjtCX3LuKsx6J6z8x9utEw@mail.gmail.com>
On Mon, Dec 11, 2023 at 6:48 PM Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
>
> I know, I'm doing exactly what I ask others not to do and not showing
> an actual example.
OK, stupid minimal example:
dummy_correct() {
local curcontext=${WIDGET}:::
zle _correct_word
}
zle -N dummy_correct
bindkey ^Xc dummy_correct
zstyle -e '*' ignored-patterns 'zle -I; print -- ignore: $curcontext;
reply=(\*)'
zstyle -e '*' fake 'zle -I; print -- fake: $curcontext; reply=(\*)'
Hit ^Xc after any word (preferably not in command position or you'll
get a LOT of output) and note what $curcontext is printed.
_correct_word is kind of a silly example because aside from clobbering
$curcontext it's a one-line wrapper for _correct, but consider e.g.
_history_complete_word which does the same thing (incorrectly, I
think, it's missing a colon?) and is over 100 lines. _expand_alias is
(accidentally?) reasonable because it checks $funcstack before
whacking the context.
Messages sorted by:
Reverse Date,
Date,
Thread,
Author