diff options
| author | Richard M. Stallman | 2002-11-05 05:15:47 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 2002-11-05 05:15:47 +0000 |
| commit | 079e479f8076b1cd1492feb18178dc04163bb8d2 (patch) | |
| tree | fecbbdf383253c4faecb84e43e70116adb6dcff9 /src | |
| parent | 3f9ab8042bcdf0385e228bbfb7def4c9726a6638 (diff) | |
| download | emacs-079e479f8076b1cd1492feb18178dc04163bb8d2.tar.gz emacs-079e479f8076b1cd1492feb18178dc04163bb8d2.zip | |
(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.
Diffstat (limited to 'src')
| -rw-r--r-- | src/callint.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/src/callint.c b/src/callint.c index a1c28ca1b13..b1eba9fca18 100644 --- a/src/callint.c +++ b/src/callint.c | |||
| @@ -51,7 +51,7 @@ Lisp_Object Vmark_even_if_inactive; | |||
| 51 | 51 | ||
| 52 | Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; | 52 | Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook; |
| 53 | 53 | ||
| 54 | Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion; | 54 | Lisp_Object Qlist, Qlet, Qletx, Qsave_excursion, Qprogn; |
| 55 | static Lisp_Object preserved_fns; | 55 | static Lisp_Object preserved_fns; |
| 56 | 56 | ||
| 57 | /* Marker used within call-interactively to refer to point. */ | 57 | /* 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 | Lisp_Object fun; | 196 | Lisp_Object fun; |
| 197 | Lisp_Object funcar; | 197 | Lisp_Object funcar; |
| 198 | Lisp_Object specs; | 198 | Lisp_Object specs; |
| 199 | Lisp_Object filter_specs; | ||
| 199 | Lisp_Object teml; | 200 | Lisp_Object teml; |
| 200 | Lisp_Object enable; | 201 | Lisp_Object enable; |
| 201 | int speccount = SPECPDL_INDEX (); | 202 | int speccount = SPECPDL_INDEX (); |
| @@ -243,6 +244,10 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 243 | 244 | ||
| 244 | specs = Qnil; | 245 | specs = Qnil; |
| 245 | string = 0; | 246 | string = 0; |
| 247 | /* The idea of FILTER_SPECS is to provide away to | ||
| 248 | specify how to represent the arguments in command history. | ||
| 249 | The feature is not fully implemented. */ | ||
| 250 | filter_specs = Qnil; | ||
| 246 | 251 | ||
| 247 | /* Decode the kind of function. Either handle it and return, | 252 | /* Decode the kind of function. Either handle it and return, |
| 248 | or go to `lose' if not interactive, or go to `retry' | 253 | 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 | specs = Fassq (Qinteractive, Fcdr (XCDR (fun))); | 283 | specs = Fassq (Qinteractive, Fcdr (XCDR (fun))); |
| 279 | if (NILP (specs)) | 284 | if (NILP (specs)) |
| 280 | goto lose; | 285 | goto lose; |
| 286 | filter_specs = Fnth (make_number (1), specs); | ||
| 281 | specs = Fcar (Fcdr (specs)); | 287 | specs = Fcar (Fcdr (specs)); |
| 282 | } | 288 | } |
| 283 | else | 289 | else |
| @@ -298,7 +304,9 @@ supply if the command inquires which events were used to invoke it. */) | |||
| 298 | i = num_input_events; | 304 | i = num_input_events; |
| 299 | input = specs; | 305 | input = specs; |
| 300 | /* Compute the arg values using the user's expression. */ | 306 | /* Compute the arg values using the user's expression. */ |
| 307 | GCPRO2 (input, filter_specs); | ||
| 301 | specs = Feval (specs); | 308 | specs = Feval (specs); |
| 309 | UNGCPRO; | ||
| 302 | if (i != num_input_events || !NILP (record_flag)) | 310 | if (i != num_input_events || !NILP (record_flag)) |
| 303 | { | 311 | { |
| 304 | /* We should record this command on the command history. */ | 312 | /* 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 | car = XCAR (input); | 323 | car = XCAR (input); |
| 316 | /* Skip through certain special forms. */ | 324 | /* Skip through certain special forms. */ |
| 317 | while (EQ (car, Qlet) || EQ (car, Qletx) | 325 | while (EQ (car, Qlet) || EQ (car, Qletx) |
| 318 | || EQ (car, Qsave_excursion)) | 326 | || EQ (car, Qsave_excursion) |
| 327 | || EQ (car, Qprogn)) | ||
| 319 | { | 328 | { |
| 320 | while (CONSP (XCDR (input))) | 329 | while (CONSP (XCDR (input))) |
| 321 | input = XCDR (input); | 330 | input = XCDR (input); |
| @@ -836,6 +845,8 @@ syms_of_callint () | |||
| 836 | staticpro (&Qletx); | 845 | staticpro (&Qletx); |
| 837 | Qsave_excursion = intern ("save-excursion"); | 846 | Qsave_excursion = intern ("save-excursion"); |
| 838 | staticpro (&Qsave_excursion); | 847 | staticpro (&Qsave_excursion); |
| 848 | Qprogn = intern ("progn"); | ||
| 849 | staticpro (&Qprogn); | ||
| 839 | 850 | ||
| 840 | Qminus = intern ("-"); | 851 | Qminus = intern ("-"); |
| 841 | staticpro (&Qminus); | 852 | staticpro (&Qminus); |