]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/emacs-lisp/eldoc.el: Let the user interrupt the search
authorStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Dec 2018 23:15:44 +0000 (18:15 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Tue, 4 Dec 2018 23:15:44 +0000 (18:15 -0500)
(eldoc-print-current-symbol-info): Use while-no-input and non-essential.

lisp/emacs-lisp/eldoc.el

index 49ba71fb1b890ec78b4a917c8642c3e1ab9c2cb4..21be4f3ce3257768979b69a44311b586c56483a9 100644 (file)
@@ -357,12 +357,15 @@ return any documentation.")
   ;; This is run from post-command-hook or some idle timer thing,
   ;; so we need to be careful that errors aren't ignored.
   (with-demoted-errors "eldoc error: %s"
-    (and (or (eldoc-display-message-p)
-             ;; Erase the last message if we won't display a new one.
-             (when eldoc-last-message
-               (eldoc-message nil)
-               nil))
-        (eldoc-message (funcall eldoc-documentation-function)))))
+    (if (not (eldoc-display-message-p))
+        ;; Erase the last message if we won't display a new one.
+        (when eldoc-last-message
+          (eldoc-message nil))
+      (let ((non-essential t))
+        ;; Only keep looking for the info as long as the user hasn't
+        ;; requested our attention.  This also locally disables inhibit-quit.
+        (while-no-input
+          (eldoc-message (funcall eldoc-documentation-function)))))))
 
 ;; If the entire line cannot fit in the echo area, the symbol name may be
 ;; truncated or eliminated entirely from the output to make room for the