summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-10-31 00:43:22 +0000
committerRichard M. Stallman <rms@gnu.org>1995-10-31 00:43:22 +0000
commitb518ba38588488aec461d14a8150580a12381fa1 (patch)
tree02591f1fd0a58ec216a09db214caf44064905ff6 /lisp/help.el
parent897ef8daba8512b0a82be19564140dc906bc578d (diff)
downloademacs-b518ba38588488aec461d14a8150580a12381fa1.tar.gz
(describe-function): Call documentation just once.
(describe-key): Likewise.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el18
1 files changed, 10 insertions, 8 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 68c18ecd48a..f17484fe9f4 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -296,9 +296,11 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
(princ " runs the command ")
(prin1 defn)
(princ ":\n")
- (if (documentation defn)
- (princ (documentation defn))
- (princ "not documented"))
+ (let ((doc (documentation defn)))
+ (if doc
+ (progn (terpri)
+ (princ doc))
+ (princ "not documented")))
(save-excursion
(set-buffer standard-output)
(help-mode))
@@ -567,11 +569,11 @@ C-w print information on absence of warranty for GNU Emacs."
(intern (upcase (symbol-name arg)))))
arglist)))
(terpri))))
- (if (documentation function)
- (progn (terpri)
- (princ (documentation function)))
- (princ "not documented"))
- )
+ (let ((doc (documentation function)))
+ (if doc
+ (progn (terpri)
+ (princ doc))
+ (princ "not documented"))))
(print-help-return-message)
(save-excursion
(set-buffer standard-output)