summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorDaniel Pfeiffer <occitan@esperanto.org>2004-10-13 18:56:27 +0000
committerDaniel Pfeiffer <occitan@esperanto.org>2004-10-13 18:56:27 +0000
commit21ff478665eb8b5144f5526acc7a22536861db34 (patch)
treef8ff238f2ec2dc3a54a704b1b2e026b57c37857e /lisp/help.el
parent0cb89d7a1a73c0a52c3a3fe18ea3574bd3a1b484 (diff)
downloademacs-21ff478665eb8b5144f5526acc7a22536861db34.tar.gz
(describe-mode): Use marker buttons to make minor mode list into hyperlinks.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el57
1 files changed, 35 insertions, 22 deletions
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 @@
(define-key help-map "q" 'help-quit)
+;; insert-button makes the action nil if it is not store somewhere
+(defvar help-button-cache nil)
+
(defun help-quit ()
"Just exit from the Help command's command loop."
@@ -655,32 +658,42 @@ whose documentation describes the minor mode."
(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")))))
+ (make-local-variable 'help-button-cache)
+ (with-current-buffer standard-output
+ (dolist (mode minor-modes)
+ (let ((pretty-minor-mode (nth 0 mode))
+ (mode-function (nth 1 mode))
+ (indicator (nth 2 mode)))
+ (add-text-properties 0 (length pretty-minor-mode)
+ '(face bold) pretty-minor-mode)
+ (save-excursion
+ (goto-char (point-max))
+ (princ "\n\f\n")
+ (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)
+ '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.
- (princ mode-name)
+ (let ((mode mode-name))
+ (with-current-buffer standard-output
+ (insert mode)
+ (add-text-properties (- (point) (length mode)) (point) '(face bold))))
(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)))))
+ (princ (documentation major-mode)))
(print-help-return-message))))