573 |
(if (symbolp defn) defn (prin1-to-string defn))))))))) |
(if (symbolp defn) defn (prin1-to-string defn))))))))) |
574 |
|
|
575 |
|
|
576 |
(defun describe-key (key &optional untranslated) |
(defun describe-key (key &optional untranslated up-event) |
577 |
"Display documentation of the function invoked by KEY. |
"Display documentation of the function invoked by KEY. |
578 |
KEY should be a key sequence--when calling from a program, |
KEY should be a key sequence--when calling from a program, |
579 |
pass a string or a vector. |
pass a string or a vector. |
580 |
If non-nil UNTRANSLATED is a vector of the untranslated events. |
If non-nil UNTRANSLATED is a vector of the untranslated events. |
581 |
It can also be a number in which case the untranslated events from |
It can also be a number in which case the untranslated events from |
582 |
the last key hit are used." |
the last key hit are used." |
583 |
(interactive "kDescribe key: \np") |
(interactive "kDescribe key: \np\nU") |
584 |
(if (numberp untranslated) |
(if (numberp untranslated) |
585 |
(setq untranslated (this-single-command-raw-keys))) |
(setq untranslated (this-single-command-raw-keys))) |
586 |
(save-excursion |
(save-excursion |
608 |
(prin1 defn) |
(prin1 defn) |
609 |
(princ "\n which is ") |
(princ "\n which is ") |
610 |
(describe-function-1 defn) |
(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)))) |
622 |
(print-help-return-message))))))) |
(print-help-return-message))))))) |
623 |
|
|
624 |
|
|