changeset 1322:5f327f1dddd3

* keyboard.c (modify_event_symbol): Make sure that the unmodified event header gets the proper properties set on it, by recursing and letting the same code build the properties for all event symbols. * keyboard.c (Qmouse_click): Fix typo which assigned `mouse-click' symbol to Qmouse_movement.
author Jim Blandy <jimb@redhat.com>
date Sat, 03 Oct 1992 03:03:45 +0000
parents b56c2c450d49
children 25b5b55a3916
files src/keyboard.c
diffstat 1 files changed, 22 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/keyboard.c	Sat Oct 03 02:21:51 1992 +0000
+++ b/src/keyboard.c	Sat Oct 03 03:03:45 1992 +0000
@@ -2109,25 +2109,6 @@
 
   /* We don't have an entry for the symbol; we have to build it.   */
 
-  /* Make sure there's an assoc for the unmodified symbol.
-     Any non-empty alist should contain an entry for the unmodified symbol.  */
-  XFASTINT (temp) = 0;
-
-  if (NILP (*slot))
-    {
-      unmodified = intern (name_table [symbol_num]);
-      *slot = Fcons (Fcons (temp, unmodified), Qnil);
-      Fput (unmodified, Qevent_kind, symbol_kind);
-      Fput (unmodified, Qevent_symbol_elements, Fcons (unmodified, Qnil));
-    }
-  else
-    {
-      temp = Fassq (temp, *slot);
-      if (NILP (temp))
-	abort ();
-      unmodified = XCONS (temp)->cdr;
-    }
-
   /* Create a modified version of the symbol, and add it to the alist.  */
   {
     Lisp_Object modified;
@@ -2153,8 +2134,27 @@
 	  modifier_list = Fcons (XVECTOR (modifier_symbols)->contents[i],
 				 modifier_list);
 
-      Fput (modified, Qevent_symbol_elements,
-	    Fcons (unmodified, modifier_list));
+      /* Put an unmodified version of the symbol at the head of the 
+	 list of symbol elements.  */
+      {
+	/* We recurse to get the unmodified symbol; this allows us to
+	   write out the code to build event headers only once.
+
+	   Note that we put ourselves in the symbol_table before we
+	   recurse, so when an unmodified symbol calls this code
+	   to put itself on its Qevent_symbol_elements property, we do
+	   terminate.  */
+	Lisp_Object unmodified =
+	  modify_event_symbol (symbol_num,
+			       ((modifiers & (down_modifier | drag_modifier))
+				? click_modifier
+				: 0),
+			       symbol_kind,
+			       name_table, symbol_table, table_size);
+	
+	Fput (modified, Qevent_symbol_elements,
+	      Fcons (unmodified, modifier_list));
+      }
     }
 
     return modified;
@@ -3607,7 +3607,7 @@
 
   Qfunction_key = intern ("function-key");
   staticpro (&Qfunction_key);
-  Qmouse_movement = intern ("mouse-click");
+  Qmouse_click = intern ("mouse-click");
   staticpro (&Qmouse_click);
   Qmouse_movement = intern ("scrollbar-click");
   staticpro (&Qmouse_movement);