Mercurial > emacs
annotate src/callint.c @ 1091:3302f6e93ce5
*** empty log message ***
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Fri, 11 Sep 1992 09:04:24 +0000 |
parents | a29670271217 |
children | eb7f1ab33a9d |
rev | line source |
---|---|
407 | 1 /* Call a Lisp function interactively. |
617 | 2 Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc. |
407 | 3 |
4 This file is part of GNU Emacs. | |
5 | |
6 GNU Emacs is free software; you can redistribute it and/or modify | |
7 it under the terms of the GNU General Public License as published by | |
8 the Free Software Foundation; either version 1, or (at your option) | |
9 any later version. | |
10 | |
11 GNU Emacs is distributed in the hope that it will be useful, | |
12 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 GNU General Public License for more details. | |
15 | |
16 You should have received a copy of the GNU General Public License | |
17 along with GNU Emacs; see the file COPYING. If not, write to | |
18 the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ | |
19 | |
20 | |
21 #include "config.h" | |
22 #include "lisp.h" | |
23 #include "buffer.h" | |
24 #include "commands.h" | |
516 | 25 #include "keyboard.h" |
407 | 26 #include "window.h" |
27 #include "mocklisp.h" | |
28 | |
29 extern char *index (); | |
30 | |
31 Lisp_Object Vprefix_arg, Vcurrent_prefix_arg, Qminus; | |
32 Lisp_Object Qcall_interactively; | |
33 Lisp_Object Vcommand_history; | |
34 | |
35 Lisp_Object Vcommand_debug_status, Qcommand_debug_status; | |
873 | 36 Lisp_Object Qenable_recursive_minibuffers; |
407 | 37 |
38 /* This comment supplies the doc string for interactive, | |
39 for make-docfile to see. We cannot put this in the real DEFUN | |
40 due to limits in the Unix cpp. | |
41 | |
42 DEFUN ("interactive", Ffoo, Sfoo, 0, 0, 0, | |
43 "Specify a way of parsing arguments for interactive use of a function.\n\ | |
44 For example, write\n\ | |
45 (defun foo (arg) \"Doc string\" (interactive \"p\") ...use arg...)\n\ | |
46 to make ARG be the prefix argument when `foo' is called as a command.\n\ | |
47 The \"call\" to `interactive' is actually a declaration rather than a function;\n\ | |
48 it tells `call-interactively' how to read arguments\n\ | |
49 to pass to the function.\n\ | |
50 When actually called, `interactive' just returns nil.\n\ | |
51 \n\ | |
52 The argument of `interactive' is usually a string containing a code letter\n\ | |
53 followed by a prompt. (Some code letters do not use I/O to get\n\ | |
54 the argument and do not need prompts.) To prompt for multiple arguments,\n\ | |
55 give a code letter, its prompt, a newline, and another code letter, etc.\n\ | |
56 Prompts are passed to format, and may use % escapes to print the\n\ | |
57 arguments that have already been read.\n\ | |
58 If the argument is not a string, it is evaluated to get a list of\n\ | |
59 arguments to pass to the function.\n\ | |
60 Just `(interactive)' means pass no args when calling interactively.\n\ | |
61 \nCode letters available are:\n\ | |
62 a -- Function name: symbol with a function definition.\n\ | |
63 b -- Name of existing buffer.\n\ | |
64 B -- Name of buffer, possibly nonexistent.\n\ | |
65 c -- Character.\n\ | |
66 C -- Command name: symbol with interactive function definition.\n\ | |
67 d -- Value of point as number. Does not do I/O.\n\ | |
68 D -- Directory name.\n\ | |
1084
a29670271217
(Fcall_interactively): For `K', use last_nonmenu_event.
Richard M. Stallman <rms@gnu.org>
parents:
873
diff
changeset
|
69 e -- Mouse click that invoked this command (value of `last-nonmenu-event').\n\ |
407 | 70 f -- Existing file name.\n\ |
71 F -- Possibly nonexistent file name.\n\ | |
72 k -- Key sequence (string).\n\ | |
1084
a29670271217
(Fcall_interactively): For `K', use last_nonmenu_event.
Richard M. Stallman <rms@gnu.org>
parents:
873
diff
changeset
|
73 K -- Mouse click that invoked this command (value of `last-nonmenu-event').\n\ |
407 | 74 m -- Value of mark as number. Does not do I/O.\n\ |
75 n -- Number read using minibuffer.\n\ | |
76 N -- Prefix arg converted to number, or if none, do like code `n'.\n\ | |
77 p -- Prefix arg converted to number. Does not do I/O.\n\ | |
78 P -- Prefix arg in raw form. Does not do I/O.\n\ | |
79 r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.\n\ | |
80 s -- Any string.\n\ | |
81 S -- Any symbol.\n\ | |
82 v -- Variable name: symbol that is user-variable-p.\n\ | |
83 x -- Lisp expression read but not evaluated.\n\ | |
84 X -- Lisp expression read and evaluated.\n\ | |
85 In addition, if the string begins with `*'\n\ | |
86 then an error is signaled if the buffer is read-only.\n\ | |
87 This happens before reading any arguments.\n\ | |
88 If the string begins with `@', then the window the mouse is over is selected\n\ | |
89 before anything else is done. You may use both `@' and `*';\n\ | |
90 they are processed in the order that they appear." | |
91 */ | |
92 | |
93 /* ARGSUSED */ | |
94 DEFUN ("interactive", Finteractive, Sinteractive, 0, UNEVALLED, 0, | |
95 0 /* See immediately above */) | |
96 (args) | |
97 Lisp_Object args; | |
98 { | |
99 return Qnil; | |
100 } | |
101 | |
102 /* Quotify EXP: if EXP is constant, return it. | |
103 If EXP is not constant, return (quote EXP). */ | |
104 Lisp_Object | |
105 quotify_arg (exp) | |
106 register Lisp_Object exp; | |
107 { | |
108 if (XTYPE (exp) != Lisp_Int && XTYPE (exp) != Lisp_String | |
485 | 109 && !NILP (exp) && !EQ (exp, Qt)) |
407 | 110 return Fcons (Qquote, Fcons (exp, Qnil)); |
111 | |
112 return exp; | |
113 } | |
114 | |
115 /* Modify EXP by quotifying each element (except the first). */ | |
116 Lisp_Object | |
117 quotify_args (exp) | |
118 Lisp_Object exp; | |
119 { | |
120 register Lisp_Object tail; | |
121 register struct Lisp_Cons *ptr; | |
122 for (tail = exp; CONSP (tail); tail = ptr->cdr) | |
123 { | |
124 ptr = XCONS (tail); | |
125 ptr->car = quotify_arg (ptr->car); | |
126 } | |
127 return exp; | |
128 } | |
129 | |
130 char *callint_argfuns[] | |
131 = {"", "point", "mark", "region-beginning", "region-end"}; | |
132 | |
133 static void | |
134 check_mark () | |
135 { | |
136 Lisp_Object tem = Fmarker_buffer (current_buffer->mark); | |
485 | 137 if (NILP (tem) || (XBUFFER (tem) != current_buffer)) |
407 | 138 error ("The mark is not set now"); |
139 } | |
140 | |
141 | |
142 DEFUN ("call-interactively", Fcall_interactively, Scall_interactively, 1, 2, 0, | |
143 "Call FUNCTION, reading args according to its interactive calling specs.\n\ | |
144 The function contains a specification of how to do the argument reading.\n\ | |
145 In the case of user-defined functions, this is specified by placing a call\n\ | |
146 to the function `interactive' at the top level of the function body.\n\ | |
147 See `interactive'.\n\ | |
148 \n\ | |
149 Optional second arg RECORD-FLAG non-nil\n\ | |
150 means unconditionally put this command in the command-history.\n\ | |
151 Otherwise, this is done only if an arg is read using the minibuffer.") | |
152 (function, record) | |
153 Lisp_Object function, record; | |
154 { | |
155 Lisp_Object *args, *visargs; | |
156 unsigned char **argstrings; | |
157 Lisp_Object fun; | |
158 Lisp_Object funcar; | |
159 Lisp_Object specs; | |
160 Lisp_Object teml; | |
873 | 161 Lisp_Object enable; |
162 int speccount = specpdl_ptr - specpdl; | |
407 | 163 |
164 Lisp_Object prefix_arg; | |
165 unsigned char *string; | |
166 unsigned char *tem; | |
438 | 167 |
168 /* If varies[i] > 0, the i'th argument shouldn't just have its value | |
169 in this call quoted in the command history. It should be | |
170 recorded as a call to the function named callint_argfuns[varies[i]]. */ | |
407 | 171 int *varies; |
438 | 172 |
407 | 173 register int i, j; |
174 int count, foo; | |
175 char prompt[100]; | |
176 char prompt1[100]; | |
177 char *tem1; | |
178 int arg_from_tty = 0; | |
179 struct gcpro gcpro1, gcpro2, gcpro3, gcpro4; | |
180 | |
732 | 181 /* Save this now, since use of minibuffer will clobber it. */ |
407 | 182 prefix_arg = Vcurrent_prefix_arg; |
183 | |
617 | 184 retry: |
407 | 185 |
873 | 186 enable = Fget (function, Qenable_recursive_minibuffers); |
187 | |
648 | 188 fun = indirect_function (function); |
407 | 189 |
190 specs = Qnil; | |
191 string = 0; | |
192 | |
193 /* Decode the kind of function. Either handle it and return, | |
194 or go to `lose' if not interactive, or go to `retry' | |
195 to specify a different function, or set either STRING or SPECS. */ | |
196 | |
197 if (XTYPE (fun) == Lisp_Subr) | |
198 { | |
199 string = (unsigned char *) XSUBR (fun)->prompt; | |
200 if (!string) | |
201 { | |
202 lose: | |
203 function = wrong_type_argument (Qcommandp, function, 0); | |
204 goto retry; | |
205 } | |
206 if ((int) string == 1) | |
207 /* Let SPECS (which is nil) be used as the args. */ | |
208 string = 0; | |
209 } | |
210 else if (XTYPE (fun) == Lisp_Compiled) | |
211 { | |
212 if (XVECTOR (fun)->size <= COMPILED_INTERACTIVE) | |
213 goto lose; | |
214 specs = XVECTOR (fun)->contents[COMPILED_INTERACTIVE]; | |
215 } | |
216 else if (!CONSP (fun)) | |
217 goto lose; | |
218 else if (funcar = Fcar (fun), EQ (funcar, Qautoload)) | |
219 { | |
220 GCPRO2 (function, prefix_arg); | |
221 do_autoload (fun, function); | |
222 UNGCPRO; | |
223 goto retry; | |
224 } | |
225 else if (EQ (funcar, Qlambda)) | |
226 { | |
227 specs = Fassq (Qinteractive, Fcdr (Fcdr (fun))); | |
485 | 228 if (NILP (specs)) |
407 | 229 goto lose; |
230 specs = Fcar (Fcdr (specs)); | |
231 } | |
232 else if (EQ (funcar, Qmocklisp)) | |
233 return ml_apply (fun, Qinteractive); | |
234 else | |
235 goto lose; | |
236 | |
617 | 237 /* If either specs or string is set to a string, use it. */ |
407 | 238 if (XTYPE (specs) == Lisp_String) |
617 | 239 { |
240 /* Make a copy of string so that if a GC relocates specs, | |
241 `string' will still be valid. */ | |
732 | 242 string = (unsigned char *) alloca (XSTRING (specs)->size + 1); |
617 | 243 bcopy (XSTRING (specs)->data, string, XSTRING (specs)->size + 1); |
244 } | |
407 | 245 else if (string == 0) |
246 { | |
247 i = num_input_chars; | |
248 specs = Feval (specs); | |
485 | 249 if (i != num_input_chars || !NILP (record)) |
407 | 250 Vcommand_history |
251 = Fcons (Fcons (function, quotify_args (Fcopy_sequence (specs))), | |
252 Vcommand_history); | |
253 return apply1 (function, specs); | |
254 } | |
255 | |
256 /* Here if function specifies a string to control parsing the defaults */ | |
257 | |
258 /* Handle special starting chars `*' and `@'. */ | |
259 while (1) | |
260 { | |
261 if (*string == '*') | |
262 { | |
263 string++; | |
485 | 264 if (!NILP (current_buffer->read_only)) |
407 | 265 Fbarf_if_buffer_read_only (); |
266 } | |
267 else if (*string == '@') | |
268 { | |
269 string++; | |
485 | 270 if (!NILP (Vmouse_window)) |
407 | 271 Fselect_window (Vmouse_window); |
272 } | |
273 else break; | |
274 } | |
275 | |
276 /* Count the number of arguments the interactive spec would have | |
277 us give to the function. */ | |
278 tem = string; | |
279 for (j = 0; *tem; j++) | |
280 { | |
281 /* 'r' specifications ("point and mark as 2 numeric args") | |
282 produce *two* arguments. */ | |
283 if (*tem == 'r') j++; | |
284 tem = (unsigned char *) index (tem, '\n'); | |
285 if (tem) | |
286 tem++; | |
287 else | |
288 tem = (unsigned char *) ""; | |
289 } | |
290 count = j; | |
291 | |
292 args = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); | |
293 visargs = (Lisp_Object *) alloca ((count + 1) * sizeof (Lisp_Object)); | |
294 argstrings = (unsigned char **) alloca ((count + 1) * sizeof (char *)); | |
295 varies = (int *) alloca ((count + 1) * sizeof (int)); | |
296 | |
297 for (i = 0; i < (count + 1); i++) | |
298 { | |
299 args[i] = Qnil; | |
300 visargs[i] = Qnil; | |
301 varies[i] = 0; | |
302 } | |
303 | |
304 GCPRO4 (prefix_arg, function, *args, *visargs); | |
305 gcpro3.nvars = (count + 1); | |
306 gcpro4.nvars = (count + 1); | |
307 | |
873 | 308 if (!NILP (enable)) |
309 specbind (Qenable_recursive_minibuffers, Qt); | |
310 | |
407 | 311 tem = string; |
617 | 312 for (i = 1; *tem; i++) |
407 | 313 { |
314 strncpy (prompt1, tem + 1, sizeof prompt1 - 1); | |
315 prompt1[sizeof prompt1 - 1] = 0; | |
316 tem1 = index (prompt1, '\n'); | |
317 if (tem1) *tem1 = 0; | |
318 /* Fill argstrings with a vector of C strings | |
319 corresponding to the Lisp strings in visargs. */ | |
320 for (j = 1; j < i; j++) | |
321 argstrings[j] | |
322 = EQ (visargs[j], Qnil) | |
323 ? (unsigned char *) "" | |
617 | 324 : XSTRING (visargs[j])->data; |
407 | 325 |
326 doprnt (prompt, sizeof prompt, prompt1, 0, j - 1, argstrings + 1); | |
327 | |
328 switch (*tem) | |
329 { | |
330 case 'a': /* Symbol defined as a function */ | |
331 visargs[i] = Fcompleting_read (build_string (prompt), | |
332 Vobarray, Qfboundp, Qt, Qnil, Qnil); | |
333 /* Passing args[i] directly stimulates compiler bug */ | |
334 teml = visargs[i]; | |
335 args[i] = Fintern (teml, Qnil); | |
336 break; | |
337 | |
338 case 'b': /* Name of existing buffer */ | |
339 args[i] = Fcurrent_buffer (); | |
340 if (EQ (selected_window, minibuf_window)) | |
341 args[i] = Fother_buffer (args[i]); | |
342 args[i] = Fread_buffer (build_string (prompt), args[i], Qt); | |
343 break; | |
344 | |
345 case 'B': /* Name of buffer, possibly nonexistent */ | |
346 args[i] = Fread_buffer (build_string (prompt), | |
347 Fother_buffer (Fcurrent_buffer ()), Qnil); | |
348 break; | |
349 | |
350 case 'c': /* Character */ | |
351 message1 (prompt); | |
352 args[i] = Fread_char (); | |
353 /* Passing args[i] directly stimulates compiler bug */ | |
354 teml = args[i]; | |
355 visargs[i] = Fchar_to_string (teml); | |
356 break; | |
357 | |
358 case 'C': /* Command: symbol with interactive function */ | |
359 visargs[i] = Fcompleting_read (build_string (prompt), | |
360 Vobarray, Qcommandp, Qt, Qnil, Qnil); | |
361 /* Passing args[i] directly stimulates compiler bug */ | |
362 teml = visargs[i]; | |
363 args[i] = Fintern (teml, Qnil); | |
364 break; | |
365 | |
366 case 'd': /* Value of point. Does not do I/O. */ | |
367 XFASTINT (args[i]) = point; | |
368 /* visargs[i] = Qnil; */ | |
369 varies[i] = 1; | |
370 break; | |
371 | |
372 case 'D': /* Directory name. */ | |
373 args[i] = Fread_file_name (build_string (prompt), Qnil, | |
374 current_buffer->directory, Qlambda, Qnil); | |
375 break; | |
376 | |
377 case 'f': /* Existing file name. */ | |
378 args[i] = Fread_file_name (build_string (prompt), | |
379 Qnil, Qnil, Qlambda, Qnil); | |
380 break; | |
381 | |
382 case 'F': /* Possibly nonexistent file name. */ | |
383 args[i] = Fread_file_name (build_string (prompt), | |
384 Qnil, Qnil, Qnil, Qnil); | |
385 break; | |
386 | |
387 case 'k': /* Key sequence (string) */ | |
438 | 388 args[i] = Fread_key_sequence (build_string (prompt), Qnil); |
407 | 389 teml = args[i]; |
390 visargs[i] = Fkey_description (teml); | |
391 break; | |
392 | |
438 | 393 case 'K': /* Mouse click. */ |
1084
a29670271217
(Fcall_interactively): For `K', use last_nonmenu_event.
Richard M. Stallman <rms@gnu.org>
parents:
873
diff
changeset
|
394 case 'e': /* New, better name. */ |
a29670271217
(Fcall_interactively): For `K', use last_nonmenu_event.
Richard M. Stallman <rms@gnu.org>
parents:
873
diff
changeset
|
395 args[i] = last_nonmenu_event; |
485 | 396 if (NILP (Fmouse_click_p (args[i]))) |
438 | 397 error ("%s must be bound to a mouse click.", |
398 (XTYPE (function) == Lisp_Symbol | |
399 ? (char *) XSYMBOL (function)->name->data | |
400 : "Command")); | |
732 | 401 varies[i] = -1; |
438 | 402 break; |
403 | |
407 | 404 case 'm': /* Value of mark. Does not do I/O. */ |
405 check_mark (); | |
406 /* visargs[i] = Qnil; */ | |
407 XFASTINT (args[i]) = marker_position (current_buffer->mark); | |
408 varies[i] = 2; | |
409 break; | |
410 | |
411 case 'N': /* Prefix arg, else number from minibuffer */ | |
485 | 412 if (!NILP (prefix_arg)) |
407 | 413 goto have_prefix_arg; |
414 case 'n': /* Read number from minibuffer. */ | |
415 do | |
416 args[i] = Fread_minibuffer (build_string (prompt), Qnil); | |
621 | 417 while (! NUMBERP (args[i])); |
407 | 418 visargs[i] = last_minibuf_string; |
419 break; | |
420 | |
421 case 'P': /* Prefix arg in raw form. Does no I/O. */ | |
422 have_prefix_arg: | |
423 args[i] = prefix_arg; | |
424 /* visargs[i] = Qnil; */ | |
425 varies[i] = -1; | |
426 break; | |
427 | |
428 case 'p': /* Prefix arg converted to number. No I/O. */ | |
429 args[i] = Fprefix_numeric_value (prefix_arg); | |
430 /* visargs[i] = Qnil; */ | |
431 varies[i] = -1; | |
432 break; | |
433 | |
434 case 'r': /* Region, point and mark as 2 args. */ | |
435 check_mark (); | |
436 /* visargs[i+1] = Qnil; */ | |
437 foo = marker_position (current_buffer->mark); | |
438 /* visargs[i] = Qnil; */ | |
439 XFASTINT (args[i]) = point < foo ? point : foo; | |
440 varies[i] = 3; | |
441 XFASTINT (args[++i]) = point > foo ? point : foo; | |
442 varies[i] = 4; | |
443 break; | |
444 | |
445 case 's': /* String read via minibuffer. */ | |
446 args[i] = Fread_string (build_string (prompt), Qnil); | |
447 break; | |
448 | |
449 case 'S': /* Any symbol. */ | |
863
427299469901
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
819
diff
changeset
|
450 visargs[i] = Fread_no_blanks_input (build_string (prompt), Qnil); |
407 | 451 /* Passing args[i] directly stimulates compiler bug */ |
452 teml = visargs[i]; | |
453 args[i] = Fintern (teml, Qnil); | |
454 break; | |
455 | |
456 case 'v': /* Variable name: symbol that is | |
457 user-variable-p. */ | |
458 args[i] = Fread_variable (build_string (prompt)); | |
459 visargs[i] = last_minibuf_string; | |
460 break; | |
461 | |
462 case 'x': /* Lisp expression read but not evaluated */ | |
463 args[i] = Fread_minibuffer (build_string (prompt), Qnil); | |
464 visargs[i] = last_minibuf_string; | |
465 break; | |
466 | |
467 case 'X': /* Lisp expression read and evaluated */ | |
468 args[i] = Feval_minibuffer (build_string (prompt), Qnil); | |
469 visargs[i] = last_minibuf_string; | |
470 break; | |
471 | |
472 default: | |
473 error ("Invalid control letter \"%c\" (%03o) in interactive calling string", | |
474 *tem, *tem); | |
475 } | |
476 | |
477 if (varies[i] == 0) | |
478 arg_from_tty = 1; | |
479 | |
485 | 480 if (NILP (visargs[i]) && XTYPE (args[i]) == Lisp_String) |
407 | 481 visargs[i] = args[i]; |
482 | |
483 tem = (unsigned char *) index (tem, '\n'); | |
484 if (tem) tem++; | |
485 else tem = (unsigned char *) ""; | |
486 } | |
873 | 487 unbind_to (speccount, Qnil); |
407 | 488 |
489 QUIT; | |
490 | |
491 args[0] = function; | |
492 | |
485 | 493 if (arg_from_tty || !NILP (record)) |
407 | 494 { |
495 visargs[0] = function; | |
438 | 496 for (i = 1; i < count + 1; i++) |
497 if (varies[i] > 0) | |
407 | 498 visargs[i] = Fcons (intern (callint_argfuns[varies[i]]), Qnil); |
499 else | |
500 visargs[i] = quotify_arg (args[i]); | |
501 Vcommand_history = Fcons (Flist (count + 1, visargs), | |
502 Vcommand_history); | |
503 } | |
504 | |
505 { | |
506 Lisp_Object val; | |
507 specbind (Qcommand_debug_status, Qnil); | |
508 | |
509 val = Ffuncall (count + 1, args); | |
510 UNGCPRO; | |
511 return unbind_to (speccount, val); | |
512 } | |
513 } | |
514 | |
515 DEFUN ("prefix-numeric-value", Fprefix_numeric_value, Sprefix_numeric_value, | |
516 1, 1, 0, | |
517 "Return numeric meaning of raw prefix argument ARG.\n\ | |
518 A raw prefix argument is what you get from `(interactive \"P\")'.\n\ | |
519 Its numeric meaning is what you would get from `(interactive \"p\")'.") | |
520 (raw) | |
521 Lisp_Object raw; | |
522 { | |
523 Lisp_Object val; | |
524 | |
525 /* Tag val as an integer, so the rest of the assignments | |
526 may use XSETINT. */ | |
527 XFASTINT (val) = 0; | |
528 | |
485 | 529 if (NILP (raw)) |
407 | 530 XFASTINT (val) = 1; |
819
5bbabfcef929
*** empty log message ***
Richard M. Stallman <rms@gnu.org>
parents:
732
diff
changeset
|
531 else if (EQ (raw, Qminus)) |
407 | 532 XSETINT (val, -1); |
533 else if (CONSP (raw)) | |
534 XSETINT (val, XINT (XCONS (raw)->car)); | |
535 else if (XTYPE (raw) == Lisp_Int) | |
536 val = raw; | |
537 else | |
538 XFASTINT (val) = 1; | |
539 | |
540 return val; | |
541 } | |
542 | |
543 syms_of_callint () | |
544 { | |
545 Qminus = intern ("-"); | |
546 staticpro (&Qminus); | |
547 | |
548 Qcall_interactively = intern ("call-interactively"); | |
549 staticpro (&Qcall_interactively); | |
550 | |
551 Qcommand_debug_status = intern ("command-debug-status"); | |
552 staticpro (&Qcommand_debug_status); | |
553 | |
873 | 554 Qenable_recursive_minibuffers = intern ("enable-recursive-minibuffers"); |
555 staticpro (&Qenable_recursive_minibuffers); | |
556 | |
407 | 557 DEFVAR_LISP ("prefix-arg", &Vprefix_arg, |
558 "The value of the prefix argument for the next editing command.\n\ | |
559 It may be a number, or the symbol `-' for just a minus sign as arg,\n\ | |
560 or a list whose car is a number for just one or more C-U's\n\ | |
561 or nil if no argument has been specified.\n\ | |
562 \n\ | |
563 You cannot examine this variable to find the argument for this command\n\ | |
564 since it has been set to nil by the time you can look.\n\ | |
565 Instead, you should use the variable `current-prefix-arg', although\n\ | |
566 normally commands can get this prefix argument with (interactive \"P\")."); | |
567 Vprefix_arg = Qnil; | |
568 | |
569 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg, | |
570 "The value of the prefix argument for this editing command.\n\ | |
571 It may be a number, or the symbol `-' for just a minus sign as arg,\n\ | |
572 or a list whose car is a number for just one or more C-U's\n\ | |
573 or nil if no argument has been specified.\n\ | |
574 This is what `(interactive \"P\")' returns."); | |
575 Vcurrent_prefix_arg = Qnil; | |
576 | |
577 DEFVAR_LISP ("command-history", &Vcommand_history, | |
578 "List of recent commands that read arguments from terminal.\n\ | |
579 Each command is represented as a form to evaluate."); | |
580 Vcommand_history = Qnil; | |
581 | |
582 DEFVAR_LISP ("command-debug-status", &Vcommand_debug_status, | |
583 "Debugging status of current interactive command.\n\ | |
584 Bound each time `call-interactively' is called;\n\ | |
585 may be set by the debugger as a reminder for itself."); | |
586 Vcommand_debug_status = Qnil; | |
587 | |
588 defsubr (&Sinteractive); | |
589 defsubr (&Scall_interactively); | |
590 defsubr (&Sprefix_numeric_value); | |
591 } |