diff options
| author | Eli Zaretskii | 2006-02-11 16:03:14 +0000 |
|---|---|---|
| committer | Eli Zaretskii | 2006-02-11 16:03:14 +0000 |
| commit | 8ee320fc76cd5d425fdd1f16845a5486b0b8afcc (patch) | |
| tree | 22671cc5444aa00c2dfea252e94eb52dadaecd30 /lisp | |
| parent | c54fb9ef13ca4850bc24fa70cd5973db2d401159 (diff) | |
| download | emacs-8ee320fc76cd5d425fdd1f16845a5486b0b8afcc.tar.gz emacs-8ee320fc76cd5d425fdd1f16845a5486b0b8afcc.zip | |
(describe-key-briefly, describe-key): Populate yank-menu if empty.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/help.el | 34 |
2 files changed, 30 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 0c176e43356..9faa1ab01d8 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -2,10 +2,10 @@ | |||
| 2 | 2 | ||
| 3 | * help.el (describe-key-briefly): Now a wrapper for | 3 | * help.el (describe-key-briefly): Now a wrapper for |
| 4 | describe-key-briefly-internal. Bind enable-disabled-menus-and-buttons | 4 | describe-key-briefly-internal. Bind enable-disabled-menus-and-buttons |
| 5 | to t. | 5 | to t. Populate yank-menu if empty. |
| 6 | (describe-key-briefly-internal): Renamed from describe-key-briefly. | 6 | (describe-key-briefly-internal): Renamed from describe-key-briefly. |
| 7 | (describe-key): Now a wrapper for describe-key-internal. Bind | 7 | (describe-key): Now a wrapper for describe-key-internal. Bind |
| 8 | enable-disabled-menus-and-buttons to t. | 8 | enable-disabled-menus-and-buttons to t. Populate yank-menu if empty. |
| 9 | (describe-key-internal): Renamed from describe-key. | 9 | (describe-key-internal): Renamed from describe-key. |
| 10 | 10 | ||
| 11 | 2006-02-11 Milan Zamazal <pdm@zamazal.org> | 11 | 2006-02-11 Milan Zamazal <pdm@zamazal.org> |
diff --git a/lisp/help.el b/lisp/help.el index b010722bec0..bea404f5112 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -564,13 +564,24 @@ It can also be a number in which case the untranslated events from | |||
| 564 | the last key hit are used. | 564 | the last key hit are used. |
| 565 | 565 | ||
| 566 | If KEY is a menu item or a tool-bar button that is disabled, this command | 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." | 567 | temporarily enables it to allow getting help on disabled items and buttons." |
| 568 | (interactive) | 568 | (interactive) |
| 569 | (let ((enable-disabled-menus-and-buttons t)) | 569 | (let ((enable-disabled-menus-and-buttons t) |
| 570 | (save-yank-menu)) | ||
| 570 | (if key | 571 | (if key |
| 571 | ;; Non-interactive invocation | 572 | ;; Non-interactive invocation |
| 572 | (describe-key-briefly-internal key insert untranslated) | 573 | (describe-key-briefly-internal key insert untranslated) |
| 573 | (call-interactively 'describe-key-briefly-internal)))) | 574 | ;; If yank-menu is empty, populate it temporarily, so that |
| 575 | ;; "Select and Paste" menu can generate a complete event | ||
| 576 | (if (null (cdr yank-menu)) | ||
| 577 | (unwind-protect | ||
| 578 | (progn | ||
| 579 | (setq save-yank-menu (copy-sequence yank-menu)) | ||
| 580 | (menu-bar-update-yank-menu "(any string)" nil) | ||
| 581 | (call-interactively 'describe-key-briefly-internal)) | ||
| 582 | (progn (setq yank-menu (copy-sequence save-yank-menu)) | ||
| 583 | (fset 'yank-menu (cons 'keymap yank-menu)))) | ||
| 584 | (call-interactively 'describe-key-briefly-internal))))) | ||
| 574 | 585 | ||
| 575 | (defun describe-key-briefly-internal (key &optional insert untranslated) | 586 | (defun describe-key-briefly-internal (key &optional insert untranslated) |
| 576 | "Print the name of the function KEY invokes. KEY is a string. | 587 | "Print the name of the function KEY invokes. KEY is a string. |
| @@ -629,13 +640,24 @@ the last key sequence entered are used. | |||
| 629 | UP-EVENT is the up-event that was discarded by reading KEY, or nil. | 640 | UP-EVENT is the up-event that was discarded by reading KEY, or nil. |
| 630 | 641 | ||
| 631 | If KEY is a menu item or a tool-bar button that is disabled, this command | 642 | 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." | 643 | temporarily enables it to allow getting help on disabled items and buttons." |
| 633 | (interactive) | 644 | (interactive) |
| 634 | (let ((enable-disabled-menus-and-buttons t)) | 645 | (let ((enable-disabled-menus-and-buttons t) |
| 646 | (save-yank-menu)) | ||
| 635 | (if key | 647 | (if key |
| 636 | ;; Non-interactive invocation | 648 | ;; Non-interactive invocation |
| 637 | (describe-key-internal key untranslated up-event) | 649 | (describe-key-internal key untranslated up-event) |
| 638 | (call-interactively 'describe-key-internal)))) | 650 | ;; If yank-menu is empty, populate it temporarily, so that |
| 651 | ;; "Select and Paste" menu can generate a complete event | ||
| 652 | (if (null (cdr yank-menu)) | ||
| 653 | (unwind-protect | ||
| 654 | (progn | ||
| 655 | (setq save-yank-menu (copy-sequence yank-menu)) | ||
| 656 | (menu-bar-update-yank-menu "(any string)" nil) | ||
| 657 | (call-interactively 'describe-key-internal)) | ||
| 658 | (progn (setq yank-menu (copy-sequence save-yank-menu)) | ||
| 659 | (fset 'yank-menu (cons 'keymap yank-menu)))) | ||
| 660 | (call-interactively 'describe-key-internal))))) | ||
| 639 | 661 | ||
| 640 | (defun describe-key-internal (key &optional untranslated up-event) | 662 | (defun describe-key-internal (key &optional untranslated up-event) |
| 641 | "Display documentation of the function invoked by KEY. | 663 | "Display documentation of the function invoked by KEY. |