diff options
| author | Kim F. Storm | 2004-12-17 15:16:46 +0000 |
|---|---|---|
| committer | Kim F. Storm | 2004-12-17 15:16:46 +0000 |
| commit | 72b64ad5bae01aae2bd8c7d012cb392bafaf80a1 (patch) | |
| tree | 6318638ae8d520cf4c2301f2dae330354ab17eb1 | |
| parent | f2a1c81bb16eb803e757cc77c8a1272028483363 (diff) | |
| download | emacs-72b64ad5bae01aae2bd8c7d012cb392bafaf80a1.tar.gz emacs-72b64ad5bae01aae2bd8c7d012cb392bafaf80a1.zip | |
(describe-key): Report effective and original binding
for mouse-1 when clicked on a link.
(describe-mode): Add follow-link property to "minor-mode" button.
| -rw-r--r-- | lisp/help.el | 52 |
1 files changed, 47 insertions, 5 deletions
diff --git a/lisp/help.el b/lisp/help.el index 992a9b85f4b..f5831c9ab3f 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -614,17 +614,58 @@ the last key hit are used." | |||
| 614 | (princ "\n which is ") | 614 | (princ "\n which is ") |
| 615 | (describe-function-1 defn) | 615 | (describe-function-1 defn) |
| 616 | (when up-event | 616 | (when up-event |
| 617 | (let ((defn (or (string-key-binding up-event) (key-binding up-event)))) | 617 | (let ((ev (aref up-event 0)) |
| 618 | (descr (key-description up-event)) | ||
| 619 | (hdr "\n\n-------------- up event ---------------\n\n") | ||
| 620 | defn | ||
| 621 | mouse-1-tricky mouse-1-remapped) | ||
| 622 | (when (and (consp ev) | ||
| 623 | (eq (car ev) 'mouse-1) | ||
| 624 | (windowp window) | ||
| 625 | mouse-1-click-follows-link | ||
| 626 | (not (eq mouse-1-click-follows-link 'double)) | ||
| 627 | (with-current-buffer (window-buffer window) | ||
| 628 | (mouse-on-link-p (posn-point (event-start ev))))) | ||
| 629 | (setq mouse-1-tricky (integerp mouse-1-click-follows-link) | ||
| 630 | mouse-1-remapped (or (not mouse-1-tricky) | ||
| 631 | (> mouse-1-click-follows-link 0))) | ||
| 632 | (if mouse-1-remapped | ||
| 633 | (setcar ev 'mouse-2))) | ||
| 634 | (setq defn (or (string-key-binding up-event) (key-binding up-event))) | ||
| 618 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) | 635 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) |
| 619 | (princ "\n\n-------------- up event ---------------\n\n") | 636 | (princ (if mouse-1-tricky |
| 620 | (princ (key-description up-event)) | 637 | "\n\n----------------- up-event (short click) ----------------\n\n" |
| 638 | hdr)) | ||
| 639 | (setq hdr nil) | ||
| 640 | (princ descr) | ||
| 621 | (if (windowp window) | 641 | (if (windowp window) |
| 622 | (princ " at that spot")) | 642 | (princ " at that spot")) |
| 643 | (if mouse-1-remapped | ||
| 644 | (princ " is remapped to <mouse-2>\n which" )) | ||
| 623 | (princ " runs the command ") | 645 | (princ " runs the command ") |
| 624 | (prin1 defn) | 646 | (prin1 defn) |
| 625 | (princ "\n which is ") | 647 | (princ "\n which is ") |
| 626 | (describe-function-1 defn)))) | 648 | (describe-function-1 defn)) |
| 627 | (print-help-return-message))))))) | 649 | (when mouse-1-tricky |
| 650 | (setcar ev | ||
| 651 | (if (> mouse-1-click-follows-link 0) 'mouse-1 'mouse-2)) | ||
| 652 | (setq defn (or (string-key-binding up-event) (key-binding up-event))) | ||
| 653 | (unless (or (null defn) (integerp defn) (equal defn 'undefined)) | ||
| 654 | (princ (or hdr | ||
| 655 | "\n\n----------------- up-event (long click) ----------------\n\n")) | ||
| 656 | (princ "Pressing ") | ||
| 657 | (princ descr) | ||
| 658 | (if (windowp window) | ||
| 659 | (princ " at that spot")) | ||
| 660 | (princ (format " for longer than %d milli-seconds\n" | ||
| 661 | (abs mouse-1-click-follows-link))) | ||
| 662 | (if (not mouse-1-remapped) | ||
| 663 | (princ " remaps it to <mouse-2> which" )) | ||
| 664 | (princ " runs the command ") | ||
| 665 | (prin1 defn) | ||
| 666 | (princ "\n which is ") | ||
| 667 | (describe-function-1 defn)))) | ||
| 668 | (print-help-return-message)))))))) | ||
| 628 | 669 | ||
| 629 | 670 | ||
| 630 | (defun describe-mode (&optional buffer) | 671 | (defun describe-mode (&optional buffer) |
| @@ -697,6 +738,7 @@ whose documentation describes the minor mode." | |||
| 697 | (princ " ") | 738 | (princ " ") |
| 698 | (insert-button pretty-minor-mode | 739 | (insert-button pretty-minor-mode |
| 699 | 'action (car help-button-cache) | 740 | 'action (car help-button-cache) |
| 741 | 'follow-link t | ||
| 700 | 'help-echo "mouse-2, RET: show full information") | 742 | 'help-echo "mouse-2, RET: show full information") |
| 701 | (princ (format " minor mode (%s):\n" | 743 | (princ (format " minor mode (%s):\n" |
| 702 | (if indicator | 744 | (if indicator |