Closed rennsax closed 3 weeks ago
That looks like it should work, I'll try to see if I can figure out why it doesn't. But also, why remove the dispatch character instead of simply not using it?
Thanks for reply! Yes, I can simply avoid using &
, but since I use corfu and set corfu-auto
to t, every time I type &
in a general buffer, Emacs is stuck for a while.
The main problem here is that Emacs doesn't offer good facilities to distinguish completion styles for in-buffer and minibuffer completion. Completion styles are considered global. In most cases it works when minibuffer-only completion styles are configured buffer locally in a minibuffer setup hook. The global settings could be more restricted such that they work better with in-buffer completion.
However there are commands which break like consult-line
which assume that completion styles are global since it uses completion filtering inside and outside of the minibuffer. One can work around the resulting problems by configuring overrides globally for the consult-line
category, but the configuration will be quite a mess in my opinion.
Nevertheless I do not observe the problems described by @rennsax. I suspect that the auto completion settings are too aggressive (e.g., corfu-auto-delay
is too small or/and corfu-auto-prefix
is too small).
To come back to @rennsax's initial question: The reason why the advice doesn't work is that it doesn't wrap around the interactive
block. If you look at the definition of insert-char
, you have to add the advice around read-char-by-name
instead.
In case you are using Vertico, you can also use vertico-multiform-mode
to customize variables locally per command. See the Vertico README for details.
I remove the
&
affix (orderless-annotation
) fromorderless-affix-dispatch-alist
because it is really slow when there are a lot of candidates.However in some cases, I still want to use this dispatcher. For example, use
orderless-annotation
wheninsert-char
so I can match the Unicode.I've tried:
But it seems to have no effect.