[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/help.el
From: |
Richard M. Stallman |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/help.el |
Date: |
Tue, 30 Sep 2003 08:50:44 -0400 |
Index: emacs/lisp/help.el
diff -c emacs/lisp/help.el:1.260 emacs/lisp/help.el:1.261
*** emacs/lisp/help.el:1.260 Mon Sep 1 11:45:12 2003
--- emacs/lisp/help.el Tue Sep 30 08:50:44 2003
***************
*** 574,615 ****
(with-output-to-temp-buffer (help-buffer)
(save-excursion
(when buffer (set-buffer buffer))
! (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))
! (let ((minor-modes minor-mode-alist))
! (while minor-modes
! (let* ((minor-mode (car (car minor-modes)))
! (indicator (car (cdr (car minor-modes)))))
! ;; Document a minor mode if it is listed in minor-mode-alist,
! ;; bound locally in this buffer, non-nil, and has a function
! ;; definition.
! (if (and (boundp minor-mode)
! (symbol-value minor-mode)
! (fboundp minor-mode))
! (let ((pretty-minor-mode minor-mode))
! (if (string-match "\\(-minor\\)?-mode\\'"
! (symbol-name minor-mode))
! (setq pretty-minor-mode
! (capitalize
! (substring (symbol-name minor-mode)
! 0 (match-beginning 0)))))
! (while (and indicator (symbolp indicator)
! (boundp indicator)
! (not (eq indicator (symbol-value indicator))))
! (setq indicator (symbol-value indicator)))
! (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)))))
! (setq minor-modes (cdr minor-modes))))
(print-help-return-message))))
(defun describe-minor-mode (minor-mode)
"Display documentation of a minor mode given as MINOR-MODE.
--- 574,637 ----
(with-output-to-temp-buffer (help-buffer)
(save-excursion
(when buffer (set-buffer buffer))
! (let (minor-modes)
! ;; Find enabled minor mode we will want to mention.
! (dolist (mode minor-mode-list)
! ;; Document a minor mode if it is listed in minor-mode-alist,
! ;; non-nil, and has a function definition.
! (and (boundp mode) (symbol-value mode)
! (fboundp mode)
! (let ((pretty-minor-mode mode)
! indicator)
! (if (string-match "\\(-minor\\)?-mode\\'"
! (symbol-name mode))
! (setq pretty-minor-mode
! (capitalize
! (substring (symbol-name mode)
! 0 (match-beginning 0)))))
! (setq indicator (cadr (assq mode minor-mode-alist)))
! (while (and indicator (symbolp indicator)
! (boundp indicator)
! (not (eq indicator (symbol-value indicator))))
! (setq indicator (symbol-value indicator)))
! (push (list pretty-minor-mode mode indicator)
! minor-modes))))
! (if auto-fill-function
! (push '("Auto Fill" auto-fill-mode " Fill")
! minor-modes))
! (setq minor-modes
! (sort minor-modes
! (lambda (a b) (string-lessp (car a) (car b)))))
! (when minor-modes
! (princ "Summary of minor modes:\n")
! (dolist (mode minor-modes)
! (let ((pretty-minor-mode (nth 0 mode))
! (indicator (nth 2 mode)))
! (princ (format " %s minor mode (%s):\n"
! pretty-minor-mode
! (if indicator
! (format "indicator%s" indicator)
! "no indicator")))))
! (princ "\n(Full information about these minor modes
! follows the description of the major mode.)\n\n"))
! ;; Document the major mode.
! (princ mode-name)
! (princ " mode:\n")
! (princ (documentation major-mode))
! ;; Document the minor modes fully.
! (dolist (mode minor-modes)
! (let ((pretty-minor-mode (nth 0 mode))
! (mode-function (nth 1 mode))
! (indicator (nth 2 mode)))
! (princ "\n\f\n")
! (princ (format "%s minor mode (%s):\n"
! pretty-minor-mode
! (if indicator
! (format "indicator%s" indicator)
! "no indicator")))
! (princ (documentation mode-function)))))
(print-help-return-message))))
+
(defun describe-minor-mode (minor-mode)
"Display documentation of a minor mode given as MINOR-MODE.