From: Bart Schaefer <schaefer@brasslantern.com>
To: Zsh hackers list <zsh-workers@zsh.org>
Subject: Re: Completion oddities
Date: Mon, 11 Dec 2023 22:11:48 -0800 [thread overview]
Message-ID: <CAH+w=7aFMqY2rqf9Hq6FPX_vxGJLEo9vTRhE0RW64kSaB7sfMg@mail.gmail.com> (raw)
In-Reply-To: <CAH+w=7YWp-i5wJ_Pc3Do1v0M14twmjtCX3LuKsx6J6z8x9utEw@mail.gmail.com>
On Mon, Dec 11, 2023 at 6:48 PM Bart Schaefer <schaefer@brasslantern.com> 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.
prev parent reply other threads:[~2023-12-12 6:12 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-12-10 17:27 Bart Schaefer
2023-12-10 22:56 ` Bart Schaefer
2023-12-12 0:28 ` Oliver Kiddle
2023-12-12 2:10 ` Bart Schaefer
2023-12-12 2:48 ` Bart Schaefer
2023-12-12 6:11 ` Bart Schaefer [this message]
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=7aFMqY2rqf9Hq6FPX_vxGJLEo9vTRhE0RW64kSaB7sfMg@mail.gmail.com' \
--to=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).