emacs-diffs
[Top][All Lists]
Advanced

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

master 125da00: * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function


From: Stefan Monnier
Subject: master 125da00: * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): No nil value
Date: Wed, 26 Feb 2020 22:47:37 -0500 (EST)

branch: master
commit 125da00b149f8f384ff288880cdd1b2e776c9444
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/emacs-lisp/eldoc.el (eldoc-documentation-function): No nil value
    
    (eldoc--supported-p): Move after the vars it uses.  Simplify.
    (eldoc-print-current-symbol-info): Revert to previous code which
    assumed a non-nil value of eldoc-documentation-function.
---
 lisp/emacs-lisp/eldoc.el | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 456a650..6e35018 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -233,14 +233,6 @@ See `eldoc-documentation-function' for more detail."
   (when (eldoc--supported-p)
     (eldoc-mode 1)))
 
-(defun eldoc--supported-p ()
-  "Non-nil if an ElDoc function is set for this buffer."
-  (let ((hook 'eldoc-documentation-functions))
-    (and (not (memq eldoc-documentation-function '(nil ignore)))
-         (or (and (local-variable-p hook)
-                  (buffer-local-value hook (current-buffer)))
-             (default-value hook)))))
-
 
 (defun eldoc-schedule-timer ()
   "Ensure `eldoc-timer' is running.
@@ -405,11 +397,15 @@ effect."
   :link '(info-link "(emacs) Lisp Doc")
   :type '(radio (function-item eldoc-documentation-default)
                 (function-item eldoc-documentation-compose)
-                (function :tag "Other function")
-                (const :tag "None" nil))
+                (function :tag "Other function"))
   :version "28.1"
   :group 'eldoc)
 
+(defun eldoc--supported-p ()
+  "Non-nil if an ElDoc function is set for this buffer."
+  (and (not (memq eldoc-documentation-function '(nil ignore)))
+       eldoc-documentation-functions))
+
 (defun eldoc-print-current-symbol-info ()
   "Print the text produced by `eldoc-documentation-function'."
   ;; This is run from post-command-hook or some idle timer thing,
@@ -423,8 +419,7 @@ effect."
         ;; 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
-          (let ((fun eldoc-documentation-function))
-            (when fun (eldoc-message (funcall fun)))))))))
+          (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]