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