[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] Changes to emacs/lisp/help.el
From: |
Stefan Monnier |
Subject: |
[Emacs-diffs] Changes to emacs/lisp/help.el |
Date: |
Thu, 10 Mar 2005 16:43:18 -0500 |
Index: emacs/lisp/help.el
diff -c emacs/lisp/help.el:1.275 emacs/lisp/help.el:1.276
*** emacs/lisp/help.el:1.275 Thu Feb 10 06:46:42 2005
--- emacs/lisp/help.el Thu Mar 10 21:43:16 2005
***************
*** 1,7 ****
;;; help.el --- help commands for Emacs
! ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004
! ;; Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help, internal
--- 1,7 ----
;;; help.el --- help commands for Emacs
! ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004,
! ;; 2005 Free Software Foundation, Inc.
;; Maintainer: FSF
;; Keywords: help, internal
***************
*** 685,718 ****
variable \(listed in `minor-mode-alist') must also be a function
whose documentation describes the minor mode."
(interactive)
! (help-setup-xref (list #'describe-mode (or buffer (current-buffer)))
(interactive-p))
;; For the sake of help-do-xref and help-xref-go-back,
;; don't switch buffers before calling `help-buffer'.
(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
;; copy pure string so we can add face property to it below.
--- 685,719 ----
variable \(listed in `minor-mode-alist') must also be a function
whose documentation describes the minor mode."
(interactive)
! (unless buffer (setq buffer (current-buffer)))
! (help-setup-xref (list #'describe-mode buffer)
(interactive-p))
;; For the sake of help-do-xref and help-xref-go-back,
;; don't switch buffers before calling `help-buffer'.
(with-output-to-temp-buffer (help-buffer)
! (with-current-buffer buffer
(let (minor-modes)
+ ;; Older packages do not register in minor-mode-list but only in
+ ;; minor-mode-alist.
+ (dolist (x minor-mode-alist)
+ (setq x (car x))
+ (unless (memq x minor-mode-list)
+ (push x minor-mode-list)))
;; 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))
(if (string-match "\\(-minor\\)?-mode\\'"
(symbol-name mode))
(setq pretty-minor-mode
(capitalize
(substring (symbol-name mode)
0 (match-beginning 0)))))
! (push (list pretty-minor-mode mode
! (format-mode-line (assq mode minor-mode-alist)))
minor-modes))))
(if auto-fill-function
;; copy pure string so we can add face property to it below.
***************
*** 729,734 ****
--- 730,738 ----
(let ((pretty-minor-mode (nth 0 mode))
(mode-function (nth 1 mode))
(indicator (nth 2 mode)))
+ (setq indicator (if (zerop (length indicator))
+ "no indicator"
+ (format "indicator%s" indicator)))
(add-text-properties 0 (length pretty-minor-mode)
'(face bold) pretty-minor-mode)
(save-excursion
***************
*** 737,756 ****
(push (point-marker) help-button-cache)
;; Document the minor modes fully.
(insert pretty-minor-mode)
! (princ (format " minor mode (%s):\n"
! (if indicator
! (format "indicator%s" indicator)
! "no indicator")))
(princ (documentation mode-function)))
(princ " ")
(insert-button pretty-minor-mode
'action (car help-button-cache)
'follow-link t
'help-echo "mouse-2, RET: show full information")
! (princ (format " minor mode (%s):\n"
! (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.
--- 741,754 ----
(push (point-marker) help-button-cache)
;; Document the minor modes fully.
(insert pretty-minor-mode)
! (princ (format " minor mode (%s):\n" indicator))
(princ (documentation mode-function)))
(princ " ")
(insert-button pretty-minor-mode
'action (car help-button-cache)
'follow-link t
'help-echo "mouse-2, RET: show full information")
! (princ (format " minor mode (%s):\n" indicator)))))
(princ "\n(Full information about these minor modes
follows the description of the major mode.)\n\n"))
;; Document the major mode.
***************
*** 896,900 ****
;; defcustoms which require 'help'.
(provide 'help)
! ;;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423
;;; help.el ends here
--- 894,898 ----
;; defcustoms which require 'help'.
(provide 'help)
! ;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423
;;; help.el ends here
- [Emacs-diffs] Changes to emacs/lisp/help.el,
Stefan Monnier <=