]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/icomplete.el (icomplete-exhibit): Check validity of the current buffer.
authorJuri Linkov <juri@linkov.net>
Thu, 9 Feb 2023 18:08:15 +0000 (20:08 +0200)
committerJuri Linkov <juri@linkov.net>
Thu, 9 Feb 2023 18:08:15 +0000 (20:08 +0200)
This function is applicable only in buffers where functions like
icomplete--field-beg can be called, and they expects either non-nil
completion-in-region--data or window-minibuffer-p (bug#61308).

lisp/icomplete.el

index 014f38b2024da2f900abe07a6b3b8cc22a73e6f3..f7a91599f3bd15cb790745002a75f0c163544e8e 100644 (file)
@@ -686,11 +686,13 @@ If it's on, just add the vertical display."
 Should be run via minibuffer `post-command-hook'.
 See `icomplete-mode' and `minibuffer-setup-hook'."
   (when (and icomplete-mode
+             ;; Check if still in the right buffer (bug#61308)
+             (or (window-minibuffer-p) completion-in-region--data)
              (icomplete-simple-completing-p)) ;Shouldn't be necessary.
     (let ((saved-point (point)))
       (save-excursion
         (goto-char (icomplete--field-end))
-                                        ; Insert the match-status information:
+        ;; Insert the match-status information:
         (when (and (or icomplete-show-matches-on-no-input
                        (not (equal (icomplete--field-string)
                                    icomplete--initial-input)))