summaryrefslogtreecommitdiff
path: root/lisp/help.el
diff options
context:
space:
mode:
authorAlan Mackenzie <acm@muc.de>2016-02-19 17:10:57 +0000
committerAlan Mackenzie <acm@muc.de>2016-02-19 17:10:57 +0000
commit10c0e1ca40237224aa229c538fe49983ec905748 (patch)
tree704374c9d6775317d3dbca64a277fe96a8b08f2a /lisp/help.el
parent5e8a62917ade3751a328aa90830b51bbed90e15d (diff)
downloademacs-10c0e1ca40237224aa229c538fe49983ec905748.tar.gz
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.
Diffstat (limited to 'lisp/help.el')
-rw-r--r--lisp/help.el20
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."
(when (null (cdr yank-menu))
(setq saved-yank-menu (copy-sequence yank-menu))
(menu-bar-update-yank-menu "(any string)" nil))
- (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (while
+ (progn
+ (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (and (vectorp key)
+ (consp (aref key 0))
+ (symbolp (car (aref key 0)))
+ (string-match "\\(mouse\\|down\\|click\\|drag\\)"
+ (symbol-name (car (aref key 0))))
+ (not (sit-for (/ double-click-time 1000.0) t)))))
;; Clear the echo area message (Bug#7014).
(message nil)
;; 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."
(when (null (cdr yank-menu))
(setq saved-yank-menu (copy-sequence yank-menu))
(menu-bar-update-yank-menu "(any string)" nil))
- (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (while
+ (progn
+ (setq key (read-key-sequence "Describe key (or click or menu item): "))
+ (and (vectorp key)
+ (consp (aref key 0))
+ (symbolp (car (aref key 0)))
+ (string-match "\\(mouse\\|down\\|click\\|drag\\)"
+ (symbol-name (car (aref key 0))))
+ (not (sit-for (/ double-click-time 1000.0) t)))))
(list
key
(prefix-numeric-value current-prefix-arg)