diff --git a/modules/lang/emacs-lisp/config.el b/modules/lang/emacs-lisp/config.el index 1286a7588..bf8c5553d 100644 --- a/modules/lang/emacs-lisp/config.el +++ b/modules/lang/emacs-lisp/config.el @@ -99,15 +99,17 @@ 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)) - (concat ret " " - (let* ((truncated " [...]") - (print-escape-newlines t) - (str (symbol-value sym)) - (str (prin1-to-string str)) - (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 (fboundp sym) + (concat ret " " + (let* ((truncated " [...]") + (print-escape-newlines t) + (str (symbol-value sym)) + (str (prin1-to-string str)) + (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)))) + ret))) (map! :localleader :map emacs-lisp-mode-map