diff options
| author | Alan Mackenzie | 2016-02-19 17:10:57 +0000 |
|---|---|---|
| committer | Alan Mackenzie | 2016-02-19 17:10:57 +0000 |
| commit | 10c0e1ca40237224aa229c538fe49983ec905748 (patch) | |
| tree | 704374c9d6775317d3dbca64a277fe96a8b08f2a | |
| parent | 5e8a62917ade3751a328aa90830b51bbed90e15d (diff) | |
| download | emacs-10c0e1ca40237224aa229c538fe49983ec905748.tar.gz emacs-10c0e1ca40237224aa229c538fe49983ec905748.zip | |
Await the final mouse event in C-h c and C-h k.
* lisp/help.el (describe-key-briefly, describe-key): On receiving a mouse
event, keep reading further events until a timeout occurs, to ensure we have
the complete mouse event from the user.
| -rw-r--r-- | lisp/help.el | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/lisp/help.el b/lisp/help.el index 061daacfdd3..ce68cea6dd5 100644 --- a/lisp/help.el +++ b/lisp/help.el | |||
| @@ -613,7 +613,15 @@ temporarily enables it to allow getting help on disabled items and buttons." | |||
| 613 | (when (null (cdr yank-menu)) | 613 | (when (null (cdr yank-menu)) |
| 614 | (setq saved-yank-menu (copy-sequence yank-menu)) | 614 | (setq saved-yank-menu (copy-sequence yank-menu)) |
| 615 | (menu-bar-update-yank-menu "(any string)" nil)) | 615 | (menu-bar-update-yank-menu "(any string)" nil)) |
| 616 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) | 616 | (while |
| 617 | (progn | ||
| 618 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) | ||
| 619 | (and (vectorp key) | ||
| 620 | (consp (aref key 0)) | ||
| 621 | (symbolp (car (aref key 0))) | ||
| 622 | (string-match "\\(mouse\\|down\\|click\\|drag\\)" | ||
| 623 | (symbol-name (car (aref key 0)))) | ||
| 624 | (not (sit-for (/ double-click-time 1000.0) t))))) | ||
| 617 | ;; Clear the echo area message (Bug#7014). | 625 | ;; Clear the echo area message (Bug#7014). |
| 618 | (message nil) | 626 | (message nil) |
| 619 | ;; If KEY is a down-event, read and discard the | 627 | ;; If KEY is a down-event, read and discard the |
| @@ -750,7 +758,15 @@ temporarily enables it to allow getting help on disabled items and buttons." | |||
| 750 | (when (null (cdr yank-menu)) | 758 | (when (null (cdr yank-menu)) |
| 751 | (setq saved-yank-menu (copy-sequence yank-menu)) | 759 | (setq saved-yank-menu (copy-sequence yank-menu)) |
| 752 | (menu-bar-update-yank-menu "(any string)" nil)) | 760 | (menu-bar-update-yank-menu "(any string)" nil)) |
| 753 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) | 761 | (while |
| 762 | (progn | ||
| 763 | (setq key (read-key-sequence "Describe key (or click or menu item): ")) | ||
| 764 | (and (vectorp key) | ||
| 765 | (consp (aref key 0)) | ||
| 766 | (symbolp (car (aref key 0))) | ||
| 767 | (string-match "\\(mouse\\|down\\|click\\|drag\\)" | ||
| 768 | (symbol-name (car (aref key 0)))) | ||
| 769 | (not (sit-for (/ double-click-time 1000.0) t))))) | ||
| 754 | (list | 770 | (list |
| 755 | key | 771 | key |
| 756 | (prefix-numeric-value current-prefix-arg) | 772 | (prefix-numeric-value current-prefix-arg) |