aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorKarl Heuer1995-12-21 16:57:00 +0000
committerKarl Heuer1995-12-21 16:57:00 +0000
commit71eda2d573235b5b1a4a603eddbee12061a9070d (patch)
treeccacebb96aa75d225e09c200a41573116a85c10f /src
parent29ea926860f748b411725cff9a6b2640a5fe10aa (diff)
downloademacs-71eda2d573235b5b1a4a603eddbee12061a9070d.tar.gz
emacs-71eda2d573235b5b1a4a603eddbee12061a9070d.zip
(Fcall_interactively): Handle an arg of form (FCN ARGS...).
(Fcall_interactively): Move have_prefix_arg label to 'p'.
Diffstat (limited to 'src')
-rw-r--r--src/callint.c34
1 files changed, 29 insertions, 5 deletions
diff --git a/src/callint.c b/src/callint.c
index c8117d169d2..94f64c63528 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -174,13 +174,16 @@ See `interactive'.\n\
174\n\ 174\n\
175Optional second arg RECORD-FLAG non-nil\n\ 175Optional second arg RECORD-FLAG non-nil\n\
176means unconditionally put this command in the command-history.\n\ 176means unconditionally put this command in the command-history.\n\
177Otherwise, this is done only if an arg is read using the minibuffer.") 177Otherwise, this is done only if an arg is read using the minibuffer.\n\n\
178FUNCTION may be a list (FUNCTION ARGS...), which means to provide\n\
179the arguments ARGS before the ones read by FUNCTION's interactive spec.")
178 (function, record, keys) 180 (function, record, keys)
179 Lisp_Object function, record, keys; 181 Lisp_Object function, record, keys;
180{ 182{
181 Lisp_Object *args, *visargs; 183 Lisp_Object *args, *visargs;
182 unsigned char **argstrings; 184 unsigned char **argstrings;
183 Lisp_Object fun; 185 Lisp_Object fun;
186 Lisp_Object given_args;
184 Lisp_Object funcar; 187 Lisp_Object funcar;
185 Lisp_Object specs; 188 Lisp_Object specs;
186 Lisp_Object teml; 189 Lisp_Object teml;
@@ -219,6 +222,16 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
219 /* Save this now, since use of minibuffer will clobber it. */ 222 /* Save this now, since use of minibuffer will clobber it. */
220 prefix_arg = Vcurrent_prefix_arg; 223 prefix_arg = Vcurrent_prefix_arg;
221 224
225 /* Separate out any initial args specified by the caller. */
226 if (CONSP (function) && ! EQ (XCONS (function)->car, Qlambda)
227 && ! EQ (XCONS (function)->car, Qautoload))
228 {
229 given_args = XCONS (function)->cdr;
230 function = XCONS (function)->car;
231 }
232 else
233 given_args = Qnil;
234
222 retry: 235 retry:
223 236
224 if (SYMBOLP (function)) 237 if (SYMBOLP (function))
@@ -290,7 +303,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
290 i = num_input_chars; 303 i = num_input_chars;
291 input = specs; 304 input = specs;
292 /* Compute the arg values using the user's expression. */ 305 /* Compute the arg values using the user's expression. */
293 specs = Feval (specs); 306 specs = nconc2 (Fcopy_sequence (given_args), Feval (specs));
294 if (i != num_input_chars || !NILP (record)) 307 if (i != num_input_chars || !NILP (record))
295 { 308 {
296 /* We should record this command on the command history. */ 309 /* We should record this command on the command history. */
@@ -403,7 +416,8 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
403 else 416 else
404 tem = (unsigned char *) ""; 417 tem = (unsigned char *) "";
405 } 418 }
406 count = j; 419 /* Add in the number of args the caller specified. */
420 count = j + XINT (Flength (given_args));
407 421
408 args = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); 422 args = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object));
409 visargs = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); 423 visargs = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object));
@@ -417,6 +431,16 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
417 varies[i] = 0; 431 varies[i] = 0;
418 } 432 }
419 433
434 /* Put any args that the caller specified
435 into the vector. */
436 i = 1;
437 while (!NILP (given_args))
438 {
439 visargs[i] = args[i] = XCONS (given_args)->car;
440 given_args = XCONS (given_args)->cdr;
441 i++;
442 }
443
420 GCPRO4 (prefix_arg, function, *args, *visargs); 444 GCPRO4 (prefix_arg, function, *args, *visargs);
421 gcpro3.nvars = (count + 1); 445 gcpro3.nvars = (count + 1);
422 gcpro4.nvars = (count + 1); 446 gcpro4.nvars = (count + 1);
@@ -425,7 +449,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
425 specbind (Qenable_recursive_minibuffers, Qt); 449 specbind (Qenable_recursive_minibuffers, Qt);
426 450
427 tem = string; 451 tem = string;
428 for (i = 1; *tem; i++) 452 for (; *tem; i++)
429 { 453 {
430 strncpy (prompt1, tem + 1, sizeof prompt1 - 1); 454 strncpy (prompt1, tem + 1, sizeof prompt1 - 1);
431 prompt1[sizeof prompt1 - 1] = 0; 455 prompt1[sizeof prompt1 - 1] = 0;
@@ -566,13 +590,13 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
566 break; 590 break;
567 591
568 case 'P': /* Prefix arg in raw form. Does no I/O. */ 592 case 'P': /* Prefix arg in raw form. Does no I/O. */
569 have_prefix_arg:
570 args[i] = prefix_arg; 593 args[i] = prefix_arg;
571 /* visargs[i] = Qnil; */ 594 /* visargs[i] = Qnil; */
572 varies[i] = -1; 595 varies[i] = -1;
573 break; 596 break;
574 597
575 case 'p': /* Prefix arg converted to number. No I/O. */ 598 case 'p': /* Prefix arg converted to number. No I/O. */
599 have_prefix_arg:
576 args[i] = Fprefix_numeric_value (prefix_arg); 600 args[i] = Fprefix_numeric_value (prefix_arg);
577 /* visargs[i] = Qnil; */ 601 /* visargs[i] = Qnil; */
578 varies[i] = -1; 602 varies[i] = -1;