diff options
author | Dmitry Gutov <dgutov@yandex.ru> | 2017-05-31 01:29:34 +0300 |
---|---|---|
committer | Dmitry Gutov <dgutov@yandex.ru> | 2017-05-31 01:29:43 +0300 |
commit | e3b51b080fab02f579b7c6a91b609a2c0aca8339 (patch) | |
tree | c5efcb49615ad004d396492af37bbdf234144f55 /lisp/emacs-lisp | |
parent | dd5b1c0d68a93d5bc6659c45a3f8f5028885edf8 (diff) | |
download | emacs-e3b51b080fab02f579b7c6a91b609a2c0aca8339.tar.gz emacs-e3b51b080fab02f579b7c6a91b609a2c0aca8339.tar.bz2 emacs-e3b51b080fab02f579b7c6a91b609a2c0aca8339.zip |
Extract eldoc--supported-p
* lisp/emacs-lisp/eldoc.el (eldoc--supported-p): New function.
(turn-on-eldoc-mode, eldoc-mode): Use it.
(http://lists.gnu.org/archive/html/emacs-devel/2017-05/msg00865.html)
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r-- | lisp/emacs-lisp/eldoc.el | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el index b0f6ea4412d..40f5e2ef96a 100644 --- a/lisp/emacs-lisp/eldoc.el +++ b/lisp/emacs-lisp/eldoc.el @@ -186,7 +186,7 @@ expression point is on." :group 'eldoc :lighter eldoc-minor-mode-string (setq eldoc-last-message nil) (cond - ((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 |