]> code.delx.au - gnu-emacs/blobdiff - lisp/help.el
(ps-print-preprint): Special handling if
[gnu-emacs] / lisp / help.el
index e416fd3d88764006ef25a237078611c59cd79d53..ff1e9c8da1bae973cd99bf9fbcf0a66cc7cc1470 100644 (file)
@@ -18,8 +18,9 @@
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
@@ -296,9 +297,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))
@@ -331,8 +334,11 @@ describes the minor mode."
                                      0 (match-beginning 0)))))
                (while (and indicator (symbolp indicator))
                  (setq indicator (symbol-value indicator)))
-               (princ (format "%s minor mode (indicator%s):\n"
-                              pretty-minor-mode indicator))
+               (princ (format "%s minor mode (%s):\n"
+                              pretty-minor-mode
+                              (if indicator
+                                  (format "indicator%s" indicator)
+                                "no indicator")))
                (princ (documentation minor-mode))
                (princ "\n\n"))))
        (setq minor-modes (cdr minor-modes))))
@@ -567,11 +573,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)
@@ -627,9 +633,7 @@ Returns the documentation as a string, also."
     (princ "Documentation:")
     (terpri)
     (let ((doc (documentation-property variable 'variable-documentation)))
-      (if doc
-         (princ (substitute-command-keys doc))
-       (princ "not documented as a variable.")))
+      (princ (or doc "not documented as a variable.")))
     (print-help-return-message)
     (save-excursion
       (set-buffer standard-output)