Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Quote of % in a completed func name?



other thing i've noted: you used ~ flag not in the idiomatic way, ie. not as (~j:|:) but before the var: (j:|:)~functions. Why?

On Tue, 19 Sept 2023 at 17:08, Sebastian Gniazdowski <sgniazdowski@xxxxxxxxx> wrote:
it works, thanks. Question: what does the * flag do in ${(*)BUFFER … …?

On Mon, 18 Sept 2023 at 09:56, Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
On Mon, Sep 18, 2023 at 6:42 AM Sebastian Gniazdowski
<sgniazdowski@xxxxxxxxx> wrote:
>
> Could the % be somehow be quoted after completing? (\%exa works and calls the %func functon)

Firstly, to prevent conflicts you can remove "jobs" from the same
completion zstyle I sent earlier for leading colons in command
completion.

For command execution, you're probably best going with a
zle-line-finish hook that does a search-and-replace, e.g.

BUFFER=${(*)BUFFER//#%(#b)(${(kj:|:)~functions[(I)%*]})/\\\\$match[1]}

(remove (*) and setopt extendedglob for older zsh)


--
Best regards,
Sebastian Gniazdowski



--
Best regards,
Sebastian Gniazdowski



Messages sorted by: Reverse Date, Date, Thread, Author