From: Juri Linkov Date: Sun, 19 Feb 2023 19:30:02 +0000 (+0200) Subject: * lisp/simple.el (choose-completion): Check for completion-in-region-mode. X-Git-Tag: emacs-29.0.90~380 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=683961cd733d4a660ffdb9c1a6e6ad565ffae2cb;p=emacs.git * lisp/simple.el (choose-completion): Check for completion-in-region-mode. Don't use base-affixes when completion-use-base-affixes is non-nil in completion-in-region-mode (bug#61535). --- diff --git a/lisp/simple.el b/lisp/simple.el index 27aeb2fa8cc..5f23910efc6 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -9884,7 +9884,12 @@ minibuffer, but don't quit the completions window." (with-current-buffer buffer (choose-completion-string choice buffer - (or (and completion-use-base-affixes base-affixes) + ;; Don't allow affixes to replace the whole buffer when not + ;; in the minibuffer. Thus check for `completion-in-region-mode' + ;; to ignore non-nil value of `completion-use-base-affixes' set by + ;; `minibuffer-choose-completion'. + (or (and (not completion-in-region-mode) + completion-use-base-affixes base-affixes) base-position ;; If all else fails, just guess. (list (choose-completion-guess-base-position choice)))