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