diff options
| author | Stefan Monnier | 2005-03-10 21:43:16 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2005-03-10 21:43:16 +0000 |
| commit | dd39c336a9ef030a2d672aac8fbc278eb69055f8 (patch) | |
| tree | eef47f9049ef9a96f7b5395f60ed173e1cfa44ce | |
| parent | f66ce3b92f9f9aa13fcd52550a531478fa34a45c (diff) | |
| download | emacs-dd39c336a9ef030a2d672aac8fbc278eb69055f8.tar.gz emacs-dd39c336a9ef030a2d672aac8fbc278eb69055f8.zip | |
(describe-mode): Properly handle non-trivial lighters.
Don't ignore minor modes that are not listed in minor-mode-list.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/help.el | 42 |
2 files changed, 24 insertions, 24 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index daf15811bdc..6423787b7a6 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,8 @@ | |||
| 1 | 2005-03-10 Stefan Monnier <monnier@iro.umontreal.ca> | 1 | 2005-03-10 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 2 | ||
| 3 | * help.el (describe-mode): Properly handle non-trivial lighters. | ||
| 4 | Don't ignore minor modes that are not listed in minor-mode-list. | ||
| 5 | |||
| 3 | * tooltip.el (tooltip-mode): Don't complain that you can't turn the | 6 | * tooltip.el (tooltip-mode): Don't complain that you can't turn the |
| 4 | feature ON when the user requests to turn it OFF. | 7 | feature ON when the user requests to turn it OFF. |
| 5 | 8 | ||
| @@ -323,8 +326,7 @@ | |||
| 323 | that debug-entry-code can be safely removed from a function while | 326 | that debug-entry-code can be safely removed from a function while |
| 324 | this code is being evaluated. Revert the 2005-02-27 change as the | 327 | this code is being evaluated. Revert the 2005-02-27 change as the |
| 325 | new implementation no longer requires it. Make sure that a | 328 | new implementation no longer requires it. Make sure that a |
| 326 | function body containing just a string is not mistaken for a | 329 | function body containing just a string is not mistaken for a docstring. |
| 327 | docstring. | ||
| 328 | (debug): Skip one more frame in case of debug on entry. | 330 | (debug): Skip one more frame in case of debug on entry. |
| 329 | (debugger-setup-buffer): Delete one more frame line in case of | 331 | (debugger-setup-buffer): Delete one more frame line in case of |
| 330 | debug on entry. | 332 | debug on entry. |
diff --git a/lisp/help.el b/lisp/help.el index de5ac093dd5..22d383559a1 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; help.el --- help commands for Emacs | 1 | ;;; help.el --- help commands for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004 | 3 | ;; Copyright (C) 1985, 1986, 1993, 1994, 1998, 1999, 2000, 2001, 2002, 2004, |
| 4 | ;; Free Software Foundation, Inc. | 4 | ;; 2005 Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: FSF | 6 | ;; Maintainer: FSF |
| 7 | ;; Keywords: help, internal | 7 | ;; Keywords: help, internal |
| @@ -685,34 +685,35 @@ For this to work correctly for a minor mode, the mode's indicator | |||
| 685 | variable \(listed in `minor-mode-alist') must also be a function | 685 | variable \(listed in `minor-mode-alist') must also be a function |
| 686 | whose documentation describes the minor mode." | 686 | whose documentation describes the minor mode." |
| 687 | (interactive) | 687 | (interactive) |
| 688 | (help-setup-xref (list #'describe-mode (or buffer (current-buffer))) | 688 | (unless buffer (setq buffer (current-buffer))) |
| 689 | (help-setup-xref (list #'describe-mode buffer) | ||
| 689 | (interactive-p)) | 690 | (interactive-p)) |
| 690 | ;; For the sake of help-do-xref and help-xref-go-back, | 691 | ;; For the sake of help-do-xref and help-xref-go-back, |
| 691 | ;; don't switch buffers before calling `help-buffer'. | 692 | ;; don't switch buffers before calling `help-buffer'. |
| 692 | (with-output-to-temp-buffer (help-buffer) | 693 | (with-output-to-temp-buffer (help-buffer) |
| 693 | (save-excursion | 694 | (with-current-buffer buffer |
| 694 | (when buffer (set-buffer buffer)) | ||
| 695 | (let (minor-modes) | 695 | (let (minor-modes) |
| 696 | ;; Older packages do not register in minor-mode-list but only in | ||
| 697 | ;; minor-mode-alist. | ||
| 698 | (dolist (x minor-mode-alist) | ||
| 699 | (setq x (car x)) | ||
| 700 | (unless (memq x minor-mode-list) | ||
| 701 | (push x minor-mode-list))) | ||
| 696 | ;; Find enabled minor mode we will want to mention. | 702 | ;; Find enabled minor mode we will want to mention. |
| 697 | (dolist (mode minor-mode-list) | 703 | (dolist (mode minor-mode-list) |
| 698 | ;; Document a minor mode if it is listed in minor-mode-alist, | 704 | ;; Document a minor mode if it is listed in minor-mode-alist, |
| 699 | ;; non-nil, and has a function definition. | 705 | ;; non-nil, and has a function definition. |
| 700 | (and (boundp mode) (symbol-value mode) | 706 | (and (boundp mode) (symbol-value mode) |
| 701 | (fboundp mode) | 707 | (fboundp mode) |
| 702 | (let ((pretty-minor-mode mode) | 708 | (let ((pretty-minor-mode mode)) |
| 703 | indicator) | ||
| 704 | (if (string-match "\\(-minor\\)?-mode\\'" | 709 | (if (string-match "\\(-minor\\)?-mode\\'" |
| 705 | (symbol-name mode)) | 710 | (symbol-name mode)) |
| 706 | (setq pretty-minor-mode | 711 | (setq pretty-minor-mode |
| 707 | (capitalize | 712 | (capitalize |
| 708 | (substring (symbol-name mode) | 713 | (substring (symbol-name mode) |
| 709 | 0 (match-beginning 0))))) | 714 | 0 (match-beginning 0))))) |
| 710 | (setq indicator (cadr (assq mode minor-mode-alist))) | 715 | (push (list pretty-minor-mode mode |
| 711 | (while (and indicator (symbolp indicator) | 716 | (format-mode-line (assq mode minor-mode-alist))) |
| 712 | (boundp indicator) | ||
| 713 | (not (eq indicator (symbol-value indicator)))) | ||
| 714 | (setq indicator (symbol-value indicator))) | ||
| 715 | (push (list pretty-minor-mode mode indicator) | ||
| 716 | minor-modes)))) | 717 | minor-modes)))) |
| 717 | (if auto-fill-function | 718 | (if auto-fill-function |
| 718 | ;; copy pure string so we can add face property to it below. | 719 | ;; copy pure string so we can add face property to it below. |
| @@ -729,6 +730,9 @@ whose documentation describes the minor mode." | |||
| 729 | (let ((pretty-minor-mode (nth 0 mode)) | 730 | (let ((pretty-minor-mode (nth 0 mode)) |
| 730 | (mode-function (nth 1 mode)) | 731 | (mode-function (nth 1 mode)) |
| 731 | (indicator (nth 2 mode))) | 732 | (indicator (nth 2 mode))) |
| 733 | (setq indicator (if (zerop (length indicator)) | ||
| 734 | "no indicator" | ||
| 735 | (format "indicator%s" indicator))) | ||
| 732 | (add-text-properties 0 (length pretty-minor-mode) | 736 | (add-text-properties 0 (length pretty-minor-mode) |
| 733 | '(face bold) pretty-minor-mode) | 737 | '(face bold) pretty-minor-mode) |
| 734 | (save-excursion | 738 | (save-excursion |
| @@ -737,20 +741,14 @@ whose documentation describes the minor mode." | |||
| 737 | (push (point-marker) help-button-cache) | 741 | (push (point-marker) help-button-cache) |
| 738 | ;; Document the minor modes fully. | 742 | ;; Document the minor modes fully. |
| 739 | (insert pretty-minor-mode) | 743 | (insert pretty-minor-mode) |
| 740 | (princ (format " minor mode (%s):\n" | 744 | (princ (format " minor mode (%s):\n" indicator)) |
| 741 | (if indicator | ||
| 742 | (format "indicator%s" indicator) | ||
| 743 | "no indicator"))) | ||
| 744 | (princ (documentation mode-function))) | 745 | (princ (documentation mode-function))) |
| 745 | (princ " ") | 746 | (princ " ") |
| 746 | (insert-button pretty-minor-mode | 747 | (insert-button pretty-minor-mode |
| 747 | 'action (car help-button-cache) | 748 | 'action (car help-button-cache) |
| 748 | 'follow-link t | 749 | 'follow-link t |
| 749 | 'help-echo "mouse-2, RET: show full information") | 750 | 'help-echo "mouse-2, RET: show full information") |
| 750 | (princ (format " minor mode (%s):\n" | 751 | (princ (format " minor mode (%s):\n" indicator))))) |
| 751 | (if indicator | ||
| 752 | (format "indicator%s" indicator) | ||
| 753 | "no indicator")))))) | ||
| 754 | (princ "\n(Full information about these minor modes | 752 | (princ "\n(Full information about these minor modes |
| 755 | follows the description of the major mode.)\n\n")) | 753 | follows the description of the major mode.)\n\n")) |
| 756 | ;; Document the major mode. | 754 | ;; Document the major mode. |
| @@ -896,5 +894,5 @@ out of view." | |||
| 896 | ;; defcustoms which require 'help'. | 894 | ;; defcustoms which require 'help'. |
| 897 | (provide 'help) | 895 | (provide 'help) |
| 898 | 896 | ||
| 899 | ;;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423 | 897 | ;; arch-tag: cf427352-27e9-49b7-9a6f-741ebab02423 |
| 900 | ;;; help.el ends here | 898 | ;;; help.el ends here |