Merge pull request #4503 from nbfalcon/bugfix/elisp-eldoc-unbound-symbol-error

Emacs-lisp eldoc: fix error if symbol unbound
This commit is contained in:
Henrik Lissner 2021-01-09 03:23:33 -05:00 committed by GitHub
commit 4d5f6f7514
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -99,6 +99,7 @@ employed so that flycheck still does *some* helpful linting.")
"Display variable value next to documentation in eldoc."
:around #'elisp-get-var-docstring
(when-let (ret (funcall orig-fn sym))
(if (fboundp sym)
(concat ret " "
(let* ((truncated " [...]")
(print-escape-newlines t)
@ -107,7 +108,8 @@ employed so that flycheck still does *some* helpful linting.")
(limit (- (frame-width) (length ret) (length truncated) 1)))
(format (format "%%0.%ds%%s" (max limit 0))
(propertize str 'face 'warning)
(if (< (length str) limit) "" truncated))))))
(if (< (length str) limit) "" truncated))))
ret)))
(map! :localleader
:map emacs-lisp-mode-map