]> git.eshelyaron.com Git - emacs.git/commit
Handle point not at EOB in minibuffer-choose-completion
authorSpencer Baugh <sbaugh@catern.com>
Fri, 21 Apr 2023 18:55:00 +0000 (14:55 -0400)
committerEli Zaretskii <eliz@gnu.org>
Tue, 2 May 2023 17:54:25 +0000 (20:54 +0300)
commite338a8ac41d4a9fd798dda90275abe75ac071335
treeb27cbc3c52c5ba8cf9da86609d6c9834eef1dcb4
parentfceaf230b063a0df9fb79cd5159cac4a761aba87
Handle point not at EOB in minibuffer-choose-completion

Without this change, only the minibuffer contents before point
are cleared when a completion is chosen, which results in stray
text when point is in the middle of the minibuffer.

After this change, we heuristically decide either to clear the
whole buffer or only part of it, taking into account the
location of point.

This is a backport for the Emacs 29 release branch of a simpler
fix in minibuffer-completion-help.

* lisp/minibuffer.el (minibuffer-next-completion):
(minibuffer-choose-completion):
Recalculate completion-base-affixes with point.  (Bug#62700)
lisp/minibuffer.el