aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKim F. Storm2004-10-26 12:56:47 +0000
committerKim F. Storm2004-10-26 12:56:47 +0000
commit39900c4efc3e5ffe5854cbc25d8c6453e0e86142 (patch)
treeeab134209cd39b5cc5c1d96ae5f3e2e16a5118c4 /src
parent3baa952d8bd2d0ad1587440a559ae10616ea2a4e (diff)
downloademacs-39900c4efc3e5ffe5854cbc25d8c6453e0e86142.tar.gz
emacs-39900c4efc3e5ffe5854cbc25d8c6453e0e86142.zip
(Fcall_interactively): Add 'U' code to get the up-event discarded by a
previous 'k' or 'K' argument.
Diffstat (limited to 'src')
-rw-r--r--src/callint.c23
1 files changed, 19 insertions, 4 deletions
diff --git a/src/callint.c b/src/callint.c
index 8b8cb032095..da88693cd78 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -110,6 +110,7 @@ P -- Prefix arg in raw form. Does not do I/O.
110r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O. 110r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.
111s -- Any string. Does not inherit the current input method. 111s -- Any string. Does not inherit the current input method.
112S -- Any symbol. 112S -- Any symbol.
113U -- Mouse up event discarded by a previous k or K argument.
113v -- Variable name: symbol that is user-variable-p. 114v -- Variable name: symbol that is user-variable-p.
114x -- Lisp expression read but not evaluated. 115x -- Lisp expression read but not evaluated.
115X -- Lisp expression read and evaluated. 116X -- Lisp expression read and evaluated.
@@ -268,6 +269,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
268 Lisp_Object specs; 269 Lisp_Object specs;
269 Lisp_Object filter_specs; 270 Lisp_Object filter_specs;
270 Lisp_Object teml; 271 Lisp_Object teml;
272 Lisp_Object up_event;
271 Lisp_Object enable; 273 Lisp_Object enable;
272 int speccount = SPECPDL_INDEX (); 274 int speccount = SPECPDL_INDEX ();
273 275
@@ -289,7 +291,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
289 char prompt1[100]; 291 char prompt1[100];
290 char *tem1; 292 char *tem1;
291 int arg_from_tty = 0; 293 int arg_from_tty = 0;
292 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 294 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4, gcpro5;
293 int key_count; 295 int key_count;
294 int record_then_fail = 0; 296 int record_then_fail = 0;
295 297
@@ -328,6 +330,9 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
328 The feature is not fully implemented. */ 330 The feature is not fully implemented. */
329 filter_specs = Qnil; 331 filter_specs = Qnil;
330 332
333 /* If k or K discard an up-event, save it here so it can be retrieved with U */
334 up_event = Qnil;
335
331 /* Decode the kind of function. Either handle it and return, 336 /* Decode the kind of function. Either handle it and return,
332 or go to `lose' if not interactive, or go to `retry' 337 or go to `lose' if not interactive, or go to `retry'
333 to specify a different function, or set either STRING or SPECS. */ 338 to specify a different function, or set either STRING or SPECS. */
@@ -499,7 +504,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
499 varies[i] = 0; 504 varies[i] = 0;
500 } 505 }
501 506
502 GCPRO4 (prefix_arg, function, *args, *visargs); 507 GCPRO5 (prefix_arg, function, *args, *visargs, up_event);
503 gcpro3.nvars = (count + 1); 508 gcpro3.nvars = (count + 1);
504 gcpro4.nvars = (count + 1); 509 gcpro4.nvars = (count + 1);
505 510
@@ -628,7 +633,7 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
628 /* Ignore first element, which is the base key. */ 633 /* Ignore first element, which is the base key. */
629 tem2 = Fmemq (intern ("down"), Fcdr (teml)); 634 tem2 = Fmemq (intern ("down"), Fcdr (teml));
630 if (! NILP (tem2)) 635 if (! NILP (tem2))
631 Fread_event (Qnil, Qnil); 636 up_event = Fread_event (Qnil, Qnil);
632 } 637 }
633 } 638 }
634 break; 639 break;
@@ -656,11 +661,21 @@ If KEYS is omitted or nil, the return value of `this-command-keys' is used. */)
656 /* Ignore first element, which is the base key. */ 661 /* Ignore first element, which is the base key. */
657 tem2 = Fmemq (intern ("down"), Fcdr (teml)); 662 tem2 = Fmemq (intern ("down"), Fcdr (teml));
658 if (! NILP (tem2)) 663 if (! NILP (tem2))
659 Fread_event (Qnil, Qnil); 664 up_event = Fread_event (Qnil, Qnil);
660 } 665 }
661 } 666 }
662 break; 667 break;
663 668
669 case 'U': /* Up event from last k or K */
670 if (!NILP (up_event))
671 {
672 args[i] = Fmake_vector (make_number (1), up_event);
673 up_event = Qnil;
674 teml = args[i];
675 visargs[i] = Fkey_description (teml, Qnil);
676 }
677 break;
678
664 case 'e': /* The invoking event. */ 679 case 'e': /* The invoking event. */
665 if (next_event >= key_count) 680 if (next_event >= key_count)
666 error ("%s must be bound to an event with parameters", 681 error ("%s must be bound to an event with parameters",