diff --git a/lisp/help-fns.el b/lisp/help-fns.el index 4e0bfee5bf7..e810a26c5a4 100644 --- a/lisp/help-fns.el +++ b/lisp/help-fns.el @@ -1040,15 +1040,17 @@ Will show the info of SYMBOL as a function, variable, and/or face." (let ((inhibit-read-only t) (name (caar docs)) ;Name of doc currently at BOB. (doc (cdr (cadr docs)))) ;Doc to add at BOB. - (insert doc) - (delete-region (point) (progn (skip-chars-backward " \t\n") (point))) - (insert "\n\n" - (eval-when-compile - (propertize "\n" 'face '(:height 0.1 :inverse-video t))) - "\n") - (when name - (insert (symbol-name symbol) - " is also a " name "." "\n\n"))) + (when doc + (insert doc) + (delete-region (point) + (progn (skip-chars-backward " \t\n") (point))) + (insert "\n\n" + (eval-when-compile + (propertize "\n" 'face '(:height 0.1 :inverse-video t))) + "\n") + (when name + (insert (symbol-name symbol) + " is also a " name "." "\n\n")))) (setq docs (cdr docs))) (unless single ;; Don't record the `describe-variable' item in the stack. diff --git a/test/automated/help-fns.el b/test/automated/help-fns.el index b8772eb84d6..79e90f7819c 100644 --- a/test/automated/help-fns.el +++ b/test/automated/help-fns.el @@ -57,4 +57,14 @@ (should (search-forward "(defgh\\\\\\[universal-argument\\]b\\`c\\'d\\\\e\\\"f X)")))) +(ert-deftest help-fns-test-describe-symbol () + "Test the `describe-symbol' function." + ;; 'describe-symbol' would originally signal an error for + ;; 'font-lock-comment-face'. + (describe-symbol 'font-lock-comment-face) + (with-current-buffer "*Help*" + (should (> (point-max) 1)) + (goto-char (point-min)) + (should (looking-at "^font-lock-comment-face is ")))) + ;;; help-fns.el ends here