diff options
Diffstat (limited to 'lisp/emacs-lisp/eldoc.el')
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index 41b735489ff..966158024dd 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -78,7 +78,7 @@ If nil, truncated messages will just have \"...\" to indicate truncation." :version "28.1") ;;;###autoload -(defcustom eldoc-minor-mode-string (purecopy " ElDoc") +(defcustom eldoc-minor-mode-string " ElDoc" "String to display in mode line when ElDoc Mode is enabled; nil for none." :type '(choice string (const :tag "None" nil))) @@ -154,7 +154,6 @@ this file since the obarray is initialized at load time. Remember to keep it a prime number to improve hash performance.") (defvar eldoc-message-commands - ;; Don't define as `defconst' since it would then go to (read-only) purespace. (obarray-make eldoc-message-commands-table-size) "Commands after which it is appropriate to print in the echo area. ElDoc does not try to print function arglists, etc., after just any command, @@ -166,7 +165,6 @@ directly. Instead, use `eldoc-add-command' and `eldoc-remove-command'.") ;; Not a constant. (defvar eldoc-last-data (make-vector 3 nil) - ;; Don't define as `defconst' since it would then go to (read-only) purespace. "Bookkeeping; elements are as follows: 0 - contains the last symbol read from the buffer. 1 - contains the string last displayed in the echo area for variables, @@ -269,6 +267,14 @@ See `eldoc-documentation-strategy' for more detail." (eldoc-mode 1))) +(defun eldoc--update () + (when (or eldoc-mode + (and global-eldoc-mode + (eldoc--supported-p))) + ;; Don't ignore, but also don't full-on signal errors + (with-demoted-errors "eldoc error: %s" + (eldoc-print-current-symbol-info)) )) + (defun eldoc-schedule-timer () "Ensure `eldoc-timer' is running. @@ -279,13 +285,7 @@ reflect the change." (setq eldoc-timer (run-with-idle-timer eldoc-idle-delay nil - (lambda () - (when (or eldoc-mode - (and global-eldoc-mode - (eldoc--supported-p))) - ;; Don't ignore, but also don't full-on signal errors - (with-demoted-errors "eldoc error: %s" - (eldoc-print-current-symbol-info)) ))))) + #'eldoc--update))) ;; If user has changed the idle delay, update the timer. (cond ((not (= eldoc-idle-delay eldoc-current-idle-delay)) |