Skip to content

Commit 125da00

Browse files
committed
* 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.
1 parent 07da629 commit 125da00

File tree

1 file changed

+7
-12
lines changed

1 file changed

+7
-12
lines changed

lisp/emacs-lisp/eldoc.el

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -233,14 +233,6 @@ See `eldoc-documentation-function' for more detail."
233233
(when (eldoc--supported-p)
234234
(eldoc-mode 1)))
235235

236-
(defun eldoc--supported-p ()
237-
"Non-nil if an ElDoc function is set for this buffer."
238-
(let ((hook 'eldoc-documentation-functions))
239-
(and (not (memq eldoc-documentation-function '(nil ignore)))
240-
(or (and (local-variable-p hook)
241-
(buffer-local-value hook (current-buffer)))
242-
(default-value hook)))))
243-
244236

245237
(defun eldoc-schedule-timer ()
246238
"Ensure `eldoc-timer' is running.
@@ -405,11 +397,15 @@ effect."
405397
:link '(info-link "(emacs) Lisp Doc")
406398
:type '(radio (function-item eldoc-documentation-default)
407399
(function-item eldoc-documentation-compose)
408-
(function :tag "Other function")
409-
(const :tag "None" nil))
400+
(function :tag "Other function"))
410401
:version "28.1"
411402
:group 'eldoc)
412403

404+
(defun eldoc--supported-p ()
405+
"Non-nil if an ElDoc function is set for this buffer."
406+
(and (not (memq eldoc-documentation-function '(nil ignore)))
407+
eldoc-documentation-functions))
408+
413409
(defun eldoc-print-current-symbol-info ()
414410
"Print the text produced by `eldoc-documentation-function'."
415411
;; This is run from post-command-hook or some idle timer thing,
@@ -423,8 +419,7 @@ effect."
423419
;; Only keep looking for the info as long as the user hasn't
424420
;; requested our attention. This also locally disables inhibit-quit.
425421
(while-no-input
426-
(let ((fun eldoc-documentation-function))
427-
(when fun (eldoc-message (funcall fun)))))))))
422+
(eldoc-message (funcall eldoc-documentation-function)))))))
428423

429424
;; If the entire line cannot fit in the echo area, the symbol name may be
430425
;; truncated or eliminated entirely from the output to make room for the

0 commit comments

Comments
 (0)