[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 2d221c8: * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): Underst

From: Stefan Monnier
Subject: master 2d221c8: * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): Understand the "old" API
Date: Thu, 12 Mar 2020 11:18:14 -0400 (EDT)

branch: master
commit 2d221c8d87185fd02a6eb7558ddc4c9524153d72
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

    * lisp/emacs-lisp/eldoc.el (eldoc--supported-p): Understand the "old" API
 lisp/emacs-lisp/eldoc.el | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lisp/emacs-lisp/eldoc.el b/lisp/emacs-lisp/eldoc.el
index 6e35018..660fce4 100644
--- a/lisp/emacs-lisp/eldoc.el
+++ b/lisp/emacs-lisp/eldoc.el
@@ -404,7 +404,16 @@ effect."
 (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))
+       (or eldoc-documentation-functions
+           ;; The old API had major modes set `eldoc-documentation-function'
+           ;; to provide eldoc support.  It's impossible now to determine
+           ;; reliably whether the `eldoc-documentation-function' provides
+           ;; eldoc support (as in the old API) or whether it just provides
+           ;; a way to combine the results of the
+           ;; `eldoc-documentation-functions' (as in the new API).
+           ;; But at least if it's set buffer-locally it's a good hint that
+           ;; there's some eldoc support in the current buffer.
+           (local-variable-p 'eldoc-documentation-function))))
 (defun eldoc-print-current-symbol-info ()
   "Print the text produced by `eldoc-documentation-function'."

reply via email to

[Prev in Thread] Current Thread [Next in Thread]