aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm2004-10-26 12:59:44 +0000
committerKim F. Storm2004-10-26 12:59:44 +0000
commit4cf9f027a1107b10f9bda998ddcf35eb84471c05 (patch)
tree99f97c47e2f8786c22f460f2e32f252f9f79c858
parentc86364354c0b816df51fdafc0ac2fe650cadd501 (diff)
downloademacs-4cf9f027a1107b10f9bda998ddcf35eb84471c05.tar.gz
emacs-4cf9f027a1107b10f9bda998ddcf35eb84471c05.zip
(describe-key): Describe both down-event and up-event
for a mouse click.
-rw-r--r--lisp/help.el15
1 files changed, 13 insertions, 2 deletions
diff --git a/lisp/help.el b/lisp/help.el
index c27bcc49055..ee35d007639 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -573,14 +573,14 @@ the last key hit are used."
573 (if (symbolp defn) defn (prin1-to-string defn))))))))) 573 (if (symbolp defn) defn (prin1-to-string defn)))))))))
574 574
575 575
576(defun describe-key (key &optional untranslated) 576(defun describe-key (key &optional untranslated up-event)
577 "Display documentation of the function invoked by KEY. 577 "Display documentation of the function invoked by KEY.
578KEY should be a key sequence--when calling from a program, 578KEY should be a key sequence--when calling from a program,
579pass a string or a vector. 579pass a string or a vector.
580If non-nil UNTRANSLATED is a vector of the untranslated events. 580If non-nil UNTRANSLATED is a vector of the untranslated events.
581It can also be a number in which case the untranslated events from 581It can also be a number in which case the untranslated events from
582the last key hit are used." 582the last key hit are used."
583 (interactive "kDescribe key: \np") 583 (interactive "kDescribe key: \np\nU")
584 (if (numberp untranslated) 584 (if (numberp untranslated)
585 (setq untranslated (this-single-command-raw-keys))) 585 (setq untranslated (this-single-command-raw-keys)))
586 (save-excursion 586 (save-excursion
@@ -608,6 +608,17 @@ the last key hit are used."
608 (prin1 defn) 608 (prin1 defn)
609 (princ "\n which is ") 609 (princ "\n which is ")
610 (describe-function-1 defn) 610 (describe-function-1 defn)
611 (when up-event
612 (let ((defn (or (string-key-binding up-event) (key-binding up-event))))
613 (unless (or (null defn) (integerp defn) (equal defn 'undefined))
614 (princ "\n\n-------------- up event ---------------\n\n")
615 (princ (key-description up-event))
616 (if (windowp window)
617 (princ " at that spot"))
618 (princ " runs the command ")
619 (prin1 defn)
620 (princ "\n which is ")
621 (describe-function-1 defn))))
611 (print-help-return-message))))))) 622 (print-help-return-message)))))))
612 623
613 624