# HG changeset patch
# User Richard M. Stallman <rms@gnu.org>
# Date 815100202 0
# Node ID febf5ce4532cd06e2f8081dbd083d129fc39c3f5
# Parent  74a891e3ef448eb150b6ae938ca5630a9a096d24
(describe-function): Call documentation just once.
(describe-key): Likewise.

diff -r 74a891e3ef44 -r febf5ce4532c lisp/help.el
--- a/lisp/help.el	Tue Oct 31 00:01:29 1995 +0000
+++ b/lisp/help.el	Tue Oct 31 00:43:22 1995 +0000
@@ -296,9 +296,11 @@
 	    (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 @@
 				       (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)