emacs-diffs
[Top][All Lists]
Advanced

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

master df2ae3f: Don't let docless variables hide function signature


From: João Távora
Subject: master df2ae3f: Don't let docless variables hide function signature
Date: Sun, 16 Aug 2020 14:06:43 -0400 (EDT)

branch: master
commit df2ae3f9c1d01a8be4ea08062501dbce680de3d1
Author: João Távora <joaotavora@gmail.com>
Commit: João Távora <joaotavora@gmail.com>

    Don't let docless variables hide function signature
    
    In Elisp mode, ElDoc will try the variable's docstring first, then the
    function signature.  If the former doesn't have one, don't hide the
    latter.
    
    * lisp/progmodes/elisp-mode.el (elisp-eldoc-var-docstring): If no
    symbol docstring, don't declare any.
---
 lisp/progmodes/elisp-mode.el | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el
index 2f44118..21ba42a 100644
--- a/lisp/progmodes/elisp-mode.el
+++ b/lisp/progmodes/elisp-mode.el
@@ -1420,10 +1420,12 @@ Intended for `eldoc-documentation-functions' (which 
see)."
 (defun elisp-eldoc-var-docstring (callback &rest _ignored)
   "Document variable at point.
 Intended for `eldoc-documentation-functions' (which see)."
-  (let ((sym (elisp--current-symbol)))
-    (when sym (funcall callback (elisp-get-var-docstring sym)
-                       :thing sym
-                       :face 'font-lock-variable-name-face))))
+  (let* ((sym (elisp--current-symbol))
+        (docstring (and sym (elisp-get-var-docstring sym))))
+    (when docstring
+      (funcall callback docstring
+               :thing sym
+               :face 'font-lock-variable-name-face))))
 
 (defun elisp-get-fnsym-args-string (sym &optional index)
   "Return a string containing the parameter list of the function SYM.



reply via email to

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