emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 12e9221: * lisp/emacs-lisp/eldoc.el: Let the user i


From: Stefan Monnier
Subject: [Emacs-diffs] master 12e9221: * lisp/emacs-lisp/eldoc.el: Let the user interrupt the search
Date: Tue, 4 Dec 2018 18:17:33 -0500 (EST)

branch: master
commit 12e922156c86a26fa4bb2cb9e7d2b3fd639e4707
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/emacs-lisp/eldoc.el: Let the user interrupt the search
    
    (eldoc-print-current-symbol-info): Use while-no-input and non-essential.
---
 lisp/emacs-lisp/eldoc.el | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 49ba71f..21be4f3 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]