annotate src/callint.c @ 140:585fb297b004 r20-2b4

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