comparison src/callint.c @ 438:8b54ee2c82d6

*** empty log message ***
author Jim Blandy <jimb@redhat.com>
date Wed, 04 Dec 1991 03:20:22 +0000
parents a82d2d892c89
children 8c615e453683
comparison
equal deleted inserted replaced
437:be739cb3c0fc 438:8b54ee2c82d6
62 B -- Name of buffer, possibly nonexistent.\n\ 62 B -- Name of buffer, possibly nonexistent.\n\
63 c -- Character.\n\ 63 c -- Character.\n\
64 C -- Command name: symbol with interactive function definition.\n\ 64 C -- Command name: symbol with interactive function definition.\n\
65 d -- Value of point as number. Does not do I/O.\n\ 65 d -- Value of point as number. Does not do I/O.\n\
66 D -- Directory name.\n\ 66 D -- Directory name.\n\
67 e -- Last mouse event.\n\
68 f -- Existing file name.\n\ 67 f -- Existing file name.\n\
69 F -- Possibly nonexistent file name.\n\ 68 F -- Possibly nonexistent file name.\n\
70 k -- Key sequence (string).\n\ 69 k -- Key sequence (string).\n\
70 K -- Mouse click that invoked this command - last-command-char.\n\
71 m -- Value of mark as number. Does not do I/O.\n\ 71 m -- Value of mark as number. Does not do I/O.\n\
72 n -- Number read using minibuffer.\n\ 72 n -- Number read using minibuffer.\n\
73 N -- Prefix arg converted to number, or if none, do like code `n'.\n\ 73 N -- Prefix arg converted to number, or if none, do like code `n'.\n\
74 p -- Prefix arg converted to number. Does not do I/O.\n\ 74 p -- Prefix arg converted to number. Does not do I/O.\n\
75 P -- Prefix arg in raw form. Does not do I/O.\n\ 75 P -- Prefix arg in raw form. Does not do I/O.\n\
157 Lisp_Object teml; 157 Lisp_Object teml;
158 158
159 Lisp_Object prefix_arg; 159 Lisp_Object prefix_arg;
160 unsigned char *string; 160 unsigned char *string;
161 unsigned char *tem; 161 unsigned char *tem;
162
163 /* If varies[i] > 0, the i'th argument shouldn't just have its value
164 in this call quoted in the command history. It should be
165 recorded as a call to the function named callint_argfuns[varies[i]]. */
162 int *varies; 166 int *varies;
167
163 register int i, j; 168 register int i, j;
164 int count, foo; 169 int count, foo;
165 char prompt[100]; 170 char prompt[100];
166 char prompt1[100]; 171 char prompt1[100];
167 char *tem1; 172 char *tem1;
171 /* Save this now, since use ofminibuffer will clobber it. */ 176 /* Save this now, since use ofminibuffer will clobber it. */
172 prefix_arg = Vcurrent_prefix_arg; 177 prefix_arg = Vcurrent_prefix_arg;
173 178
174 retry: 179 retry:
175 180
176 fun = function; 181 for (fun = function;
177 while (XTYPE (fun) == Lisp_Symbol && !EQ (fun, Qunbound)) fun = XSYMBOL (fun)->function; 182 XTYPE (fun) == Lisp_Symbol && !EQ (fun, Qunbound);
183 fun = XSYMBOL (fun)->function)
184 ;
178 185
179 specs = Qnil; 186 specs = Qnil;
180 string = 0; 187 string = 0;
181 188
182 /* Decode the kind of function. Either handle it and return, 189 /* Decode the kind of function. Either handle it and return,
347 XFASTINT (args[i]) = point; 354 XFASTINT (args[i]) = point;
348 /* visargs[i] = Qnil; */ 355 /* visargs[i] = Qnil; */
349 varies[i] = 1; 356 varies[i] = 1;
350 break; 357 break;
351 358
352 case 'e':
353 varies[i] = 1;
354 args[i] = Vmouse_event;
355 break;
356
357 case 'D': /* Directory name. */ 359 case 'D': /* Directory name. */
358 args[i] = Fread_file_name (build_string (prompt), Qnil, 360 args[i] = Fread_file_name (build_string (prompt), Qnil,
359 current_buffer->directory, Qlambda, Qnil); 361 current_buffer->directory, Qlambda, Qnil);
360 break; 362 break;
361 363
368 args[i] = Fread_file_name (build_string (prompt), 370 args[i] = Fread_file_name (build_string (prompt),
369 Qnil, Qnil, Qnil, Qnil); 371 Qnil, Qnil, Qnil, Qnil);
370 break; 372 break;
371 373
372 case 'k': /* Key sequence (string) */ 374 case 'k': /* Key sequence (string) */
373 args[i] = Fread_key_sequence (build_string (prompt)); 375 args[i] = Fread_key_sequence (build_string (prompt), Qnil);
374 teml = args[i]; 376 teml = args[i];
375 visargs[i] = Fkey_description (teml); 377 visargs[i] = Fkey_description (teml);
378 break;
379
380 case 'K': /* Mouse click. */
381 args[i] = last_command_char;
382 if (NULL (Fmouse_click_p (args[i])))
383 error ("%s must be bound to a mouse click.",
384 (XTYPE (function) == Lisp_Symbol
385 ? (char *) XSYMBOL (function)->name->data
386 : "Command"));
376 break; 387 break;
377 388
378 case 'm': /* Value of mark. Does not do I/O. */ 389 case 'm': /* Value of mark. Does not do I/O. */
379 check_mark (); 390 check_mark ();
380 /* visargs[i] = Qnil; */ 391 /* visargs[i] = Qnil; */
472 args[0] = function; 483 args[0] = function;
473 484
474 if (arg_from_tty || !NULL (record)) 485 if (arg_from_tty || !NULL (record))
475 { 486 {
476 visargs[0] = function; 487 visargs[0] = function;
477 for (i = 1; i < count + 1; i++ if (varies[i] > 0) 488 for (i = 1; i < count + 1; i++)
489 if (varies[i] > 0)
478 visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil); 490 visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil);
479 else 491 else
480 visargs[i] = quotify_arg (args[i]); 492 visargs[i] = quotify_arg (args[i]);
481 Vcommand_history = Fcons (Flist (count + 1, visargs), 493 Vcommand_history = Fcons (Flist (count + 1, visargs),
482 Vcommand_history); 494 Vcommand_history);