aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRichard M. Stallman1995-10-27 21:55:33 +0000
committerRichard M. Stallman1995-10-27 21:55:33 +0000
commitd455db8e01a84d64b233aef44ae8620347ae7aac (patch)
treec784251ce7a754a21db12f14e07f71058d7b8165 /src
parentf9278a75c4241bfc9d9b7565a9dd06c1b64b118f (diff)
downloademacs-d455db8e01a84d64b233aef44ae8620347ae7aac.tar.gz
emacs-d455db8e01a84d64b233aef44ae8620347ae7aac.zip
(Fcall_interactively): New arg KEYS.
Diffstat (limited to 'src')
-rw-r--r--src/callint.c30
1 files changed, 19 insertions, 11 deletions
diff --git a/src/callint.c b/src/callint.c
index 5368ba84cf7..7519d42521d 100644
--- a/src/callint.c
+++ b/src/callint.c
@@ -164,7 +164,7 @@ check_mark ()
164} 164}
165 165
166 166
167DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 2, 0, 167DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 3, 0,
168 "Call FUNCTION, reading args according to its interactive calling specs.\n\ 168 "Call FUNCTION, reading args according to its interactive calling specs.\n\
169Return the value FUNCTION returns.\n\ 169Return the value FUNCTION returns.\n\
170The function contains a specification of how to do the argument reading.\n\ 170The function contains a specification of how to do the argument reading.\n\
@@ -175,8 +175,8 @@ See `interactive'.\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.")
178 (function, record) 178 (function, record, keys)
179 Lisp_Object function, record; 179 Lisp_Object function, record, keys;
180{ 180{
181 Lisp_Object *args, *visargs; 181 Lisp_Object *args, *visargs;
182 unsigned char **argstrings; 182 unsigned char **argstrings;
@@ -206,6 +206,15 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
206 char *tem1; 206 char *tem1;
207 int arg_from_tty = 0; 207 int arg_from_tty = 0;
208 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; 208 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4;
209 int key_count;
210
211 if (NILP (keys))
212 keys = this_command_keys, key_count = this_command_key_count;
213 else
214 {
215 CHECK_VECTOR (keys, 3);
216 key_count = XVECTOR (keys)->size;
217 }
209 218
210 /* Save this now, since use of minibuffer will clobber it. */ 219 /* Save this now, since use of minibuffer will clobber it. */
211 prefix_arg = Vcurrent_prefix_arg; 220 prefix_arg = Vcurrent_prefix_arg;
@@ -322,9 +331,8 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
322 /* Here if function specifies a string to control parsing the defaults */ 331 /* Here if function specifies a string to control parsing the defaults */
323 332
324 /* Set next_event to point to the first event with parameters. */ 333 /* Set next_event to point to the first event with parameters. */
325 for (next_event = 0; next_event < this_command_key_count; next_event++) 334 for (next_event = 0; next_event < key_count; next_event++)
326 if (EVENT_HAS_PARAMETERS 335 if (EVENT_HAS_PARAMETERS (XVECTOR (keys)->contents[next_event]))
327 (XVECTOR (this_command_keys)->contents[next_event]))
328 break; 336 break;
329 337
330 /* Handle special starting chars `*' and `@'. Also `-'. */ 338 /* Handle special starting chars `*' and `@'. Also `-'. */
@@ -346,7 +354,7 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
346 { 354 {
347 Lisp_Object event; 355 Lisp_Object event;
348 356
349 event = XVECTOR (this_command_keys)->contents[next_event]; 357 event = XVECTOR (keys)->contents[next_event];
350 if (EVENT_HAS_PARAMETERS (event) 358 if (EVENT_HAS_PARAMETERS (event)
351 && (event = XCONS (event)->cdr, CONSP (event)) 359 && (event = XCONS (event)->cdr, CONSP (event))
352 && (event = XCONS (event)->car, CONSP (event)) 360 && (event = XCONS (event)->car, CONSP (event))
@@ -509,18 +517,18 @@ Otherwise, this is done only if an arg is read using the minibuffer.")
509 break; 517 break;
510 518
511 case 'e': /* The invoking event. */ 519 case 'e': /* The invoking event. */
512 if (next_event >= this_command_key_count) 520 if (next_event >= key_count)
513 error ("%s must be bound to an event with parameters", 521 error ("%s must be bound to an event with parameters",
514 (SYMBOLP (function) 522 (SYMBOLP (function)
515 ? (char *) XSYMBOL (function)->name->data 523 ? (char *) XSYMBOL (function)->name->data
516 : "command")); 524 : "command"));
517 args[i] = XVECTOR (this_command_keys)->contents[next_event++]; 525 args[i] = XVECTOR (keys)->contents[next_event++];
518 varies[i] = -1; 526 varies[i] = -1;
519 527
520 /* Find the next parameterized event. */ 528 /* Find the next parameterized event. */
521 while (next_event < this_command_key_count 529 while (next_event < key_count
522 && ! (EVENT_HAS_PARAMETERS 530 && ! (EVENT_HAS_PARAMETERS
523 (XVECTOR (this_command_keys)->contents[next_event]))) 531 (XVECTOR (keys)->contents[next_event])))
524 next_event++; 532 next_event++;
525 533
526 break; 534 break;