diff src/events.c @ 430:a5df635868b2 r21-2-23

Import from CVS: tag r21-2-23
author cvs
date Mon, 13 Aug 2007 11:29:08 +0200
parents 3ecd8885ac67
children 84b14dcb0985
line wrap: on
line diff
--- a/src/events.c	Mon Aug 13 11:28:16 2007 +0200
+++ b/src/events.c	Mon Aug 13 11:29:08 2007 +0200
@@ -763,7 +763,7 @@
 Make a copy of the given event object.
 If a second argument is given, the first event is copied into the second
 and the second is returned.  If the second argument is not supplied (or
-is nil) then a new event will be made as with `allocate-event.'  See also
+is nil) then a new event will be made as with `make-event'.  See also
 the function `deallocate-event'.
 */
        (event1, event2))
@@ -771,19 +771,26 @@
   CHECK_LIVE_EVENT (event1);
   if (NILP (event2))
     event2 = Fmake_event (Qnil, Qnil);
-  else CHECK_LIVE_EVENT (event2);
-  if (EQ (event1, event2))
-    return signal_simple_continuable_error_2
-      ("copy-event called with `eq' events", event1, event2);
+  else
+    {
+      CHECK_LIVE_EVENT (event2);
+      if (EQ (event1, event2))
+	return signal_simple_continuable_error_2
+	  ("copy-event called with `eq' events", event1, event2);
+    }
 
   assert (XEVENT_TYPE (event1) <= last_event_type);
   assert (XEVENT_TYPE (event2) <= last_event_type);
 
   {
-    Lisp_Object save_next = XEVENT_NEXT (event2);
+    Lisp_Event *ev2 = XEVENT (event2);
+    Lisp_Event *ev1 = XEVENT (event1);
 
-    *XEVENT (event2) = *XEVENT (event1);
-    XSET_EVENT_NEXT (event2, save_next);
+    ev2->event_type = ev1->event_type;
+    ev2->channel    = ev1->channel;
+    ev2->timestamp  = ev1->timestamp;
+    ev2->event      = ev1->event;
+
     return event2;
   }
 }