From: Richard M. Stallman Date: Tue, 31 Oct 1995 00:43:22 +0000 (+0000) Subject: (describe-function): Call documentation just once. X-Git-Tag: emacs-19.34~2502 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=fb3fc9b81904633fc4445ff1d7ca3bd2e97515b2;p=emacs.git (describe-function): Call documentation just once. (describe-key): Likewise. --- 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)