# HG changeset patch # User Richard M. Stallman # Date 1159130612 0 # Node ID 8a999db76eda12db0f974c2d1b7a9f87e0097346 # Parent a90c9318cca9ac828bc90e33ced20ab84cc11b25 (describe-key, describe-key-briefly): Test last event for being a down-event. diff -r a90c9318cca9 -r 8a999db76eda lisp/help.el --- a/lisp/help.el Sun Sep 24 20:42:08 2006 +0000 +++ b/lisp/help.el Sun Sep 24 20:43:32 2006 +0000 @@ -571,16 +571,9 @@ ;; down-events on scroll bars and mode lines: the actual ;; event then is in the second element of the vector. (and (vectorp key) - (or (and (eventp (aref key 0)) - (memq 'down (event-modifiers (aref key 0))) - ;; However, for the C-down-mouse-2 popup - ;; menu, there is no subsequent up-event. In - ;; this case, the up-event is the next - ;; element in the supplied vector. - (= (length key) 1)) - (and (> (length key) 1) - (eventp (aref key 1)) - (memq 'down (event-modifiers (aref key 1))))) + (let ((last-idx (1- (length key)))) + (and (eventp (aref key last-idx)) + (memq 'down (event-modifiers (aref key last-idx))))) (read-event)) (list key @@ -648,9 +641,14 @@ (list key (prefix-numeric-value current-prefix-arg) - ;; If KEY is a down-event, read the corresponding up-event - ;; and use it as the third argument. + ;; If KEY is a down-event, read and discard the + ;; corresponding up-event. Note that there are also + ;; down-events on scroll bars and mode lines: the actual + ;; event then is in the second element of the vector. (and (vectorp key) + (let ((last-idx (1- (length key)))) + (and (eventp (aref key last-idx)) + (memq 'down (event-modifiers (aref key last-idx))))) (or (and (eventp (aref key 0)) (memq 'down (event-modifiers (aref key 0))) ;; However, for the C-down-mouse-2 popup