aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKim F. Storm <[email protected]>2004-10-26 12:59:44 +0000
committerKim F. Storm <[email protected]>2004-10-26 12:59:44 +0000
commit4cf9f027a1107b10f9bda998ddcf35eb84471c05 (patch)
tree99f97c47e2f8786c22f460f2e32f252f9f79c858
parentc86364354c0b816df51fdafc0ac2fe650cadd501 (diff)
(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 c27bcc4905..ee35d00763 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -573,14 +573,14 @@ the last key hit are used."
(if (symbolp defn) defn (prin1-to-string defn)))))))))
-(defun describe-key (key &optional untranslated)
+(defun describe-key (key &optional untranslated up-event)
"Display documentation of the function invoked by KEY.
KEY should be a key sequence--when calling from a program,
pass a string or a vector.
If non-nil UNTRANSLATED is a vector of the untranslated events.
It can also be a number in which case the untranslated events from
the last key hit are used."
- (interactive "kDescribe key: \np")
+ (interactive "kDescribe key: \np\nU")
(if (numberp untranslated)
(setq untranslated (this-single-command-raw-keys)))
(save-excursion
@@ -608,6 +608,17 @@ the last key hit are used."
(prin1 defn)
(princ "\n which is ")
(describe-function-1 defn)
+ (when up-event
+ (let ((defn (or (string-key-binding up-event) (key-binding up-event))))
+ (unless (or (null defn) (integerp defn) (equal defn 'undefined))
+ (princ "\n\n-------------- up event ---------------\n\n")
+ (princ (key-description up-event))
+ (if (windowp window)
+ (princ " at that spot"))
+ (princ " runs the command ")
+ (prin1 defn)
+ (princ "\n which is ")
+ (describe-function-1 defn))))
(print-help-return-message)))))))