aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorDmitry Gutov2017-05-31 01:29:34 +0300
committerDmitry Gutov2017-05-31 01:29:43 +0300
commite3b51b080fab02f579b7c6a91b609a2c0aca8339 (patch)
treec5efcb49615ad004d396492af37bbdf234144f55 /lisp
parentdd5b1c0d68a93d5bc6659c45a3f8f5028885edf8 (diff)
downloademacs-e3b51b080fab02f579b7c6a91b609a2c0aca8339.tar.gz
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')
-rw-r--r--lisp/emacs-lisp/eldoc.el7
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."
186 :group 'eldoc :lighter eldoc-minor-mode-string 186 :group 'eldoc :lighter eldoc-minor-mode-string
187 (setq eldoc-last-message nil) 187 (setq eldoc-last-message nil)
188 (cond 188 (cond
189 ((memq eldoc-documentation-function '(nil ignore)) 189 ((not (eldoc--supported-p))
190 (when (called-interactively-p 'any) 190 (when (called-interactively-p 'any)
191 (message "There is no ElDoc support in this buffer")) 191 (message "There is no ElDoc support in this buffer"))
192 (setq eldoc-mode nil)) 192 (setq eldoc-mode nil))
@@ -213,9 +213,12 @@ expression point is on."
213(defun turn-on-eldoc-mode () 213(defun turn-on-eldoc-mode ()
214 "Turn on `eldoc-mode' if the buffer has eldoc support enabled. 214 "Turn on `eldoc-mode' if the buffer has eldoc support enabled.
215See `eldoc-documentation-function' for more detail." 215See `eldoc-documentation-function' for more detail."
216 (unless (memq eldoc-documentation-function '(nil ignore)) 216 (when (eldoc--supported-p)
217 (eldoc-mode 1))) 217 (eldoc-mode 1)))
218 218
219(defun eldoc--supported-p ()
220 (not (memq eldoc-documentation-function '(nil ignore))))
221
219 222
220(defun eldoc-schedule-timer () 223(defun eldoc-schedule-timer ()
221 (or (and eldoc-timer 224 (or (and eldoc-timer