Commit 079e479f authored by Richard M. Stallman's avatar Richard M. Stallman

(Fcall_interactively): New local filter_specs.

(Fcall_interactively): Check for progn as well as let.
Add a gcpro.
(Qprogn): New variable.
(syms_of_callint): Staticpro and init Qprogn.
parent 3f9ab804
...@@ -51,7 +51,7 @@ Lisp_Object Vmark_even_if_inactive; ...@@ -51,7 +51,7 @@ Lisp_Object Vmark_even_if_inactive;
Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook;
Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion; Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn;
static Lisp_Object preserved_fns; static Lisp_Object preserved_fns;
/* Marker used within call-interactively to refer to point. */ /* Marker used within call-interactively to refer to point. */
...@@ -196,6 +196,7 @@ supply if the command inquires which events were used to invoke it. */) ...@@ -196,6 +196,7 @@ supply if the command inquires which events were used to invoke it. */)
Lisp_Object fun; Lisp_Object fun;
Lisp_Object funcar; Lisp_Object funcar;
Lisp_Object specs; Lisp_Object specs;
Lisp_Object filter_specs;
Lisp_Object teml; Lisp_Object teml;
Lisp_Object enable; Lisp_Object enable;
int speccount = SPECPDL_INDEX (); int speccount = SPECPDL_INDEX ();
...@@ -243,6 +244,10 @@ supply if the command inquires which events were used to invoke it. */) ...@@ -243,6 +244,10 @@ supply if the command inquires which events were used to invoke it. */)
specs = Qnil; specs = Qnil;
string = 0; string = 0;
/* The idea of FILTER_SPECS is to provide away to
specify how to represent the arguments in command history.
The feature is not fully implemented. */
filter_specs = Qnil;
/* Decode the kind of function. Either handle it and return, /* Decode the kind of function. Either handle it and return,
or go to `lose' if not interactive, or go to `retry' or go to `lose' if not interactive, or go to `retry'
...@@ -278,6 +283,7 @@ supply if the command inquires which events were used to invoke it. */) ...@@ -278,6 +283,7 @@ supply if the command inquires which events were used to invoke it. */)
specs = Fassq (Qinteractive, Fcdr (XCDR (fun))); specs = Fassq (Qinteractive, Fcdr (XCDR (fun)));
if (NILP (specs)) if (NILP (specs))
goto lose; goto lose;
filter_specs = Fnth (make_number (1), specs);
specs = Fcar (Fcdr (specs)); specs = Fcar (Fcdr (specs));
} }
else else
...@@ -298,7 +304,9 @@ supply if the command inquires which events were used to invoke it. */) ...@@ -298,7 +304,9 @@ supply if the command inquires which events were used to invoke it. */)
i = num_input_events; i = num_input_events;
input = specs; input = specs;
/* Compute the arg values using the user's expression. */ /* Compute the arg values using the user's expression. */
GCPRO2 (input, filter_specs);
specs = Feval (specs); specs = Feval (specs);
UNGCPRO;
if (i != num_input_events || !NILP (record_flag)) if (i != num_input_events || !NILP (record_flag))
{ {
/* We should record this command on the command history. */ /* We should record this command on the command history. */
...@@ -315,7 +323,8 @@ supply if the command inquires which events were used to invoke it. */) ...@@ -315,7 +323,8 @@ supply if the command inquires which events were used to invoke it. */)
car = XCAR (input); car = XCAR (input);
/* Skip through certain special forms. */ /* Skip through certain special forms. */
while (EQ (car, Qlet) || EQ (car, Qletx) while (EQ (car, Qlet) || EQ (car, Qletx)
|| EQ (car, Qsave_excursion)) || EQ (car, Qsave_excursion)
|| EQ (car, Qprogn))
{ {
while (CONSP (XCDR (input))) while (CONSP (XCDR (input)))
input = XCDR (input); input = XCDR (input);
...@@ -836,6 +845,8 @@ syms_of_callint () ...@@ -836,6 +845,8 @@ syms_of_callint ()
staticpro (&Qletx); staticpro (&Qletx);
Qsave_excursion = intern ("save-excursion"); Qsave_excursion = intern ("save-excursion");
staticpro (&Qsave_excursion); staticpro (&Qsave_excursion);
Qprogn = intern ("progn");
staticpro (&Qprogn);
Qminus = intern ("-"); Qminus = intern ("-");
staticpro (&Qminus); staticpro (&Qminus);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment