Commit e3b51b08 authored by Dmitry Gutov's avatar Dmitry Gutov
Browse files

Extract eldoc--supported-p

* lisp/emacs-lisp/eldoc.el (eldoc--supported-p): New function.
(turn-on-eldoc-mode, eldoc-mode): Use it.
parent dd5b1c0d
......@@ -186,7 +186,7 @@ expression point is on."
:group 'eldoc :lighter eldoc-minor-mode-string
(setq eldoc-last-message nil)
((memq eldoc-documentation-function '(nil ignore))
((not (eldoc--supported-p))
(when (called-interactively-p 'any)
(message "There is no ElDoc support in this buffer"))
(setq eldoc-mode nil))
......@@ -213,9 +213,12 @@ expression point is on."
(defun turn-on-eldoc-mode ()
"Turn on `eldoc-mode' if the buffer has eldoc support enabled.
See `eldoc-documentation-function' for more detail."
(unless (memq eldoc-documentation-function '(nil ignore))
(when (eldoc--supported-p)
(eldoc-mode 1)))
(defun eldoc--supported-p ()
(not (memq eldoc-documentation-function '(nil ignore))))
(defun eldoc-schedule-timer ()
(or (and eldoc-timer
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment