summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1998-11-29 00:56:49 +0000
committerRichard M. Stallman <rms@gnu.org>1998-11-29 00:56:49 +0000
commit40b3bdc12b8b5364a0699450b9619cb0fd2344c5 (patch)
treef5a9236c4eda667af89dd2479d5d5af2eeba07ee
parent058961dde397e9e65f30b91837cf7bfb35df9e62 (diff)
downloademacs-40b3bdc12b8b5364a0699450b9619cb0fd2344c5.tar.gz
(describe-mode): Put major mode first.
-rw-r--r--lisp/help.el25
1 files changed, 13 insertions, 12 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 7556a964d5e..d4623decb0e 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -328,13 +328,22 @@ If FUNCTION is nil, applies `message' to it, thus printing it."
(defun describe-mode ()
"Display documentation of current major mode and minor modes.
+The major mode description comes first, followed by the minor modes,
+each on a separate page.
+
For this to work correctly for a minor mode, the mode's indicator variable
\(listed in `minor-mode-alist') must also be a function whose documentation
describes the minor mode."
(interactive)
(with-output-to-temp-buffer "*Help*"
- (let ((minor-modes minor-mode-alist)
- (first t))
+ (when minor-mode-alist
+ (princ "The major mode is described first.
+For minor modes, see following pages.\n\n"))
+ (princ mode-name)
+ (princ " mode:\n")
+ (princ (documentation major-mode))
+ (help-setup-xref (list #'help-xref-mode (current-buffer)) (interactive-p))
+ (let ((minor-modes minor-mode-alist))
(while minor-modes
(let* ((minor-mode (car (car minor-modes)))
(indicator (car (cdr (car minor-modes)))))
@@ -353,22 +362,14 @@ describes the minor mode."
(boundp indicator)
(not (eq indicator (symbol-value indicator))))
(setq indicator (symbol-value indicator)))
- (if first
- (princ "The minor modes are described first,
-followed by the major mode, which is described on the last page.\n\f\n"))
- (setq first nil)
+ (princ "\n\f\n")
(princ (format "%s minor mode (%s):\n"
pretty-minor-mode
(if indicator
(format "indicator%s" indicator)
"no indicator")))
- (princ (documentation minor-mode))
- (princ "\n\f\n"))))
+ (princ (documentation minor-mode)))))
(setq minor-modes (cdr minor-modes))))
- (princ mode-name)
- (princ " mode:\n")
- (princ (documentation major-mode))
- (help-setup-xref (list #'help-xref-mode (current-buffer)) (interactive-p))
(print-help-return-message)))
;; So keyboard macro definitions are documented correctly