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.