summaryrefslogtreecommitdiff
path: root/lisp/help-fns.el
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-11-14 19:27:52 +0200
committerEli Zaretskii <eliz@gnu.org>2015-11-14 19:27:52 +0200
commit7ad01cb68aad3640005d9ff3b0da78c1714c18bd (patch)
tree0c8cabe0cf848335aa04abbaa531d06b22ef65a9 /lisp/help-fns.el
parent855c6e8cdb9b0875ce9c5b2b0fd3e74a15888278 (diff)
downloademacs-7ad01cb68aad3640005d9ff3b0da78c1714c18bd.tar.gz
emacs-7ad01cb68aad3640005d9ff3b0da78c1714c18bd.tar.bz2
emacs-7ad01cb68aad3640005d9ff3b0da78c1714c18bd.zip
Avoid signaling an error in 'describe-symbol'
* lisp/help-fns.el (describe-symbol): Avoid errors when the symbol exists as a function/variable/face/etc., but is undocumented. * test/automated/help-fns.el (help-fns-test-describe-symbol): New test.
Diffstat (limited to 'lisp/help-fns.el')
-rw-r--r--lisp/help-fns.el20
1 files changed, 11 insertions, 9 deletions
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.