From 683961cd733d4a660ffdb9c1a6e6ad565ffae2cb Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Sun, 19 Feb 2023 21:30:02 +0200 Subject: [PATCH] * 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). --- lisp/simple.el | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) 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))) -- 2.39.2