comparison src/event-stream.c @ 367:a4f53d9b3154 r21-1-13

Import from CVS: tag r21-1-13
author cvs
date Mon, 13 Aug 2007 11:01:07 +0200
parents c9fe270a4101
children cc15677e0335
comparison
equal deleted inserted replaced
366:83d76f480a59 367:a4f53d9b3154
2508 cause it to return immediately. 2508 cause it to return immediately.
2509 2509
2510 All of these routines install timeouts, so we clear the installed 2510 All of these routines install timeouts, so we clear the installed
2511 timeout as well. 2511 timeout as well.
2512 2512
2513 Note: It's very easy to break the desired behaviours of these 2513 Note: It's very easy to break the desired behaviors of these
2514 3 routines. If you make any changes to anything in this area, run 2514 3 routines. If you make any changes to anything in this area, run
2515 the regression tests at the bottom of the file. -- dmoore */ 2515 the regression tests at the bottom of the file. -- dmoore */
2516 2516
2517 2517
2518 static Lisp_Object 2518 static Lisp_Object
3495 3495
3496 menubar_widget = FRAME_X_MENUBAR_WIDGET (f); 3496 menubar_widget = FRAME_X_MENUBAR_WIDGET (f);
3497 if (menubar_widget 3497 if (menubar_widget
3498 && CONSP (Vmenu_accelerator_modifiers)) 3498 && CONSP (Vmenu_accelerator_modifiers))
3499 { 3499 {
3500 Lisp_Object fake; 3500 Lisp_Object fake = Qnil;
3501 Lisp_Object last = Qnil; 3501 Lisp_Object last = Qnil;
3502 struct gcpro gcpro1; 3502 struct gcpro gcpro1;
3503 Lisp_Object matchp; 3503 Lisp_Object matchp;
3504 3504
3505 widget_value *val; 3505 widget_value *val;
3876 { 3876 {
3877 struct gcpro gcpro1; 3877 struct gcpro gcpro1;
3878 Lisp_Object val = Qnil; 3878 Lisp_Object val = Qnil;
3879 int nwanted; 3879 int nwanted;
3880 int start, nkeys, i, j; 3880 int start, nkeys, i, j;
3881 GCPRO1 (val);
3882 3881
3883 if (NILP (number)) 3882 if (NILP (number))
3884 nwanted = recent_keys_ring_size; 3883 nwanted = recent_keys_ring_size;
3885 else 3884 else
3886 { 3885 {
3916 nkeys = nwanted; 3915 nkeys = nwanted;
3917 } 3916 }
3918 else 3917 else
3919 nwanted = nkeys; 3918 nwanted = nkeys;
3920 3919
3920 GCPRO1 (val);
3921 val = make_vector (nwanted, Qnil); 3921 val = make_vector (nwanted, Qnil);
3922 3922
3923 for (i = 0, j = start; i < nkeys; i++) 3923 for (i = 0, j = start; i < nkeys; i++)
3924 { 3924 {
3925 Lisp_Object e = XVECTOR_DATA (Vrecent_keys_ring)[j]; 3925 Lisp_Object e = XVECTOR_DATA (Vrecent_keys_ring)[j];
3949 (size)) 3949 (size))
3950 { 3950 {
3951 Lisp_Object new_vector = Qnil; 3951 Lisp_Object new_vector = Qnil;
3952 int i, j, nkeys, start, min; 3952 int i, j, nkeys, start, min;
3953 struct gcpro gcpro1; 3953 struct gcpro gcpro1;
3954 GCPRO1 (new_vector);
3955 3954
3956 CHECK_INT (size); 3955 CHECK_INT (size);
3957 if (XINT (size) <= 0) 3956 if (XINT (size) <= 0)
3958 error ("Recent keys ring size must be positive"); 3957 error ("Recent keys ring size must be positive");
3959 if (XINT (size) == recent_keys_ring_size) 3958 if (XINT (size) == recent_keys_ring_size)
3960 return size; 3959 return size;
3961 3960
3961 GCPRO1 (new_vector);
3962 new_vector = make_vector (XINT (size), Qnil); 3962 new_vector = make_vector (XINT (size), Qnil);
3963 3963
3964 if (NILP (Vrecent_keys_ring)) 3964 if (NILP (Vrecent_keys_ring))
3965 { 3965 {
3966 Vrecent_keys_ring = new_vector; 3966 Vrecent_keys_ring = new_vector;
3967 UNGCPRO;
3967 return size; 3968 return size;
3968 } 3969 }
3969 3970
3970 if (NILP (XVECTOR_DATA (Vrecent_keys_ring)[recent_keys_ring_index])) 3971 if (NILP (XVECTOR_DATA (Vrecent_keys_ring)[recent_keys_ring_index]))
3971 /* This means the vector has not yet wrapped */ 3972 /* This means the vector has not yet wrapped */