* 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.
This commit is contained in:
Stefan Monnier 2020-02-26 22:47:32 -05:00
parent 07da629926
commit 125da00b14

View file

@ -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