annotate src/callint.c @ 563:183866b06e0b

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