]> git.eshelyaron.com Git - emacs.git/commit
Deselect the selected completion candidate when typing
authorSpencer Baugh <sbaugh@catern.com>
Thu, 23 Nov 2023 13:37:29 +0000 (13:37 +0000)
committerJuri Linkov <juri@linkov.net>
Sun, 3 Dec 2023 17:20:51 +0000 (19:20 +0200)
commit3c093148958d56e0ed8e12a8e00ced1ef052259a
tree3c7e84ad830af9ad50d581e65491bedb2064cc74
parent33b6de7acec0536290939303855947c0c2af57d2
Deselect the selected completion candidate when typing

minibuffer-choose-completion-or-exit submits the selected completion
candidate, if any, ignoring the contents of the minibuffer.  But a
user might select a completion candidate and then want to type
something else in the minibuffer and submit what they typed.

Now typing will automatically deselect the selected completion
candidate so that minibuffer-choose-completion-or-exit will not choose
it.

minibuffer-choose-completion has the same behavior as before, and is
not affected by the deselection.

* lisp/minibuffer.el (completion-auto-deselect, completions--deselect)
(completions--after-change): Add.
(minibuffer-completion-help): Add completions--after-change hook.
(minibuffer-next-completion): Bind completion-auto-deselect to nil to
avoid immediately deselecting the completion.
(minibuffer-choose-completion-or-exit): Bind
choose-completion-deselect-if-after so deselection takes effect.
(display-completion-list): Guarantee a newline at the beginning of
*Completions* to avoid ambiguity about candidate selection.
* lisp/simple.el (choose-completion-deselect-if-after): Add.
(choose-completion): Check choose-completion-deselect-if-after.
* etc/NEWS: Announce.
etc/NEWS
lisp/minibuffer.el
lisp/simple.el