]> git.eshelyaron.com Git - emacs.git/commitdiff
(describe-mode): Use marker buttons to make minor mode list into hyperlinks.
authorDaniel Pfeiffer <occitan@esperanto.org>
Wed, 13 Oct 2004 19:01:01 +0000 (19:01 +0000)
committerDaniel Pfeiffer <occitan@esperanto.org>
Wed, 13 Oct 2004 19:01:01 +0000 (19:01 +0000)
lisp/ChangeLog
lisp/help.el

index 034c874de2c10fd31d53da05c1aa90eb3c94524b..41606eb7e93a3068ad1c904ec60afbf5045d36b7 100644 (file)
@@ -1,3 +1,14 @@
+2004-10-13  Daniel Pfeiffer  <occitan@esperanto.org>
+
+       * button.el (button-activate): Allow a marker to display as an
+       action.
+
+       * help-fns.el (describe-variable): Use it to make "below" a
+       hyperlink.
+
+       * help.el (describe-mode): Use it to make minor mode list into
+       hyperlinks.
+
 2004-10-14  Masatake YAMATO  <jet@gyve.org>
 
        * progmodes/gud.el (gdb-script-beginning-of-defun): New function.
index bf0df4358a7e07a6701e259197e557150491da7d..5a2867bdc183d424d2986e95ba752a323bb8b7f6 100644 (file)
 
 (define-key help-map "q" 'help-quit)
 
+;; insert-button makes the action nil if it is not store somewhere
+(defvar help-button-cache nil)
+
 \f
 (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))))