428
|
1 /* Call a Lisp function interactively.
|
|
2 Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc.
|
|
3 Copyright (C) 1995, 1996 Ben Wing.
|
|
4
|
|
5 This file is part of XEmacs.
|
|
6
|
|
7 XEmacs is free software; you can redistribute it and/or modify it
|
|
8 under the terms of the GNU General Public License as published by the
|
|
9 Free Software Foundation; either version 2, or (at your option) any
|
|
10 later version.
|
|
11
|
|
12 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
15 for more details.
|
|
16
|
|
17 You should have received a copy of the GNU General Public License
|
|
18 along with XEmacs; see the file COPYING. If not, write to
|
|
19 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
20 Boston, MA 02111-1307, USA. */
|
|
21
|
|
22 /* Synched up with: FSF 19.30, Mule 2.0. */
|
|
23
|
|
24 /* Authorship:
|
|
25
|
|
26 FSF: long ago.
|
|
27 Mly or JWZ: various changes.
|
|
28 */
|
|
29
|
|
30 #include <config.h>
|
|
31 #include "lisp.h"
|
|
32
|
|
33 #include "buffer.h"
|
|
34 #include "bytecode.h"
|
|
35 #include "commands.h"
|
|
36 #include "events.h"
|
|
37 #include "insdel.h"
|
|
38 #include "window.h"
|
|
39
|
|
40 extern int num_input_chars;
|
|
41
|
|
42 Lisp_Object Vcurrent_prefix_arg;
|
|
43 Lisp_Object Qcall_interactively;
|
|
44 Lisp_Object Vcommand_history;
|
|
45
|
|
46 Lisp_Object Vcommand_debug_status, Qcommand_debug_status;
|
|
47 Lisp_Object Qenable_recursive_minibuffers;
|
|
48
|
|
49 #if 0 /* FSFmacs */
|
|
50 /* Non-nil means treat the mark as active
|
|
51 even if mark_active is 0. */
|
|
52 Lisp_Object Vmark_even_if_inactive;
|
|
53 #endif
|
|
54
|
|
55 #if 0 /* ill-conceived */
|
444
|
56 /* FSF calls Qmouse_leave_buffer_hook at all sorts of random places,
|
|
57 including a bunch of places in their mouse.el. If this is
|
|
58 implemented, it has to be done cleanly. */
|
428
|
59 Lisp_Object Vmouse_leave_buffer_hook, Qmouse_leave_buffer_hook;
|
|
60 #endif
|
|
61
|
442
|
62 Lisp_Object QletX, Qsave_excursion;
|
428
|
63
|
|
64 Lisp_Object Qread_from_minibuffer;
|
|
65 Lisp_Object Qread_file_name;
|
|
66 Lisp_Object Qread_directory_name;
|
|
67 Lisp_Object Qcompleting_read;
|
|
68 Lisp_Object Qread_buffer;
|
|
69 Lisp_Object Qread_function;
|
|
70 Lisp_Object Qread_variable;
|
|
71 Lisp_Object Qread_expression;
|
|
72 Lisp_Object Qread_command;
|
|
73 Lisp_Object Qread_number;
|
|
74 Lisp_Object Qread_string;
|
|
75 Lisp_Object Qevents_to_keys;
|
|
76
|
|
77 #if defined(MULE) || defined(FILE_CODING)
|
|
78 Lisp_Object Qread_coding_system;
|
|
79 Lisp_Object Qread_non_nil_coding_system;
|
|
80 #endif
|
|
81
|
|
82 /* ARGSUSED */
|
|
83 DEFUN ("interactive", Finteractive, 0, UNEVALLED, 0, /*
|
|
84 Specify a way of parsing arguments for interactive use of a function.
|
|
85 For example, write
|
|
86 (defun foo (arg) "Doc string" (interactive "p") ...use arg...)
|
|
87 to make ARG be the prefix argument when `foo' is called as a command.
|
|
88 The "call" to `interactive' is actually a declaration rather than a function;
|
|
89 it tells `call-interactively' how to read arguments
|
|
90 to pass to the function.
|
|
91 When actually called, `interactive' just returns nil.
|
|
92
|
|
93 The argument of `interactive' is usually a string containing a code letter
|
|
94 followed by a prompt. (Some code letters do not use I/O to get
|
|
95 the argument and do not need prompts.) To prompt for multiple arguments,
|
|
96 give a code letter, its prompt, a newline, and another code letter, etc.
|
|
97 Prompts are passed to format, and may use % escapes to print the
|
|
98 arguments that have already been read.
|
|
99 If the argument is not a string, it is evaluated to get a list of
|
|
100 arguments to pass to the function.
|
|
101 Just `(interactive)' means pass no args when calling interactively.
|
|
102
|
|
103 Code letters available are:
|
|
104 a -- Function name: symbol with a function definition.
|
|
105 b -- Name of existing buffer.
|
|
106 B -- Name of buffer, possibly nonexistent.
|
|
107 c -- Character.
|
|
108 C -- Command name: symbol with interactive function definition.
|
|
109 d -- Value of point as number. Does not do I/O.
|
|
110 D -- Directory name.
|
|
111 e -- Last mouse-button or misc-user event that invoked this command.
|
|
112 If used more than once, the Nth `e' returns the Nth such event.
|
|
113 Does not do I/O.
|
|
114 f -- Existing file name.
|
|
115 F -- Possibly nonexistent file name.
|
|
116 i -- Always nil, ignore. Use to skip arguments when interactive.
|
|
117 k -- Key sequence (a vector of events).
|
|
118 K -- Key sequence to be redefined (do not automatically down-case).
|
|
119 m -- Value of mark as number. Does not do I/O.
|
|
120 n -- Number read using minibuffer.
|
|
121 N -- Prefix arg converted to number, or if none, do like code `n'.
|
|
122 p -- Prefix arg converted to number. Does not do I/O.
|
|
123 P -- Prefix arg in raw form. Does not do I/O.
|
|
124 r -- Region: point and mark as 2 numeric args, smallest first. Does no I/O.
|
|
125 s -- Any string.
|
|
126 S -- Any symbol.
|
|
127 v -- Variable name: symbol that is user-variable-p.
|
|
128 x -- Lisp expression read but not evaluated.
|
|
129 X -- Lisp expression read and evaluated.
|
|
130 z -- Coding system. (Always nil if no Mule support.)
|
|
131 Z -- Coding system, nil if no prefix arg. (Always nil if no Mule support.)
|
|
132 In addition, if the string begins with `*'
|
|
133 then an error is signaled if the buffer is read-only.
|
|
134 This happens before reading any arguments.
|
|
135 If the string begins with `@', then the window the mouse is over is selected
|
|
136 before anything else is done.
|
|
137 If the string begins with `_', then this command will not cause the region
|
|
138 to be deactivated when it completes; that is, `zmacs-region-stays' will be
|
|
139 set to t when the command exits successfully.
|
|
140 You may use any of `@', `*' and `_' at the beginning of the string;
|
|
141 they are processed in the order that they appear.
|
502
|
142
|
|
143
|
|
144 When writing your own interactive spec, it can be useful to know the
|
|
145 equivalent Lisp expressions for the various code letters. They are:
|
|
146
|
|
147 a -- (read-function "PROMPT")
|
|
148 b -- (let ((def (current-buffer)))
|
|
149 (if (eq (selected-window) (active-minibuffer-window))
|
|
150 (setq def (other-buffer def))
|
|
151 (read-buffer "PROMPT" def t)))
|
|
152 B -- (read-buffer "PROMPT" (other-buffer (current-buffer)))
|
|
153 c -- (prog1
|
|
154 (let ((cursor-in-echo-area t))
|
|
155 (message "%s" "PROMPT")
|
|
156 (read-char))
|
|
157 (message nil))
|
|
158 C -- (read-command "PROMPT")
|
|
159 d -- (point)
|
|
160 D -- (read-directory-name "PROMPT" nil default-directory t)
|
|
161 e -- current-mouse-event ;; #### not quite right. needs access to the KEYS
|
|
162 ;; argument of `call-interactively', but that's
|
|
163 ;; currently impossible.
|
|
164 f -- (read-file-name "PROMPT" nil nil 0)
|
|
165 F -- (read-file-name "PROMPT")
|
|
166 i -- nil
|
|
167 k -- (read-key-sequence "PROMPT")
|
|
168 K -- (read-key-sequence "PROMPT" nil t)
|
|
169 m -- (mark)
|
|
170 n -- (read-number "PROMPT")
|
|
171 N -- (if current-prefix-arg
|
|
172 (prefix-numeric-value current-prefix-arg)
|
|
173 (read-number "PROMPT"))
|
|
174 p -- (prefix-numeric-value current-prefix-arg)
|
|
175 P -- current-prefix-arg
|
|
176 r -- (if (and zmacs-regions (not zmacs-region-active-p))
|
|
177 (error "The region is not active now"))
|
|
178 (let ((tem (marker-buffer (mark-marker t))))
|
|
179 (unless (and tem (eq tem (current-buffer)))
|
|
180 (error "The mark is now set now")))
|
|
181 (region-beginning) +
|
|
182 (region-end)
|
|
183 s -- (read-string "PROMPT")
|
|
184 S -- (let (tem prev-tem)
|
|
185 (while (not tem)
|
|
186 (setq tem (completing-read "PROMPT" obarray nil nil prev-tem))
|
|
187 (setq prev-tem tem)
|
|
188 (setq tem (intern tem))
|
|
189 (if (= (length tem) 0)
|
|
190 (setq tem nil))))
|
|
191 v -- (read-variable "PROMPT")
|
|
192 x -- (read-expression "PROMPT")
|
|
193 X -- (eval (read-expression "PROMPT"))
|
|
194 z -- (and (fboundp 'read-coding-system) (read-coding-system "PROMPT"))
|
|
195 Z -- (and current-prefix-arg (fboundp 'read-coding-system)
|
|
196 (read-coding-system "PROMPT"))
|
|
197
|
|
198 `*' (barf-if-buffer-read-only)
|
|
199 `@' (let ((event current-mouse-event)) ;; #### not quite right; needs the
|
|
200 (when event ;; value from the `e' spec above.
|
|
201 (let ((window event-window event))
|
|
202 (when window
|
|
203 (if (and (window-minibuffer-p window)
|
|
204 (not (and (> (minibuffer-depth) 0)
|
|
205 (eq window (active-minibuffer-window)))))
|
|
206 (error "Attempt to select inactive minibuffer window"))
|
|
207 (select window)))))
|
|
208 `_' (setq zmacs-region-stays t)
|
|
209
|
428
|
210 */
|
|
211 (args))
|
|
212 {
|
|
213 return Qnil;
|
|
214 }
|
|
215
|
|
216 /* Originally, this was just a function -- but `custom' used a
|
|
217 garden-variety version, so why not make it a subr? */
|
|
218 /* #### Move it to another file! */
|
|
219 DEFUN ("quote-maybe", Fquote_maybe, 1, 1, 0, /*
|
|
220 Quote EXPR if it is not self quoting.
|
|
221 */
|
|
222 (expr))
|
|
223 {
|
|
224 return ((NILP (expr)
|
|
225 || EQ (expr, Qt)
|
|
226 || INTP (expr)
|
|
227 || FLOATP (expr)
|
|
228 || CHARP (expr)
|
|
229 || STRINGP (expr)
|
|
230 || VECTORP (expr)
|
|
231 || KEYWORDP (expr)
|
|
232 || BIT_VECTORP (expr)
|
|
233 || (CONSP (expr) && EQ (XCAR (expr), Qlambda)))
|
|
234 ? expr : list2 (Qquote, expr));
|
|
235 }
|
|
236
|
|
237 /* Modify EXPR by quotifying each element (except the first). */
|
|
238 static Lisp_Object
|
|
239 quotify_args (Lisp_Object expr)
|
|
240 {
|
440
|
241 Lisp_Object tail;
|
|
242 Lisp_Cons *ptr;
|
428
|
243 for (tail = expr; CONSP (tail); tail = ptr->cdr)
|
|
244 {
|
|
245 ptr = XCONS (tail);
|
|
246 ptr->car = Fquote_maybe (ptr->car);
|
|
247 }
|
|
248 return expr;
|
|
249 }
|
|
250
|
|
251 static Bufpos
|
|
252 check_mark (void)
|
|
253 {
|
|
254 Lisp_Object tem;
|
|
255
|
|
256 if (zmacs_regions && !zmacs_region_active_p)
|
563
|
257 invalid_operation ("The region is not active now", Qunbound);
|
428
|
258
|
|
259 tem = Fmarker_buffer (current_buffer->mark);
|
|
260 if (NILP (tem) || (XBUFFER (tem) != current_buffer))
|
563
|
261 invalid_operation ("The mark is not set now", Qunbound);
|
428
|
262
|
|
263 return marker_position (current_buffer->mark);
|
|
264 }
|
|
265
|
|
266 static Lisp_Object
|
442
|
267 callint_prompt (const Bufbyte *prompt_start, Bytecount prompt_length,
|
|
268 const Lisp_Object *args, int nargs)
|
428
|
269 {
|
|
270 Lisp_Object s = make_string (prompt_start, prompt_length);
|
|
271 struct gcpro gcpro1;
|
|
272
|
|
273 /* Fformat no longer smashes its arg vector, so no need to copy it. */
|
|
274
|
|
275 if (!strchr ((char *) XSTRING_DATA (s), '%'))
|
|
276 return s;
|
|
277 GCPRO1 (s);
|
|
278 RETURN_UNGCPRO (emacs_doprnt_string_lisp (0, s, 0, nargs, args));
|
|
279 }
|
|
280
|
|
281 /* `lambda' for RECORD-FLAG is an XEmacs addition. */
|
|
282
|
|
283 DEFUN ("call-interactively", Fcall_interactively, 1, 3, 0, /*
|
|
284 Call FUNCTION, reading args according to its interactive calling specs.
|
|
285 Return the value FUNCTION returns.
|
|
286 The function contains a specification of how to do the argument reading.
|
|
287 In the case of user-defined functions, this is specified by placing a call
|
|
288 to the function `interactive' at the top level of the function body.
|
|
289 See `interactive'.
|
|
290
|
|
291 If optional second arg RECORD-FLAG is the symbol `lambda', the interactive
|
|
292 calling arguments for FUNCTION are read and returned as a list,
|
|
293 but the function is not called on them.
|
|
294
|
|
295 If RECORD-FLAG is `t' then unconditionally put this command in the
|
|
296 command-history. Otherwise, this is done only if an arg is read using
|
|
297 the minibuffer.
|
|
298
|
|
299 The argument KEYS specifies the value to use instead of (this-command-keys)
|
|
300 when reading the arguments.
|
|
301 */
|
|
302 (function, record_flag, keys))
|
|
303 {
|
|
304 /* This function can GC */
|
|
305 int speccount = specpdl_depth ();
|
|
306 Lisp_Object prefix;
|
|
307
|
|
308 Lisp_Object fun;
|
|
309 Lisp_Object specs = Qnil;
|
|
310 #ifdef IT_SEEMS_THAT_MLY_DOESNT_LIKE_THIS
|
|
311 Lisp_Object enable;
|
|
312 #endif
|
|
313 /* If SPECS is a string, we reset prompt_data to string_data
|
|
314 * (XSTRING (specs)) every time a GC might have occurred */
|
442
|
315 const char *prompt_data = 0;
|
428
|
316 int prompt_index = 0;
|
|
317 int argcount;
|
|
318 int set_zmacs_region_stays = 0;
|
|
319 int mouse_event_count = 0;
|
|
320
|
|
321 if (!NILP (keys))
|
|
322 {
|
|
323 int i, len;
|
|
324
|
|
325 CHECK_VECTOR (keys);
|
|
326 len = XVECTOR_LENGTH (keys);
|
|
327 for (i = 0; i < len; i++)
|
|
328 CHECK_LIVE_EVENT (XVECTOR_DATA (keys)[i]);
|
|
329 }
|
|
330
|
|
331 /* Save this now, since use of minibuffer will clobber it. */
|
|
332 prefix = Vcurrent_prefix_arg;
|
|
333
|
|
334 retry:
|
|
335
|
|
336 #ifdef IT_SEEMS_THAT_MLY_DOESNT_LIKE_THIS
|
|
337 /* Marginal kludge. Use an evaluated interactive spec instead of this! */
|
|
338 if (SYMBOLP (function))
|
|
339 enable = Fget (function, Qenable_recursive_minibuffers, Qnil);
|
|
340 #endif
|
|
341
|
|
342 fun = indirect_function (function, 1);
|
|
343
|
|
344 /* Decode the kind of function. Either handle it and return,
|
|
345 or go to `lose' if not interactive, or go to `retry'
|
|
346 to specify a different function, or set either PROMPT_DATA or SPECS. */
|
|
347
|
|
348 if (SUBRP (fun))
|
|
349 {
|
|
350 prompt_data = XSUBR (fun)->prompt;
|
|
351 if (!prompt_data)
|
|
352 {
|
|
353 lose:
|
|
354 function = wrong_type_argument (Qcommandp, function);
|
|
355 goto retry;
|
|
356 }
|
|
357 #if 0 /* FSFmacs */ /* Huh? Where is this used? */
|
|
358 if ((EMACS_INT) prompt_data == 1)
|
|
359 /* Let SPECS (which is nil) be used as the args. */
|
|
360 prompt_data = 0;
|
|
361 #endif
|
|
362 }
|
|
363 else if (COMPILED_FUNCTIONP (fun))
|
|
364 {
|
|
365 Lisp_Compiled_Function *f = XCOMPILED_FUNCTION (fun);
|
|
366 if (! f->flags.interactivep)
|
|
367 goto lose;
|
|
368 specs = compiled_function_interactive (f);
|
|
369 }
|
|
370 else if (!CONSP (fun))
|
|
371 goto lose;
|
|
372 else
|
|
373 {
|
|
374 Lisp_Object funcar = Fcar (fun);
|
|
375
|
|
376 if (EQ (funcar, Qautoload))
|
|
377 {
|
|
378 struct gcpro gcpro1, gcpro2;
|
|
379 GCPRO2 (function, prefix);
|
|
380 do_autoload (fun, function);
|
|
381 UNGCPRO;
|
|
382 goto retry;
|
|
383 }
|
|
384 else if (EQ (funcar, Qlambda))
|
|
385 {
|
|
386 specs = Fassq (Qinteractive, Fcdr (Fcdr (fun)));
|
|
387 if (NILP (specs))
|
|
388 goto lose;
|
|
389 specs = Fcar (Fcdr (specs));
|
|
390 }
|
|
391 else
|
|
392 goto lose;
|
|
393 }
|
|
394
|
|
395 /* FSFmacs makes an alloca() copy of prompt_data here.
|
|
396 We're more intelligent about this and just reset prompt_data
|
|
397 as necessary. */
|
|
398 /* If either specs or prompt_data is set to a string, use it. */
|
|
399 if (!STRINGP (specs) && prompt_data == 0)
|
|
400 {
|
|
401 struct gcpro gcpro1, gcpro2, gcpro3;
|
|
402 int i = num_input_chars;
|
|
403 Lisp_Object input = specs;
|
|
404
|
|
405 GCPRO3 (function, specs, input);
|
|
406 /* Compute the arg values using the user's expression. */
|
|
407 specs = Feval (specs);
|
|
408 if (EQ (record_flag, Qlambda)) /* XEmacs addition */
|
|
409 {
|
|
410 UNGCPRO;
|
|
411 return specs;
|
|
412 }
|
|
413 if (!NILP (record_flag) || i != num_input_chars)
|
|
414 {
|
|
415 /* We should record this command on the command history. */
|
|
416 /* #### The following is too specific; should have general
|
|
417 mechanism for doing this. */
|
|
418 Lisp_Object values, car;
|
|
419 /* Make a copy of the list of values, for the command history,
|
|
420 and turn them into things we can eval. */
|
|
421 values = quotify_args (Fcopy_sequence (specs));
|
|
422 /* If the list of args was produced with an explicit call to `list',
|
|
423 look for elements that were computed with (region-beginning)
|
|
424 or (region-end), and put those expressions into VALUES
|
|
425 instead of the present values. */
|
|
426 if (CONSP (input))
|
|
427 {
|
|
428 car = XCAR (input);
|
|
429 /* Skip through certain special forms. */
|
|
430 while (EQ (car, Qlet) || EQ (car, QletX)
|
|
431 || EQ (car, Qsave_excursion))
|
|
432 {
|
|
433 while (CONSP (XCDR (input)))
|
|
434 input = XCDR (input);
|
|
435 input = XCAR (input);
|
|
436 if (!CONSP (input))
|
|
437 break;
|
|
438 car = XCAR (input);
|
|
439 }
|
|
440 if (EQ (car, Qlist))
|
|
441 {
|
|
442 Lisp_Object intail, valtail;
|
|
443 for (intail = Fcdr (input), valtail = values;
|
|
444 CONSP (valtail);
|
|
445 intail = Fcdr (intail), valtail = Fcdr (valtail))
|
|
446 {
|
|
447 Lisp_Object elt;
|
|
448 elt = Fcar (intail);
|
|
449 if (CONSP (elt))
|
|
450 {
|
|
451 Lisp_Object eltcar = Fcar (elt);
|
|
452 if (EQ (eltcar, Qpoint) ||
|
|
453 EQ (eltcar, Qmark) ||
|
|
454 EQ (eltcar, Qregion_beginning) ||
|
|
455 EQ (eltcar, Qregion_end))
|
|
456 Fsetcar (valtail, Fcar (intail));
|
|
457 }
|
|
458 }
|
|
459 }
|
|
460 }
|
|
461 Vcommand_history
|
|
462 = Fcons (Fcons (function, values), Vcommand_history);
|
|
463 }
|
|
464 single_console_state ();
|
|
465 RETURN_UNGCPRO (apply1 (fun, specs));
|
|
466 }
|
|
467
|
|
468 /* Here if function specifies a string to control parsing the defaults */
|
|
469
|
|
470 #ifdef I18N3
|
|
471 /* Translate interactive prompt. */
|
|
472 if (STRINGP (specs))
|
|
473 {
|
|
474 Lisp_Object domain = Qnil;
|
|
475 if (COMPILED_FUNCTIONP (fun))
|
|
476 domain = compiled_function_domain (XCOMPILED_FUNCTION (fun));
|
|
477 if (NILP (domain))
|
|
478 specs = Fgettext (specs);
|
|
479 else
|
|
480 specs = Fdgettext (domain, specs);
|
|
481 }
|
|
482 else if (prompt_data)
|
|
483 /* We do not have to worry about domains in this case because
|
|
484 prompt_data is non-nil only for built-in functions, which
|
|
485 always use the default domain. */
|
|
486 prompt_data = gettext (prompt_data);
|
|
487 #endif
|
|
488
|
|
489 /* Handle special starting chars `*' and `@' and `_'. */
|
|
490 /* Note that `+' is reserved for user extensions. */
|
|
491 prompt_index = 0;
|
|
492 {
|
|
493 struct gcpro gcpro1, gcpro2;
|
|
494 GCPRO2 (function, specs);
|
|
495
|
|
496 for (;;)
|
|
497 {
|
|
498 if (STRINGP (specs))
|
442
|
499 prompt_data = (const char *) XSTRING_DATA (specs);
|
428
|
500
|
|
501 if (prompt_data[prompt_index] == '+')
|
563
|
502 syntax_error ("`+' is not used in `interactive' for ordinary commands", Qunbound);
|
428
|
503 else if (prompt_data[prompt_index] == '*')
|
|
504 {
|
|
505 prompt_index++;
|
|
506 if (!NILP (current_buffer->read_only))
|
|
507 barf_if_buffer_read_only (current_buffer, -1, -1);
|
|
508 }
|
|
509 else if (prompt_data[prompt_index] == '@')
|
|
510 {
|
|
511 Lisp_Object event;
|
|
512 prompt_index++;
|
|
513
|
|
514 if (!NILP (keys))
|
|
515 event = extract_vector_nth_mouse_event (keys, 0);
|
|
516 else
|
|
517 #if 0
|
|
518 event = extract_this_command_keys_nth_mouse_event (0);
|
|
519 #else
|
|
520 /* Doesn't work; see below */
|
|
521 event = Vcurrent_mouse_event;
|
|
522 #endif
|
|
523 if (! NILP (event))
|
|
524 {
|
|
525 Lisp_Object window = Fevent_window (event);
|
|
526 if (!NILP (window))
|
|
527 {
|
|
528 if (MINI_WINDOW_P (XWINDOW (window))
|
|
529 && ! (minibuf_level > 0 && EQ (window,
|
|
530 minibuf_window)))
|
563
|
531 invalid_operation ("Attempt to select inactive minibuffer window", Qunbound);
|
428
|
532
|
|
533 #if 0 /* unclean! see event-stream.c */
|
|
534 /* If the current buffer wants to clean up, let it. */
|
|
535 if (!NILP (Vmouse_leave_buffer_hook))
|
|
536 run_hook (Qmouse_leave_buffer_hook);
|
|
537 #endif
|
|
538
|
|
539 Fselect_window (window, Qnil);
|
|
540 }
|
|
541 }
|
|
542 }
|
|
543 else if (prompt_data[prompt_index] == '_')
|
|
544 {
|
|
545 prompt_index++;
|
|
546 set_zmacs_region_stays = 1;
|
|
547 }
|
|
548 else
|
|
549 {
|
|
550 UNGCPRO;
|
|
551 break;
|
|
552 }
|
|
553 }
|
|
554 }
|
|
555
|
|
556 /* Count the number of arguments the interactive spec would have
|
|
557 us give to the function. */
|
|
558 argcount = 0;
|
|
559 {
|
442
|
560 const char *tem;
|
428
|
561 for (tem = prompt_data + prompt_index; *tem; )
|
|
562 {
|
|
563 /* 'r' specifications ("point and mark as 2 numeric args")
|
|
564 produce *two* arguments. */
|
|
565 if (*tem == 'r')
|
|
566 argcount += 2;
|
|
567 else
|
|
568 argcount += 1;
|
442
|
569 tem = (const char *) strchr (tem + 1, '\n');
|
428
|
570 if (!tem)
|
|
571 break;
|
|
572 tem++;
|
|
573 }
|
|
574 }
|
|
575
|
|
576 #ifdef IT_SEEMS_THAT_MLY_DOESNT_LIKE_THIS
|
|
577 if (!NILP (enable))
|
|
578 specbind (Qenable_recursive_minibuffers, Qt);
|
|
579 #endif
|
|
580
|
|
581 if (argcount == 0)
|
|
582 {
|
|
583 /* Interactive function or no arguments; just call it */
|
|
584 if (EQ (record_flag, Qlambda))
|
|
585 return Qnil;
|
|
586 if (!NILP (record_flag))
|
|
587 {
|
|
588 Vcommand_history = Fcons (list1 (function), Vcommand_history);
|
|
589 }
|
|
590 specbind (Qcommand_debug_status, Qnil);
|
|
591 /* XEmacs: was fun = call0 (fun), but that's backtraced wrong */
|
|
592 {
|
|
593 struct gcpro gcpro1;
|
|
594
|
|
595 GCPRO1 (fun);
|
|
596 fun = Ffuncall (1, &fun);
|
|
597 UNGCPRO;
|
|
598 }
|
|
599 if (set_zmacs_region_stays)
|
|
600 zmacs_region_stays = 1;
|
|
601 return unbind_to (speccount, fun);
|
|
602 }
|
|
603
|
|
604 /* Read interactive arguments */
|
|
605 {
|
|
606 /* args[-1] is the function to call */
|
|
607 /* args[n] is the n'th argument to the function */
|
|
608 int alloca_size = (1 /* function to call */
|
|
609 + argcount /* actual arguments */
|
|
610 + argcount /* visargs */
|
|
611 + argcount /* varies */
|
|
612 );
|
|
613 Lisp_Object *args = alloca_array (Lisp_Object, alloca_size) + 1;
|
|
614 /* visargs is an array of either Qnil or user-friendlier versions (often
|
|
615 * strings) of previous arguments, to use in prompts for successive
|
|
616 * arguments. ("Often strings" because emacs didn't used to have
|
|
617 * format %S and prin1-to-string.) */
|
|
618 Lisp_Object *visargs = args + argcount;
|
|
619 /* If varies[i] is non-null, the i'th argument shouldn't just have
|
|
620 its value in this call quoted in the command history. It should be
|
|
621 recorded as a call to the function named varies[i]]. */
|
|
622 Lisp_Object *varies = visargs + argcount;
|
|
623 int arg_from_tty = 0;
|
|
624 REGISTER int argnum;
|
|
625 struct gcpro gcpro1, gcpro2;
|
|
626
|
|
627 args[-1] = function;
|
|
628 for (argnum = 0; argnum < alloca_size - 1; argnum++)
|
|
629 args[argnum] = Qnil;
|
|
630
|
|
631 /* Must GC-protect args[-1] (ie function) because Ffuncall doesn't */
|
|
632 /* `function' itself isn't GC-protected -- use args[-1] from here
|
|
633 (actually, doesn't matter since Emacs GC doesn't relocate, sigh) */
|
|
634 GCPRO2 (prefix, args[-1]);
|
|
635 gcpro2.nvars = alloca_size;
|
|
636
|
|
637 for (argnum = 0; ; argnum++)
|
|
638 {
|
442
|
639 const char *prompt_start = prompt_data + prompt_index + 1;
|
|
640 const char *prompt_limit = (const char *) strchr (prompt_start, '\n');
|
428
|
641 int prompt_length;
|
|
642 prompt_length = ((prompt_limit)
|
|
643 ? (prompt_limit - prompt_start)
|
|
644 : strlen (prompt_start));
|
|
645 if (prompt_limit && prompt_limit[1] == 0)
|
|
646 {
|
|
647 prompt_limit = 0; /* "sfoo:\n" -- strip tailing return */
|
|
648 prompt_length -= 1;
|
|
649 }
|
|
650 /* This uses `visargs' instead of `args' so that global-set-key
|
|
651 prompts with "Set key C-x C-f to command: "instead of printing
|
|
652 event objects in there.
|
|
653 */
|
442
|
654 #define PROMPT() callint_prompt ((const Bufbyte *) prompt_start, prompt_length, visargs, argnum)
|
428
|
655 switch (prompt_data[prompt_index])
|
|
656 {
|
|
657 case 'a': /* Symbol defined as a function */
|
|
658 {
|
|
659 Lisp_Object tem = call1 (Qread_function, PROMPT ());
|
|
660 args[argnum] = tem;
|
|
661 arg_from_tty = 1;
|
|
662 break;
|
|
663 }
|
|
664 case 'b': /* Name of existing buffer */
|
|
665 {
|
|
666 Lisp_Object def = Fcurrent_buffer ();
|
|
667 if (EQ (Fselected_window (Qnil), minibuf_window))
|
|
668 def = Fother_buffer (def, Qnil, Qnil);
|
|
669 /* read-buffer returns a buffer name, not a buffer! */
|
|
670 args[argnum] = call3 (Qread_buffer, PROMPT (), def,
|
|
671 Qt);
|
|
672 arg_from_tty = 1;
|
|
673 break;
|
|
674 }
|
|
675 case 'B': /* Name of buffer, possibly nonexistent */
|
|
676 {
|
|
677 /* read-buffer returns a buffer name, not a buffer! */
|
|
678 args[argnum] = call2 (Qread_buffer, PROMPT (),
|
|
679 Fother_buffer (Fcurrent_buffer (), Qnil,
|
|
680 Qnil));
|
|
681 arg_from_tty = 1;
|
|
682 break;
|
|
683 }
|
|
684 case 'c': /* Character */
|
|
685 {
|
|
686 Lisp_Object tem;
|
|
687 int shadowing_speccount = specpdl_depth ();
|
|
688
|
|
689 specbind (Qcursor_in_echo_area, Qt);
|
|
690 message ("%s", XSTRING_DATA (PROMPT ()));
|
|
691 tem = (call0 (Qread_char));
|
|
692 args[argnum] = tem;
|
|
693 /* visargs[argnum] = Fsingle_key_description (tem); */
|
|
694 /* FSF has visargs[argnum] = Fchar_to_string (tem); */
|
|
695
|
|
696 unbind_to (shadowing_speccount, Qnil);
|
|
697
|
|
698 /* #### `C-x / a' should not leave the prompt in the minibuffer.
|
|
699 This isn't the right fix, because (message ...) (read-char)
|
|
700 shouldn't leave the message there either... */
|
|
701 clear_message ();
|
|
702
|
|
703 arg_from_tty = 1;
|
|
704 break;
|
|
705 }
|
|
706 case 'C': /* Command: symbol with interactive function */
|
|
707 {
|
|
708 Lisp_Object tem = call1 (Qread_command, PROMPT ());
|
|
709 args[argnum] = tem;
|
|
710 arg_from_tty = 1;
|
|
711 break;
|
|
712 }
|
|
713 case 'd': /* Value of point. Does not do I/O. */
|
|
714 {
|
|
715 args[argnum] = Fcopy_marker (current_buffer->point_marker, Qt);
|
|
716 varies[argnum] = Qpoint;
|
|
717 break;
|
|
718 }
|
|
719 case 'e':
|
|
720 {
|
|
721 Lisp_Object event;
|
|
722
|
|
723 if (!NILP (keys))
|
|
724 event = extract_vector_nth_mouse_event (keys,
|
|
725 mouse_event_count);
|
|
726 else
|
|
727 #if 0
|
|
728 /* This doesn't quite work because this-command-keys
|
|
729 behaves in utterly counterintuitive ways. Sometimes
|
|
730 it retrieves an event back in the future, e.g. when
|
|
731 one command invokes another command and both are
|
|
732 invoked with the mouse. */
|
|
733 event = (extract_this_command_keys_nth_mouse_event
|
|
734 (mouse_event_count));
|
|
735 #else
|
|
736 event = Vcurrent_mouse_event;
|
|
737 #endif
|
|
738
|
|
739 if (NILP (event))
|
563
|
740 signal_error (Qinvalid_operation,
|
|
741 "function must be bound to a mouse or misc-user event",
|
|
742 function);
|
428
|
743 args[argnum] = event;
|
|
744 mouse_event_count++;
|
|
745 break;
|
|
746 }
|
|
747 case 'D': /* Directory name. */
|
|
748 {
|
|
749 args[argnum] = call4 (Qread_directory_name, PROMPT (),
|
|
750 Qnil, /* dir */
|
|
751 current_buffer->directory, /* default */
|
|
752 Qt /* must-match */
|
|
753 );
|
|
754 arg_from_tty = 1;
|
|
755 break;
|
|
756 }
|
|
757 case 'f': /* Existing file name. */
|
|
758 {
|
|
759 Lisp_Object tem = call4 (Qread_file_name, PROMPT (),
|
|
760 Qnil, /* dir */
|
|
761 Qnil, /* default */
|
|
762 Qzero /* must-match */
|
|
763 );
|
|
764 args[argnum] = tem;
|
|
765 arg_from_tty = 1;
|
|
766 break;
|
|
767 }
|
|
768 case 'F': /* Possibly nonexistent file name. */
|
|
769 {
|
|
770 args[argnum] = call4 (Qread_file_name, PROMPT (),
|
|
771 Qnil, /* dir */
|
|
772 Qnil, /* default */
|
|
773 Qnil /* must-match */
|
|
774 );
|
|
775 arg_from_tty = 1;
|
|
776 break;
|
|
777 }
|
|
778 case 'i': /* Ignore: always nil. Use to skip arguments. */
|
|
779 {
|
|
780 args[argnum] = Qnil;
|
|
781 break;
|
|
782 }
|
|
783 case 'k': /* Key sequence (vector of events) */
|
|
784 {
|
|
785 struct gcpro ngcpro1;
|
|
786 Lisp_Object tem;
|
|
787 Lisp_Object key_prompt = PROMPT ();
|
|
788
|
|
789 NGCPRO1(key_prompt);
|
|
790 tem = Fread_key_sequence (key_prompt, Qnil, Qnil);
|
|
791 NUNGCPRO;
|
|
792
|
|
793 visargs[argnum] = Fkey_description (tem);
|
|
794 /* The following makes `describe-key' not work with
|
|
795 extent-local keymaps and such; and anyway, it's
|
|
796 contrary to the documentation. */
|
|
797 /* args[argnum] = call1 (Qevents_to_keys, tem); */
|
|
798 args[argnum] = tem;
|
|
799 arg_from_tty = 1;
|
|
800 break;
|
|
801 }
|
|
802 case 'K': /* Key sequence (vector of events),
|
|
803 no automatic downcasing */
|
|
804 {
|
|
805 struct gcpro ngcpro1;
|
|
806 Lisp_Object tem;
|
|
807 Lisp_Object key_prompt = PROMPT ();
|
|
808
|
|
809 NGCPRO1(key_prompt);
|
|
810 tem = Fread_key_sequence (key_prompt, Qnil, Qt);
|
|
811 NUNGCPRO;
|
|
812
|
|
813 visargs[argnum] = Fkey_description (tem);
|
|
814 /* The following makes `describe-key' not work with
|
|
815 extent-local keymaps and such; and anyway, it's
|
|
816 contrary to the documentation. */
|
|
817 /* args[argnum] = call1 (Qevents_to_keys, tem); */
|
|
818 args[argnum] = tem;
|
|
819 arg_from_tty = 1;
|
|
820 break;
|
|
821 }
|
|
822
|
|
823 case 'm': /* Value of mark. Does not do I/O. */
|
|
824 {
|
|
825 args[argnum] = current_buffer->mark;
|
|
826 varies[argnum] = Qmark;
|
|
827 break;
|
|
828 }
|
|
829 case 'n': /* Read number from minibuffer. */
|
|
830 {
|
|
831 read_number:
|
|
832 args[argnum] = call2 (Qread_number, PROMPT (), Qnil);
|
|
833 /* numbers are too boring to go on command history */
|
|
834 /* arg_from_tty = 1; */
|
|
835 break;
|
|
836 }
|
|
837 case 'N': /* Prefix arg, else number from minibuffer */
|
|
838 {
|
|
839 if (NILP (prefix))
|
|
840 goto read_number;
|
|
841 else
|
|
842 goto prefix_value;
|
|
843 }
|
|
844 case 'P': /* Prefix arg in raw form. Does no I/O. */
|
|
845 {
|
|
846 args[argnum] = prefix;
|
|
847 break;
|
|
848 }
|
|
849 case 'p': /* Prefix arg converted to number. No I/O. */
|
|
850 {
|
|
851 prefix_value:
|
|
852 {
|
|
853 Lisp_Object tem = Fprefix_numeric_value (prefix);
|
|
854 args[argnum] = tem;
|
|
855 }
|
|
856 break;
|
|
857 }
|
|
858 case 'r': /* Region, point and mark as 2 args. */
|
|
859 {
|
|
860 Bufpos tem = check_mark ();
|
|
861 args[argnum] = (BUF_PT (current_buffer) < tem
|
|
862 ? Fcopy_marker (current_buffer->point_marker, Qt)
|
|
863 : current_buffer->mark);
|
|
864 varies[argnum] = Qregion_beginning;
|
|
865 args[++argnum] = (BUF_PT (current_buffer) > tem
|
|
866 ? Fcopy_marker (current_buffer->point_marker,
|
|
867 Qt)
|
|
868 : current_buffer->mark);
|
|
869 varies[argnum] = Qregion_end;
|
|
870 break;
|
|
871 }
|
|
872 case 's': /* String read via minibuffer. */
|
|
873 {
|
|
874 args[argnum] = call1 (Qread_string, PROMPT ());
|
|
875 arg_from_tty = 1;
|
|
876 break;
|
|
877 }
|
|
878 case 'S': /* Any symbol. */
|
|
879 {
|
|
880 visargs[argnum] = Qnil;
|
|
881 for (;;)
|
|
882 {
|
|
883 Lisp_Object tem = call5 (Qcompleting_read,
|
|
884 PROMPT (),
|
|
885 Vobarray,
|
|
886 Qnil,
|
|
887 Qnil,
|
|
888 /* nil, or prev attempt */
|
|
889 visargs[argnum]);
|
|
890 visargs[argnum] = tem;
|
|
891 /* I could use condition-case with this loser, but why bother?
|
|
892 * tem = Fread (tem); check-symbol-p;
|
|
893 */
|
|
894 tem = Fintern (tem, Qnil);
|
|
895 args[argnum] = tem;
|
|
896 if (string_length (XSYMBOL (tem)->name) > 0)
|
|
897 /* Don't accept the empty-named symbol. If the loser
|
|
898 really wants this s/he can call completing-read
|
|
899 directly */
|
|
900 break;
|
|
901 }
|
|
902 arg_from_tty = 1;
|
|
903 break;
|
|
904 }
|
|
905 case 'v': /* Variable name: user-variable-p symbol */
|
|
906 {
|
|
907 Lisp_Object tem = call1 (Qread_variable, PROMPT ());
|
|
908 args[argnum] = tem;
|
|
909 arg_from_tty = 1;
|
|
910 break;
|
|
911 }
|
|
912 case 'x': /* Lisp expression read but not evaluated */
|
|
913 {
|
|
914 args[argnum] = call1 (Qread_expression, PROMPT ());
|
|
915 /* visargs[argnum] = Fprin1_to_string (args[argnum], Qnil); */
|
|
916 arg_from_tty = 1;
|
|
917 break;
|
|
918 }
|
|
919 case 'X': /* Lisp expression read and evaluated */
|
|
920 {
|
|
921 Lisp_Object tem = call1 (Qread_expression, PROMPT ());
|
|
922 /* visargs[argnum] = Fprin1_to_string (tem, Qnil); */
|
|
923 args[argnum] = Feval (tem);
|
|
924 arg_from_tty = 1;
|
|
925 break;
|
|
926 }
|
|
927 case 'Z': /* Coding-system symbol or nil if no prefix */
|
|
928 {
|
|
929 #if defined(MULE) || defined(FILE_CODING)
|
|
930 if (NILP (prefix))
|
|
931 {
|
|
932 args[argnum] = Qnil;
|
|
933 }
|
|
934 else
|
|
935 {
|
|
936 args[argnum] =
|
|
937 call1 (Qread_non_nil_coding_system, PROMPT ());
|
|
938 arg_from_tty = 1;
|
|
939 }
|
|
940 #else
|
|
941 args[argnum] = Qnil;
|
|
942 #endif
|
|
943 break;
|
|
944 }
|
|
945 case 'z': /* Coding-system symbol */
|
|
946 {
|
|
947 #if defined(MULE) || defined(FILE_CODING)
|
|
948 args[argnum] = call1 (Qread_coding_system, PROMPT ());
|
|
949 arg_from_tty = 1;
|
|
950 #else
|
|
951 args[argnum] = Qnil;
|
|
952 #endif
|
|
953 break;
|
|
954 }
|
|
955
|
|
956 /* We have a case for `+' so we get an error
|
|
957 if anyone tries to define one here. */
|
|
958 case '+':
|
|
959 default:
|
|
960 {
|
563
|
961 signal_ferror (Qsyntax_error,
|
|
962 "Invalid `interactive' control letter \"%c\" (#o%03o).",
|
|
963 prompt_data[prompt_index],
|
|
964 prompt_data[prompt_index]);
|
428
|
965 }
|
|
966 }
|
|
967 #undef PROMPT
|
|
968 if (NILP (visargs[argnum]))
|
|
969 visargs[argnum] = args[argnum];
|
|
970
|
|
971 if (!prompt_limit)
|
|
972 break;
|
|
973 if (STRINGP (specs))
|
442
|
974 prompt_data = (const char *) XSTRING_DATA (specs);
|
428
|
975 prompt_index += prompt_length + 1 + 1; /* +1 to skip spec, +1 for \n */
|
|
976 }
|
|
977 unbind_to (speccount, Qnil);
|
|
978
|
|
979 QUIT;
|
|
980
|
|
981 if (EQ (record_flag, Qlambda))
|
|
982 {
|
|
983 RETURN_UNGCPRO (Flist (argcount, args));
|
|
984 }
|
|
985
|
|
986 if (arg_from_tty || !NILP (record_flag))
|
|
987 {
|
|
988 /* Reuse visargs as a temporary for constructing the command history */
|
|
989 for (argnum = 0; argnum < argcount; argnum++)
|
|
990 {
|
|
991 if (!NILP (varies[argnum]))
|
|
992 visargs[argnum] = list1 (varies[argnum]);
|
|
993 else
|
|
994 visargs[argnum] = Fquote_maybe (args[argnum]);
|
|
995 }
|
|
996 Vcommand_history = Fcons (Fcons (args[-1], Flist (argcount, visargs)),
|
|
997 Vcommand_history);
|
|
998 }
|
|
999
|
|
1000 /* If we used a marker to hold point, mark, or an end of the region,
|
|
1001 temporarily, convert it to an integer now. */
|
|
1002 for (argnum = 0; argnum < argcount; argnum++)
|
|
1003 if (!NILP (varies[argnum]))
|
|
1004 XSETINT (args[argnum], marker_position (args[argnum]));
|
|
1005
|
|
1006 single_console_state ();
|
|
1007 specbind (Qcommand_debug_status, Qnil);
|
|
1008 fun = Ffuncall (argcount + 1, args - 1);
|
|
1009 UNGCPRO;
|
|
1010 if (set_zmacs_region_stays)
|
|
1011 zmacs_region_stays = 1;
|
|
1012 return unbind_to (speccount, fun);
|
|
1013 }
|
|
1014 }
|
|
1015
|
|
1016 DEFUN ("prefix-numeric-value", Fprefix_numeric_value, 1, 1, 0, /*
|
444
|
1017 Return numeric meaning of raw prefix argument RAW.
|
428
|
1018 A raw prefix argument is what you get from `(interactive "P")'.
|
|
1019 Its numeric meaning is what you would get from `(interactive "p")'.
|
|
1020 */
|
|
1021 (raw))
|
|
1022 {
|
|
1023 if (NILP (raw))
|
|
1024 return make_int (1);
|
|
1025 if (EQ (raw, Qminus))
|
|
1026 return make_int (-1);
|
|
1027 if (INTP (raw))
|
|
1028 return raw;
|
|
1029 if (CONSP (raw) && INTP (XCAR (raw)))
|
|
1030 return XCAR (raw);
|
|
1031
|
|
1032 return make_int (1);
|
|
1033 }
|
|
1034
|
|
1035 void
|
|
1036 syms_of_callint (void)
|
|
1037 {
|
563
|
1038 DEFSYMBOL (Qcall_interactively);
|
|
1039 DEFSYMBOL (Qread_from_minibuffer);
|
|
1040 DEFSYMBOL (Qcompleting_read);
|
|
1041 DEFSYMBOL (Qread_file_name);
|
|
1042 DEFSYMBOL (Qread_directory_name);
|
|
1043 DEFSYMBOL (Qread_string);
|
|
1044 DEFSYMBOL (Qread_buffer);
|
|
1045 DEFSYMBOL (Qread_variable);
|
|
1046 DEFSYMBOL (Qread_function);
|
|
1047 DEFSYMBOL (Qread_command);
|
|
1048 DEFSYMBOL (Qread_number);
|
|
1049 DEFSYMBOL (Qread_expression);
|
428
|
1050 #if defined(MULE) || defined(FILE_CODING)
|
563
|
1051 DEFSYMBOL (Qread_coding_system);
|
|
1052 DEFSYMBOL (Qread_non_nil_coding_system);
|
428
|
1053 #endif
|
563
|
1054 DEFSYMBOL (Qevents_to_keys);
|
|
1055 DEFSYMBOL (Qcommand_debug_status);
|
|
1056 DEFSYMBOL (Qenable_recursive_minibuffers);
|
428
|
1057
|
|
1058 defsymbol (&QletX, "let*");
|
563
|
1059 DEFSYMBOL (Qsave_excursion);
|
428
|
1060 #if 0 /* ill-conceived */
|
563
|
1061 DEFSYMBOL (Qmouse_leave_buffer_hook);
|
428
|
1062 #endif
|
|
1063
|
|
1064 DEFSUBR (Finteractive);
|
|
1065 DEFSUBR (Fquote_maybe);
|
|
1066 DEFSUBR (Fcall_interactively);
|
|
1067 DEFSUBR (Fprefix_numeric_value);
|
|
1068 }
|
|
1069
|
|
1070 void
|
|
1071 vars_of_callint (void)
|
|
1072 {
|
|
1073 DEFVAR_LISP ("current-prefix-arg", &Vcurrent_prefix_arg /*
|
|
1074 The value of the prefix argument for this editing command.
|
|
1075 It may be a number, or the symbol `-' for just a minus sign as arg,
|
|
1076 or a list whose car is a number for just one or more C-U's
|
|
1077 or nil if no argument has been specified.
|
|
1078 This is what `(interactive "P")' returns.
|
|
1079 */ );
|
|
1080 Vcurrent_prefix_arg = Qnil;
|
|
1081
|
|
1082 DEFVAR_LISP ("command-history", &Vcommand_history /*
|
|
1083 List of recent commands that read arguments from terminal.
|
|
1084 Each command is represented as a form to evaluate.
|
|
1085 */ );
|
|
1086 Vcommand_history = Qnil;
|
|
1087
|
|
1088 DEFVAR_LISP ("command-debug-status", &Vcommand_debug_status /*
|
|
1089 Debugging status of current interactive command.
|
|
1090 Bound each time `call-interactively' is called;
|
|
1091 may be set by the debugger as a reminder for itself.
|
|
1092 */ );
|
|
1093 Vcommand_debug_status = Qnil;
|
|
1094
|
|
1095 #if 0 /* FSFmacs */
|
|
1096 xxDEFVAR_LISP ("mark-even-if-inactive", &Vmark_even_if_inactive /*
|
|
1097 *Non-nil means you can use the mark even when inactive.
|
|
1098 This option makes a difference in Transient Mark mode.
|
|
1099 When the option is non-nil, deactivation of the mark
|
|
1100 turns off region highlighting, but commands that use the mark
|
|
1101 behave as if the mark were still active.
|
|
1102 */ );
|
|
1103 Vmark_even_if_inactive = Qnil;
|
|
1104 #endif
|
|
1105
|
|
1106 #if 0 /* Doesn't work and is totally ill-conceived anyway. */
|
|
1107 xxDEFVAR_LISP ("mouse-leave-buffer-hook", &Vmouse_leave_buffer_hook /*
|
|
1108 Hook to run when about to switch windows with a mouse command.
|
|
1109 Its purpose is to give temporary modes such as Isearch mode
|
|
1110 a way to turn themselves off when a mouse command switches windows.
|
|
1111 */ );
|
|
1112 Vmouse_leave_buffer_hook = Qnil;
|
|
1113 #endif
|
|
1114 }
|