/[emacs]/emacs/lisp/help.el
ViewVC logotype

Diff of /emacs/lisp/help.el

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.269 by kfstorm, Sun Oct 24 21:07:38 2004 UTC revision 1.270 by kfstorm, Tue Oct 26 12:59:44 2004 UTC
# Line 573  the last key hit are used." Line 573  the last key hit are used."
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
# Line 608  the last key hit are used." Line 608  the last key hit are used."
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    

Legend:
Removed from v.1.269  
changed lines
  Added in v.1.270

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26