]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/simple.el (choose-completion): Check for completion-in-region-mode.
authorJuri Linkov <juri@linkov.net>
Sun, 19 Feb 2023 19:30:02 +0000 (21:30 +0200)
committerJuri Linkov <juri@linkov.net>
Sun, 19 Feb 2023 19:30:02 +0000 (21:30 +0200)
Don't use base-affixes when completion-use-base-affixes is non-nil
in completion-in-region-mode (bug#61535).

lisp/simple.el

index 27aeb2fa8ccd54a21e40141f3cd70c0777062ded..5f23910efc6baca28acfba6023864de3328ad611 100644 (file)
@@ -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)))