From: João Távora Date: Mon, 2 Nov 2020 16:24:59 +0000 (+0000) Subject: Fix Elisp's elisp--documentation-one-liner (bug#43609) X-Git-Tag: emacs-28.0.90~5287^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=95f7a2835a79c1f12b5dc86230405e8040910c72;p=emacs.git Fix Elisp's elisp--documentation-one-liner (bug#43609) To be backward compatible, this function must return nil when there is a symbol at point but no documentation for it. Before this fixed it returned the string ": nil". * lisp/progmodes/elisp-mode.el (elisp--documentation-one-liner): Check callback actually produced non-nil doc. --- diff --git a/lisp/progmodes/elisp-mode.el b/lisp/progmodes/elisp-mode.el index ce2b924d514..12788eacf1b 100644 --- a/lisp/progmodes/elisp-mode.el +++ b/lisp/progmodes/elisp-mode.el @@ -1416,12 +1416,13 @@ which see." (defun elisp--documentation-one-liner () (let* (str (callback (lambda (doc &rest plist) - (setq str - (format "%s: %s" - (propertize (prin1-to-string - (plist-get plist :thing)) - 'face (plist-get plist :face)) - doc))))) + (when doc + (setq str + (format "%s: %s" + (propertize (prin1-to-string + (plist-get plist :thing)) + 'face (plist-get plist :face)) + doc)))))) (or (progn (elisp-eldoc-var-docstring callback) str) (progn (elisp-eldoc-funcall callback) str))))