aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Pfeiffer2004-10-13 19:01:01 +0000
committerDaniel Pfeiffer2004-10-13 19:01:01 +0000
commite25e90b4b14db2a4443b614d9b6e2b0968f666f6 (patch)
treea2023a62fcf6e52c73319ef9e1a2ece02162c4cc
parentcb32aefcd40eef863c52c25462fd1c0b90e45393 (diff)
downloademacs-e25e90b4b14db2a4443b614d9b6e2b0968f666f6.tar.gz
emacs-e25e90b4b14db2a4443b614d9b6e2b0968f666f6.zip
(describe-mode): Use marker buttons to make minor mode list into hyperlinks.
-rw-r--r--lisp/ChangeLog11
-rw-r--r--lisp/help.el57
2 files changed, 46 insertions, 22 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 034c874de2c..41606eb7e93 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,14 @@
12004-10-13 Daniel Pfeiffer <occitan@esperanto.org>
2
3 * button.el (button-activate): Allow a marker to display as an
4 action.
5
6 * help-fns.el (describe-variable): Use it to make "below" a
7 hyperlink.
8
9 * help.el (describe-mode): Use it to make minor mode list into
10 hyperlinks.
11
12004-10-14 Masatake YAMATO <jet@gyve.org> 122004-10-14 Masatake YAMATO <jet@gyve.org>
2 13
3 * progmodes/gud.el (gdb-script-beginning-of-defun): New function. 14 * progmodes/gud.el (gdb-script-beginning-of-defun): New function.
diff --git a/lisp/help.el b/lisp/help.el
index bf0df4358a7..5a2867bdc18 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -111,6 +111,9 @@
111 111
112(define-key help-map "q" 'help-quit) 112(define-key help-map "q" 'help-quit)
113 113
114;; insert-button makes the action nil if it is not store somewhere
115(defvar help-button-cache nil)
116
114 117
115(defun help-quit () 118(defun help-quit ()
116 "Just exit from the Help command's command loop." 119 "Just exit from the Help command's command loop."
@@ -655,32 +658,42 @@ whose documentation describes the minor mode."
655 (lambda (a b) (string-lessp (car a) (car b))))) 658 (lambda (a b) (string-lessp (car a) (car b)))))
656 (when minor-modes 659 (when minor-modes
657 (princ "Summary of minor modes:\n") 660 (princ "Summary of minor modes:\n")
658 (dolist (mode minor-modes) 661 (make-local-variable 'help-button-cache)
659 (let ((pretty-minor-mode (nth 0 mode)) 662 (with-current-buffer standard-output
660 (indicator (nth 2 mode))) 663 (dolist (mode minor-modes)
661 (princ (format " %s minor mode (%s):\n" 664 (let ((pretty-minor-mode (nth 0 mode))
662 pretty-minor-mode 665 (mode-function (nth 1 mode))
663 (if indicator 666 (indicator (nth 2 mode)))
664 (format "indicator%s" indicator) 667 (add-text-properties 0 (length pretty-minor-mode)
665 "no indicator"))))) 668 '(face bold) pretty-minor-mode)
669 (save-excursion
670 (goto-char (point-max))
671 (princ "\n\f\n")
672 (push (point-marker) help-button-cache)
673 ;; Document the minor modes fully.
674 (insert pretty-minor-mode)
675 (princ (format " minor mode (%s):\n"
676 (if indicator
677 (format "indicator%s" indicator)
678 "no indicator")))
679 (princ (documentation mode-function)))
680 (princ " ")
681 (insert-button pretty-minor-mode
682 'action (car help-button-cache)
683 'help-echo "mouse-2, RET: show full information")
684 (princ (format " minor mode (%s):\n"
685 (if indicator
686 (format "indicator%s" indicator)
687 "no indicator"))))))
666 (princ "\n(Full information about these minor modes 688 (princ "\n(Full information about these minor modes
667follows the description of the major mode.)\n\n")) 689follows the description of the major mode.)\n\n"))
668 ;; Document the major mode. 690 ;; Document the major mode.
669 (princ mode-name) 691 (let ((mode mode-name))
692 (with-current-buffer standard-output
693 (insert mode)
694 (add-text-properties (- (point) (length mode)) (point) '(face bold))))
670 (princ " mode:\n") 695 (princ " mode:\n")
671 (princ (documentation major-mode)) 696 (princ (documentation major-mode)))
672 ;; Document the minor modes fully.
673 (dolist (mode minor-modes)
674 (let ((pretty-minor-mode (nth 0 mode))
675 (mode-function (nth 1 mode))
676 (indicator (nth 2 mode)))
677 (princ "\n\f\n")
678 (princ (format "%s minor mode (%s):\n"
679 pretty-minor-mode
680 (if indicator
681 (format "indicator%s" indicator)
682 "no indicator")))
683 (princ (documentation mode-function)))))
684 (print-help-return-message)))) 697 (print-help-return-message))))
685 698
686 699