aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRichard M. Stallman2006-09-24 20:43:32 +0000
committerRichard M. Stallman2006-09-24 20:43:32 +0000
commitbadf89eaea4e8937d8861589991306894dc5e541 (patch)
tree62b94991fafd0f3cae2fc44f20c8bba82586068a
parent63522e3aded5c56f75dca56bc1c0fce8d468ce26 (diff)
downloademacs-badf89eaea4e8937d8861589991306894dc5e541.tar.gz
emacs-badf89eaea4e8937d8861589991306894dc5e541.zip
(describe-key, describe-key-briefly): Test last event for being a down-event.
-rw-r--r--lisp/help.el22
1 files changed, 10 insertions, 12 deletions
diff --git a/lisp/help.el b/lisp/help.el
index 10ad5fe6deb..b79e028b633 100644
--- a/lisp/help.el
+++ b/lisp/help.el
@@ -571,16 +571,9 @@ temporarily enables it to allow getting help on disabled items and buttons."
571 ;; down-events on scroll bars and mode lines: the actual 571 ;; down-events on scroll bars and mode lines: the actual
572 ;; event then is in the second element of the vector. 572 ;; event then is in the second element of the vector.
573 (and (vectorp key) 573 (and (vectorp key)
574 (or (and (eventp (aref key 0)) 574 (let ((last-idx (1- (length key))))
575 (memq 'down (event-modifiers (aref key 0))) 575 (and (eventp (aref key last-idx))
576 ;; However, for the C-down-mouse-2 popup 576 (memq 'down (event-modifiers (aref key last-idx)))))
577 ;; menu, there is no subsequent up-event. In
578 ;; this case, the up-event is the next
579 ;; element in the supplied vector.
580 (= (length key) 1))
581 (and (> (length key) 1)
582 (eventp (aref key 1))
583 (memq 'down (event-modifiers (aref key 1)))))
584 (read-event)) 577 (read-event))
585 (list 578 (list
586 key 579 key
@@ -648,9 +641,14 @@ temporarily enables it to allow getting help on disabled items and buttons."
648 (list 641 (list
649 key 642 key
650 (prefix-numeric-value current-prefix-arg) 643 (prefix-numeric-value current-prefix-arg)
651 ;; If KEY is a down-event, read the corresponding up-event 644 ;; If KEY is a down-event, read and discard the
652 ;; and use it as the third argument. 645 ;; corresponding up-event. Note that there are also
646 ;; down-events on scroll bars and mode lines: the actual
647 ;; event then is in the second element of the vector.
653 (and (vectorp key) 648 (and (vectorp key)
649 (let ((last-idx (1- (length key))))
650 (and (eventp (aref key last-idx))
651 (memq 'down (event-modifiers (aref key last-idx)))))
654 (or (and (eventp (aref key 0)) 652 (or (and (eventp (aref key 0))
655 (memq 'down (event-modifiers (aref key 0))) 653 (memq 'down (event-modifiers (aref key 0)))
656 ;; However, for the C-down-mouse-2 popup 654 ;; However, for the C-down-mouse-2 popup