changeset 73082:40a575bcdf72

* help.el (describe-key-briefly, describe-key): Don't expect an extra up event if a down-event is generated by a popup menu.
author Chong Yidong <cyd@stupidchicken.com>
date Sat, 23 Sep 2006 19:34:38 +0000
parents 6953eaae7734
children fcfd01b24e1e
files lisp/ChangeLog lisp/help.el
diffstat 2 files changed, 17 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sat Sep 23 19:06:28 2006 +0000
+++ b/lisp/ChangeLog	Sat Sep 23 19:34:38 2006 +0000
@@ -1,3 +1,8 @@
+2006-09-23  Chong Yidong  <cyd@stupidchicken.com>
+
+	* help.el (describe-key-briefly, describe-key): Don't expect an
+	extra up event if a down-event is generated by a popup menu.
+
 2006-09-23  Michal Nazarewicz  <mnazarewicz@gmail.com> (tiny change)
 
 	* textmodes/ispell.el (ispell-change-dictionary): Don't check the
--- a/lisp/help.el	Sat Sep 23 19:06:28 2006 +0000
+++ b/lisp/help.el	Sat Sep 23 19:34:38 2006 +0000
@@ -572,7 +572,12 @@
 	   ;; 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))))
+			 (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)))))
@@ -647,7 +652,12 @@
 	    ;; and use it as the third argument.
 	    (and (vectorp key)
 		 (or (and (eventp (aref key 0))
-			  (memq 'down (event-modifiers (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)))))