diff options
| author | Eli Zaretskii | 2006-02-11 13:55:42 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-02-11 13:55:42 +0000 |
| commit | 6527c9830762f84afba0e2abc0da70dd46c9ac0b (patch) | |
| tree | 287997d1f4374ee71c26d2cd553e8d0935685083 | |
| parent | 9d56e0da1fe2128b9c7ffdf05f5f7b9ad2ece9fc (diff) | |
| download | emacs-6527c9830762f84afba0e2abc0da70dd46c9ac0b.tar.gz emacs-6527c9830762f84afba0e2abc0da70dd46c9ac0b.zip | |
(describe-key-briefly): Now a wrapper for describe-key-briefly-internal.
Bind enable-disabled-menus-and-buttons to t.
(describe-key-briefly-internal): Renamed from describe-key-briefly.
(describe-key): Now a wrapper for describe-key-internal. Bind
enable-disabled-menus-and-buttons to t.
(describe-key-internal): Renamed from describe-key.
| -rw-r--r-- | lisp/help.el | 44 |
1 files changed, 40 insertions, 4 deletions
diff --git a/lisp/help.el b/lisp/help.el index f8ed27810ea..b010722bec0 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -556,7 +556,23 @@ or `keymap' property, return the binding of KEY in the string's keymap." | |||
| 556 | string | 556 | string |
| 557 | (format "%s (translated from %s)" string otherstring)))))) | 557 | (format "%s (translated from %s)" string otherstring)))))) |
| 558 | 558 | ||
| 559 | (defun describe-key-briefly (key &optional insert untranslated) | 559 | (defun describe-key-briefly (&optional key insert untranslated) |
| 560 | "Print the name of the function KEY invokes. KEY is a string. | ||
| 561 | If INSERT (the prefix arg) is non-nil, insert the message in the buffer. | ||
| 562 | If non-nil, UNTRANSLATED is a vector of the untranslated events. | ||
| 563 | It can also be a number in which case the untranslated events from | ||
| 564 | the last key hit are used. | ||
| 565 | |||
| 566 | If KEY is a menu item or a tool-bar button that is disabled, this command | ||
| 567 | temporarily enables it to allow clicking on disabled items and buttons." | ||
| 568 | (interactive) | ||
| 569 | (let ((enable-disabled-menus-and-buttons t)) | ||
| 570 | (if key | ||
| 571 | ;; Non-interactive invocation | ||
| 572 | (describe-key-briefly-internal key insert untranslated) | ||
| 573 | (call-interactively 'describe-key-briefly-internal)))) | ||
| 574 | |||
| 575 | (defun describe-key-briefly-internal (key &optional insert untranslated) | ||
| 560 | "Print the name of the function KEY invokes. KEY is a string. | 576 | "Print the name of the function KEY invokes. KEY is a string. |
| 561 | If INSERT (the prefix arg) is non-nil, insert the message in the buffer. | 577 | If INSERT (the prefix arg) is non-nil, insert the message in the buffer. |
| 562 | If non-nil UNTRANSLATED is a vector of the untranslated events. | 578 | If non-nil UNTRANSLATED is a vector of the untranslated events. |
| @@ -601,7 +617,27 @@ the last key hit are used." | |||
| 601 | key-desc | 617 | key-desc |
| 602 | (if (symbolp defn) defn (prin1-to-string defn))))))))) | 618 | (if (symbolp defn) defn (prin1-to-string defn))))))))) |
| 603 | 619 | ||
| 604 | (defun describe-key (key &optional untranslated up-event) | 620 | (defun describe-key (&optional key untranslated up-event) |
| 621 | "Display documentation of the function invoked by KEY. | ||
| 622 | KEY can be any kind of a key sequence; it can include keyboard events, | ||
| 623 | mouse events, and/or menu events. When calling from a program, | ||
| 624 | pass KEY as a string or a vector. | ||
| 625 | |||
| 626 | If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events. | ||
| 627 | It can also be a number, in which case the untranslated events from | ||
| 628 | the last key sequence entered are used. | ||
| 629 | UP-EVENT is the up-event that was discarded by reading KEY, or nil. | ||
| 630 | |||
| 631 | If KEY is a menu item or a tool-bar button that is disabled, this command | ||
| 632 | temporarily enables it to allow clicking on disabled items and buttons." | ||
| 633 | (interactive) | ||
| 634 | (let ((enable-disabled-menus-and-buttons t)) | ||
| 635 | (if key | ||
| 636 | ;; Non-interactive invocation | ||
| 637 | (describe-key-internal key untranslated up-event) | ||
| 638 | (call-interactively 'describe-key-internal)))) | ||
| 639 | |||
| 640 | (defun describe-key-internal (key &optional untranslated up-event) | ||
| 605 | "Display documentation of the function invoked by KEY. | 641 | "Display documentation of the function invoked by KEY. |
| 606 | KEY can be any kind of a key sequence; it can include keyboard events, | 642 | KEY can be any kind of a key sequence; it can include keyboard events, |
| 607 | mouse events, and/or menu events. When calling from a program, | 643 | mouse events, and/or menu events. When calling from a program, |
| @@ -609,8 +645,8 @@ pass KEY as a string or a vector. | |||
| 609 | 645 | ||
| 610 | If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events. | 646 | If non-nil, UNTRANSLATED is a vector of the corresponding untranslated events. |
| 611 | It can also be a number, in which case the untranslated events from | 647 | It can also be a number, in which case the untranslated events from |
| 612 | the last key sequence entered are used." | 648 | the last key sequence entered are used. |
| 613 | ;; UP-EVENT is the up-event that was discarded by reading KEY, or nil. | 649 | UP-EVENT is the up-event that was discarded by reading KEY, or nil." |
| 614 | (interactive "kDescribe key (or click or menu item): \np\nU") | 650 | (interactive "kDescribe key (or click or menu item): \np\nU") |
| 615 | (if (numberp untranslated) | 651 | (if (numberp untranslated) |
| 616 | (setq untranslated (this-single-command-raw-keys))) | 652 | (setq untranslated (this-single-command-raw-keys))) |