428
|
1 /* XEmacs -- Fully extensible Emacs, running on Unix and other platforms.
|
|
2 Copyright (C) 1985, 1986, 1987, 1992, 1993, 1994
|
|
3 Free Software Foundation, Inc.
|
|
4 Copyright (C) 1995 Sun Microsystems, Inc.
|
771
|
5 Copyright (C) 2000, 2001, 2002 Ben Wing.
|
428
|
6
|
|
7 This file is part of XEmacs.
|
|
8
|
|
9 XEmacs is free software; you can redistribute it and/or modify it
|
|
10 under the terms of the GNU General Public License as published by the
|
|
11 Free Software Foundation; either version 2, or (at your option) any
|
|
12 later version.
|
|
13
|
|
14 XEmacs is distributed in the hope that it will be useful, but WITHOUT
|
|
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
16 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
17 for more details.
|
|
18
|
|
19 You should have received a copy of the GNU General Public License
|
|
20 along with XEmacs; see the file COPYING. If not, write to
|
|
21 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
|
|
22 Boston, MA 02111-1307, USA. */
|
|
23
|
|
24 /* Synched up with: Mule 2.0, FSF 19.28. */
|
|
25
|
442
|
26 /* Capsule summary of the various releases of Lucid Emacs/XEmacs and
|
771
|
27 FSF/GNU Emacs. (Copied from the Internals Manual, where the
|
|
28 canonical version lives.) Provided here for use in cross-referencing
|
|
29 version releases and dates in comments, esp. in the authorship
|
|
30 comments at the beginning of each file. More information about
|
|
31 history can be found in the beginning of the Internals Manual and
|
|
32 in the About page.
|
442
|
33
|
|
34
|
|
35 -- A time line for Lucid Emacs/XEmacs is
|
|
36
|
|
37 version 19.0 shipped with Energize 1.0, April 1992.
|
|
38 version 19.1 released June 4, 1992.
|
|
39 version 19.2 released June 19, 1992.
|
|
40 version 19.3 released September 9, 1992.
|
|
41 version 19.4 released January 21, 1993.
|
|
42 version 19.5 was a repackaging of 19.4 with a few bug fixes and
|
|
43 shipped with Energize 2.0. Never released to the net.
|
|
44 version 19.6 released April 9, 1993.
|
|
45 version 19.7 was a repackaging of 19.6 with a few bug fixes and
|
|
46 shipped with Energize 2.1. Never released to the net.
|
|
47 version 19.8 released September 6, 1993.
|
|
48 version 19.9 released January 12, 1994.
|
|
49 version 19.10 released May 27, 1994.
|
|
50 version 19.11 (first XEmacs) released September 13, 1994.
|
|
51 version 19.12 released June 23, 1995.
|
|
52 version 19.13 released September 1, 1995.
|
|
53 version 19.14 released June 23, 1996.
|
|
54 version 20.0 released February 9, 1997.
|
|
55 version 19.15 released March 28, 1997.
|
|
56 version 20.1 (not released to the net) April 15, 1997.
|
|
57 version 20.2 released May 16, 1997.
|
|
58 version 19.16 released October 31, 1997.
|
771
|
59 version 20.3 (the first stable version of XEmacs 20.x) released November 30,
|
|
60 1997.
|
442
|
61 version 20.4 released February 28, 1998.
|
771
|
62 version 21.0.60 released December 10, 1998. (The version naming scheme was
|
|
63 changed at this point: [a] the second version number is odd for stable
|
|
64 versions, even for beta versions; [b] a third version number is added,
|
|
65 replacing the "beta xxx" ending for beta versions and allowing for
|
|
66 periodic maintenance releases for stable versions. Therefore, 21.0 was
|
|
67 never "officially" released; similarly for 21.2, etc.)
|
|
68 version 21.0.61 released January 4, 1999.
|
|
69 version 21.0.63 released February 3, 1999.
|
|
70 version 21.0.64 released March 1, 1999.
|
|
71 version 21.0.65 released March 5, 1999.
|
|
72 version 21.0.66 released March 12, 1999.
|
|
73 version 21.0.67 released March 25, 1999.
|
788
|
74 version 21.1.2 released May 14, 1999; on comp.emacs, May 28. (This is
|
|
75 the followup to 21.0.67. The second version number was bumped to indicate
|
|
76 the beginning of the "stable" series.)
|
771
|
77 version 21.1.3 released June 26, 1999.
|
|
78 version 21.1.4 released July 8, 1999.
|
|
79 version 21.1.6 released August 14, 1999. (There was no 21.1.5.)
|
|
80 version 21.1.7 released September 26, 1999.
|
|
81 version 21.1.8 released November 2, 1999.
|
|
82 version 21.1.9 released February 13, 2000.
|
|
83 version 21.1.10 released May 7, 2000.
|
|
84 version 21.1.10a released June 24, 2000.
|
|
85 version 21.1.11 released July 18, 2000.
|
|
86 version 21.1.12 released August 5, 2000.
|
|
87 version 21.1.13 released January 7, 2001.
|
|
88 version 21.1.14 released January 27, 2001.
|
|
89 version 21.2.9 released February 3, 1999.
|
|
90 version 21.2.10 released February 5, 1999.
|
|
91 version 21.2.11 released March 1, 1999.
|
|
92 version 21.2.12 released March 5, 1999.
|
|
93 version 21.2.13 released March 12, 1999.
|
|
94 version 21.2.14 released May 14, 1999.
|
|
95 version 21.2.15 released June 4, 1999.
|
|
96 version 21.2.16 released June 11, 1999.
|
|
97 version 21.2.17 released June 22, 1999.
|
|
98 version 21.2.18 released July 14, 1999.
|
|
99 version 21.2.19 released July 30, 1999.
|
|
100 version 21.2.20 released November 10, 1999.
|
|
101 version 21.2.21 released November 28, 1999.
|
|
102 version 21.2.22 released November 29, 1999.
|
|
103 version 21.2.23 released December 7, 1999.
|
|
104 version 21.2.24 released December 14, 1999.
|
|
105 version 21.2.25 released December 24, 1999.
|
|
106 version 21.2.26 released December 31, 1999.
|
|
107 version 21.2.27 released January 18, 2000.
|
|
108 version 21.2.28 released February 7, 2000.
|
|
109 version 21.2.29 released February 16, 2000.
|
|
110 version 21.2.30 released February 21, 2000.
|
|
111 version 21.2.31 released February 23, 2000.
|
|
112 version 21.2.32 released March 20, 2000.
|
|
113 version 21.2.33 released May 1, 2000.
|
|
114 version 21.2.34 released May 28, 2000.
|
|
115 version 21.2.35 released July 19, 2000.
|
|
116 version 21.2.36 released October 4, 2000.
|
|
117 version 21.2.37 released November 14, 2000.
|
|
118 version 21.2.38 released December 5, 2000.
|
|
119 version 21.2.39 released December 31, 2000.
|
|
120 version 21.2.40 released January 8, 2001.
|
788
|
121 version 21.2.41 "Polyhymnia" released January 17, 2001.
|
|
122 version 21.2.42 "Poseidon" released January 20, 2001.
|
|
123 version 21.2.43 "Terspichore" released January 26, 2001.
|
|
124 version 21.2.44 "Thalia" released February 8, 2001.
|
|
125 version 21.2.45 "Thelxepeia" released February 23, 2001.
|
|
126 version 21.2.46 "Urania" released March 21, 2001.
|
|
127 version 21.5.0 "alfalfa" released April 18, 2001.
|
|
128 version 21.5.1 "anise" released May 9, 2001.
|
|
129 version 21.5.2 "artichoke" released July 28, 2001.
|
|
130 version 21.5.3 "asparagus" released September 7, 2001.
|
|
131 version 21.5.4 "bamboo" released January 8, 2002.
|
|
132 version 21.5.5 "beets" released March 5, 2002.
|
|
133
|
442
|
134
|
|
135
|
|
136 -- A time line for GNU Emacs version 19 is
|
|
137
|
|
138 version 19.7 (beta) (first beta release) released ??????; prob. late May 1993.
|
|
139 version 19.8 (beta) released May 27, 1993.
|
|
140 version 19.9 (beta) released May 27, 1993.
|
|
141 version 19.10 (beta) released May 30, 1993.
|
|
142 version 19.11 (beta) released June 1, 1993.
|
|
143 version 19.12 (beta) released June 2, 1993.
|
|
144 version 19.13 (beta) released June 8, 1993.
|
|
145 version 19.14 (beta) released June 17, 1993.
|
|
146 version 19.15 (beta) released June 19, 1993.
|
|
147 version 19.16 (beta) released July 6, 1993.
|
|
148 version 19.17 (beta) released late July, 1993.
|
|
149 version 19.18 (beta) released August 9, 1993.
|
|
150 version 19.19 (beta) released August 15, 1993.
|
|
151 version 19.20 (beta) released November 17, 1993.
|
|
152 version 19.21 (beta) released November 17, 1993.
|
|
153 version 19.22 (beta) released November 28, 1993.
|
788
|
154 version 19.23 (beta) released on comp.emacs, May 17, 1994.
|
442
|
155 version 19.24 (beta) released May 16, 1994.
|
|
156 version 19.25 (beta) released June 3, 1994.
|
|
157 version 19.26 (beta) released September 11, 1994.
|
|
158 version 19.27 (beta) released September 14, 1994.
|
|
159 version 19.28 (first ``official'' release) released November 1, 1994.
|
|
160 version 19.29 released June 21, 1995.
|
|
161 version 19.30 released November 24, 1995.
|
|
162 version 19.31 released May 25, 1996.
|
|
163 version 19.32 released July 31, 1996.
|
|
164 version 19.33 released August 11, 1996.
|
788
|
165 version 19.34 released August 21, 1996; on comp.emacs, August 22.
|
442
|
166 version 19.34b released September 6, 1996.
|
|
167
|
|
168
|
788
|
169 -- A time line for GNU Emacs versions 20 and 21 is
|
442
|
170
|
|
171 version 20.1 released September 17, 1997.
|
|
172 version 20.2 released September 20, 1997.
|
|
173 version 20.3 released August 19, 1998.
|
788
|
174 version 20.4 released July 12, 1999; on comp.emacs, July 27.
|
|
175 version 21.1 released October 20, 2001.
|
442
|
176
|
|
177
|
|
178 -- A time line for GNU Emacs version 18 and older is
|
|
179
|
|
180 GNU Emacs version 15 (15.34) was released sometime in 1984 or 1985 and
|
|
181 shared some code with a version of Emacs written by James Gosling (the
|
|
182 same James Gosling who later created the Java language).
|
|
183 GNU Emacs version 16 (first released version was 16.56) was released on
|
|
184 July 15, 1985. All Gosling code was removed due to potential copyright
|
|
185 problems with the code.
|
|
186 version 16.57: released on September 16, 1985.
|
|
187 versions 16.58, 16.59: released on September 17, 1985.
|
|
188 version 16.60: released on September 19, 1985. These later version 16's
|
|
189 incorporated patches from the net, esp. for getting Emacs to work under
|
|
190 System V.
|
|
191 version 17.36 (first official v17 release) released on December 20, 1985.
|
|
192 Included a TeX-able user manual. First official unpatched version that
|
|
193 worked on vanilla System V machines.
|
|
194 version 17.43 (second official v17 release) released on January 25, 1986.
|
|
195 version 17.45 released on January 30, 1986.
|
|
196 version 17.46 released on February 4, 1986.
|
|
197 version 17.48 released on February 10, 1986.
|
|
198 version 17.49 released on February 12, 1986.
|
|
199 version 17.55 released on March 18, 1986.
|
|
200 version 17.57 released on March 27, 1986.
|
|
201 version 17.58 released on April 4, 1986.
|
|
202 version 17.61 released on April 12, 1986.
|
|
203 version 17.63 released on May 7, 1986.
|
|
204 version 17.64 released on May 12, 1986.
|
|
205 version 18.24 (a beta version) released on October 2, 1986.
|
|
206 version 18.30 (a beta version) released on November 15, 1986.
|
|
207 version 18.31 (a beta version) released on November 23, 1986.
|
|
208 version 18.32 (a beta version) released on December 7, 1986.
|
|
209 version 18.33 (a beta version) released on December 12, 1986.
|
|
210 version 18.35 (a beta version) released on January 5, 1987.
|
|
211 version 18.36 (a beta version) released on January 21, 1987.
|
|
212 January 27, 1987: The Great Usenet Renaming. net.emacs is now comp.emacs.
|
|
213 version 18.37 (a beta version) released on February 12, 1987.
|
|
214 version 18.38 (a beta version) released on March 3, 1987.
|
|
215 version 18.39 (a beta version) released on March 14, 1987.
|
|
216 version 18.40 (a beta version) released on March 18, 1987.
|
|
217 version 18.41 (the first ``official'' release) released on March 22, 1987.
|
|
218 version 18.45 released on June 2, 1987.
|
|
219 version 18.46 released on June 9, 1987.
|
|
220 version 18.47 released on June 18, 1987.
|
|
221 version 18.48 released on September 3, 1987.
|
|
222 version 18.49 released on September 18, 1987.
|
|
223 version 18.50 released on February 13, 1988.
|
|
224 version 18.51 released on May 7, 1988.
|
|
225 version 18.52 released on September 1, 1988.
|
|
226 version 18.53 released on February 24, 1989.
|
|
227 version 18.54 released on April 26, 1989.
|
|
228 version 18.55 released on August 23, 1989. This is the earliest version
|
|
229 that is still available by FTP.
|
|
230 version 18.56 released on January 17, 1991.
|
|
231 version 18.57 released late January, 1991.
|
|
232 version 18.58 released ?????.
|
|
233 version 18.59 released October 31, 1992.
|
|
234
|
|
235 */
|
|
236
|
428
|
237 /* Note: It is necessary to specify <config.h> and not "config.h" in
|
|
238 order for the --srcdir type of compilation to work properly.
|
|
239 Otherwise the config.h from the srcdir, rather than the one from
|
|
240 the build dir, will be used. */
|
|
241
|
|
242 #include <config.h>
|
|
243 #include "lisp.h"
|
|
244
|
|
245 #include "backtrace.h" /* run-emacs-from-temacs needs this */
|
|
246 #include "buffer.h"
|
|
247 #include "commands.h"
|
|
248 #include "console.h"
|
|
249 #include "process.h"
|
|
250 #include "redisplay.h"
|
438
|
251 #include "frame.h"
|
428
|
252 #include "sysdep.h"
|
|
253
|
|
254 #include "syssignal.h" /* Always include before systty.h */
|
|
255 #include "systty.h"
|
|
256 #include "sysfile.h"
|
|
257 #include "systime.h"
|
771
|
258 #include "sysproc.h" /* for qxe_getpid() */
|
428
|
259
|
442
|
260 #ifdef PDUMP
|
|
261 #include "dumper.h"
|
|
262 #endif
|
|
263
|
428
|
264 #ifdef QUANTIFY
|
|
265 #include <quantify.h>
|
|
266 #endif
|
|
267
|
|
268 #ifdef HAVE_SHLIB
|
|
269 #include "sysdll.h"
|
|
270 #endif
|
|
271
|
|
272 #ifdef TOOLTALK
|
442
|
273 #include TT_C_H_FILE
|
428
|
274 #endif
|
|
275
|
771
|
276 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
277 #include "syswindows.h"
|
428
|
278 #endif
|
|
279
|
|
280 /* For PATH_EXEC */
|
|
281 #include <paths.h>
|
|
282
|
442
|
283 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
|
428
|
284 void report_sheap_usage (int die_if_pure_storage_exceeded);
|
|
285 #endif
|
|
286
|
|
287 #if !defined (SYSTEM_MALLOC) && !defined (DOUG_LEA_MALLOC)
|
|
288 extern void *(*__malloc_hook)(size_t);
|
|
289 extern void *(*__realloc_hook)(void *, size_t);
|
|
290 extern void (*__free_hook)(void *);
|
|
291 #endif /* not SYSTEM_MALLOC && not DOUG_LEA_MALLOC */
|
|
292
|
|
293 /* Command line args from shell, as list of strings */
|
|
294 Lisp_Object Vcommand_line_args;
|
|
295
|
|
296 /* Set nonzero after XEmacs has started up the first time.
|
|
297 Prevents reinitialization of the Lisp world and keymaps
|
|
298 on subsequent starts. */
|
|
299 int initialized;
|
|
300
|
|
301 #ifdef DOUG_LEA_MALLOC
|
|
302 # include <malloc.h>
|
|
303 /* Preserves a pointer to the memory allocated that copies that
|
|
304 static data inside glibc's malloc. */
|
|
305 static void *malloc_state_ptr;
|
|
306 #endif /* DOUG_LEA_MALLOC */
|
|
307
|
|
308 # ifdef REL_ALLOC
|
|
309 void r_alloc_reinit (void);
|
|
310 # endif
|
|
311
|
|
312 /* Variable whose value is symbol giving operating system type. */
|
|
313 Lisp_Object Vsystem_type;
|
|
314
|
|
315 /* Variable whose value is string giving configuration built for. */
|
|
316 Lisp_Object Vsystem_configuration;
|
|
317
|
|
318 /* Variable whose value is string containing the configuration options
|
|
319 XEmacs was built with. */
|
|
320 Lisp_Object Vsystem_configuration_options;
|
|
321
|
|
322 /* Version numbers and strings */
|
|
323 Lisp_Object Vemacs_major_version;
|
|
324 Lisp_Object Vemacs_minor_version;
|
|
325 Lisp_Object Vemacs_patch_level;
|
|
326 Lisp_Object Vemacs_beta_version;
|
|
327 Lisp_Object Vxemacs_codename;
|
|
328 #ifdef INFODOCK
|
|
329 Lisp_Object Vinfodock_major_version;
|
|
330 Lisp_Object Vinfodock_minor_version;
|
|
331 Lisp_Object Vinfodock_build_version;
|
|
332 #endif
|
|
333
|
|
334 /* The path under which XEmacs was invoked. */
|
|
335 Lisp_Object Vinvocation_path;
|
|
336
|
|
337 /* The name under which XEmacs was invoked, with any leading directory
|
|
338 names discarded. */
|
|
339 Lisp_Object Vinvocation_name;
|
|
340
|
|
341 /* The directory name from which XEmacs was invoked. */
|
|
342 Lisp_Object Vinvocation_directory;
|
|
343
|
|
344 #if 0 /* FSFmacs */
|
|
345 /* The directory name in which to find subdirs such as lisp and etc.
|
|
346 nil means get them only from PATH_LOADSEARCH. */
|
|
347 Lisp_Object Vinstallation_directory;
|
|
348 #endif
|
|
349
|
|
350 Lisp_Object Vemacs_program_name, Vemacs_program_version;
|
|
351 Lisp_Object Vexec_path;
|
|
352 Lisp_Object Vexec_directory, Vconfigure_exec_directory;
|
|
353 Lisp_Object Vlisp_directory, Vconfigure_lisp_directory;
|
460
|
354 Lisp_Object Vmule_lisp_directory, Vconfigure_mule_lisp_directory;
|
428
|
355 Lisp_Object Vmodule_directory, Vconfigure_module_directory;
|
|
356 Lisp_Object Vsite_module_directory, Vconfigure_site_module_directory;
|
|
357 Lisp_Object Vconfigure_package_path;
|
|
358 Lisp_Object Vdata_directory, Vconfigure_data_directory;
|
|
359 Lisp_Object Vdoc_directory, Vconfigure_doc_directory;
|
|
360 Lisp_Object Vconfigure_lock_directory;
|
|
361 Lisp_Object Vdata_directory_list;
|
|
362 Lisp_Object Vconfigure_info_directory;
|
|
363 Lisp_Object Vsite_directory, Vconfigure_site_directory;
|
|
364 Lisp_Object Vconfigure_info_path;
|
|
365 Lisp_Object Vinternal_error_checking;
|
438
|
366 Lisp_Object Vmail_lock_methods, Vconfigure_mail_lock_method;
|
428
|
367
|
|
368 /* The default base directory XEmacs is installed under. */
|
|
369 Lisp_Object Vconfigure_exec_prefix_directory, Vconfigure_prefix_directory;
|
|
370
|
|
371 /* If nonzero, set XEmacs to run at this priority. This is also used
|
|
372 in child_setup and sys_suspend to make sure subshells run at normal
|
|
373 priority. */
|
458
|
374 Fixnum emacs_priority;
|
428
|
375
|
442
|
376 /* Some FSF junk with running_asynch_code, to preserve the match
|
|
377 data. Not necessary because we don't call process filters
|
|
378 asynchronously (i.e. from within QUIT). */
|
|
379 /* #### Delete this when merging the rest of my code */
|
428
|
380 int running_asynch_code;
|
|
381
|
|
382 /* If non-zero, a window-system was specified on the command line. */
|
|
383 int display_arg;
|
|
384
|
|
385 /* Type of display specified. We cannot use a Lisp symbol here because
|
|
386 Lisp symbols may not initialized at the time that we set this
|
|
387 variable. */
|
771
|
388 const Char_ASCII *display_use;
|
428
|
389
|
|
390 /* If non-zero, then the early error handler will only print the error
|
|
391 message and exit. */
|
|
392 int suppress_early_error_handler_backtrace;
|
|
393
|
|
394 /* An address near the bottom of the stack.
|
|
395 Tells GC how to save a copy of the stack. */
|
|
396 char *stack_bottom;
|
|
397
|
|
398 #ifdef USG_SHARED_LIBRARIES
|
|
399 /* If nonzero, this is the place to put the end of the writable segment
|
|
400 at startup. */
|
|
401
|
|
402 uintptr_t bss_end = 0;
|
|
403 #endif
|
|
404
|
647
|
405 /* Number of bytes of writable memory we can expect to be able to get:
|
|
406 Leave this as an unsigned int because it could potentially be 4G */
|
428
|
407 unsigned int lim_data;
|
|
408
|
442
|
409 /* WARNING!
|
|
410
|
|
411 Some LISP-visible command-line options are set by XEmacs _before_ the
|
|
412 data is dumped in building a --pdump XEmacs, but used _after_ it is
|
446
|
413 restored in normal operation. Thus the dump-time values overwrite the
|
|
414 values XEmacs is getting at runtime. Such variables must be saved
|
442
|
415 before loading the dumpfile, and restored afterward.
|
|
416
|
446
|
417 Therefore these variables may not be initialized in vars_of_emacs().
|
|
418
|
|
419 The save/restore is done immediately before and after pdump_load() in
|
|
420 main_1(). See that function for the current list of protected variables.
|
|
421
|
|
422 Note that saving/restoring is only necessary for a few variables that are
|
|
423 o command line arguments effective at runtime (as opposed to dump-time),
|
|
424 o parsed before pdump_load, and
|
|
425 o exported to Lisp via a DEFVAR.
|
442
|
426 */
|
|
427
|
428
|
428 /* Nonzero means running XEmacs without interactive terminal. */
|
|
429
|
|
430 int noninteractive;
|
|
431
|
|
432 /* Value of Lisp variable `noninteractive'.
|
|
433 Normally same as C variable `noninteractive'
|
442
|
434 but nothing terrible happens if user sets this one.
|
|
435
|
|
436 Shadowed from the pdumper by `noninteractive'. */
|
428
|
437
|
|
438 int noninteractive1;
|
|
439
|
|
440 /* Nonzero means don't perform site-lisp searches at startup */
|
|
441 int inhibit_site_lisp;
|
|
442
|
|
443 /* Nonzero means don't perform site-modules searches at startup */
|
|
444 int inhibit_site_modules;
|
|
445
|
776
|
446 /* Nonzero means don't load user-init or site-start file */
|
|
447 int vanilla_inhibiting;
|
|
448
|
428
|
449 /* Nonzero means don't respect early packages at startup */
|
|
450 int inhibit_early_packages;
|
|
451
|
776
|
452 /* Nonzero means don't respect any packages at startup -- act as if they
|
|
453 don't exist. */
|
|
454 int inhibit_all_packages;
|
|
455
|
428
|
456 /* Nonzero means don't load package autoloads at startup */
|
|
457 int inhibit_autoloads;
|
|
458
|
442
|
459 /* Nonzero means don't load the dump file (ignored if not PDUMP) */
|
|
460
|
|
461 int nodumpfile;
|
|
462
|
428
|
463 /* Nonzero means print debug information about path searching */
|
|
464 int debug_paths;
|
|
465
|
|
466 /* Save argv and argc. */
|
444
|
467 static Extbyte **initial_argv; /* #### currently unused */
|
|
468 static int initial_argc; /* #### currently unused */
|
428
|
469
|
|
470 static void sort_args (int argc, char **argv);
|
|
471
|
|
472 Lisp_Object Qkill_emacs_hook;
|
|
473 Lisp_Object Qsave_buffers_kill_emacs;
|
|
474
|
|
475 extern Lisp_Object Vlisp_EXEC_SUFFIXES;
|
|
476
|
442
|
477 /* Nonzero if handling a fatal error already. */
|
|
478 int fatal_error_in_progress;
|
|
479
|
771
|
480 /* Nonzero means we're going down, so we better not run any hooks
|
442
|
481 or do other non-essential stuff. */
|
|
482 int preparing_for_armageddon;
|
|
483
|
771
|
484 /* Nonzero means we're in an unstable situation and need to skip
|
|
485 i18n conversions and such during printing. */
|
|
486 int inhibit_non_essential_printing_operations;
|
442
|
487
|
|
488 static JMP_BUF run_temacs_catch;
|
|
489
|
|
490 static int run_temacs_argc;
|
502
|
491 static Extbyte **run_temacs_argv;
|
|
492 static Extbyte *run_temacs_args;
|
647
|
493 static int run_temacs_argv_size;
|
|
494 static int run_temacs_args_size;
|
442
|
495
|
|
496 #ifdef _MSC_VER
|
771
|
497 static DWORD mswindows_handle_hardware_exceptions (DWORD code);
|
|
498 #endif
|
442
|
499
|
|
500
|
771
|
501 /************************************************************************/
|
|
502 /* Functions to handle arguments */
|
|
503 /************************************************************************/
|
|
504
|
428
|
505 /* Code for dealing with Lisp access to the Unix command line */
|
|
506
|
|
507 static Lisp_Object
|
442
|
508 make_arg_list_1 (int argc, Extbyte **argv, int skip_args)
|
428
|
509 {
|
|
510 Lisp_Object result = Qnil;
|
|
511 REGISTER int i;
|
|
512
|
|
513 for (i = argc - 1; i >= 0; i--)
|
|
514 {
|
|
515 if (i == 0 || i > skip_args)
|
|
516 {
|
442
|
517 #ifdef WIN32_NATIVE
|
428
|
518 if (i == 0)
|
|
519 {
|
|
520 /* Do not trust to what crt0 has stuffed into argv[0] */
|
558
|
521 Extbyte full_exe_path[PATH_MAX];
|
442
|
522 Lisp_Object fullpath;
|
|
523
|
771
|
524 qxeGetModuleFileName (NULL, full_exe_path, PATH_MAX);
|
|
525 fullpath = build_tstr_string (full_exe_path);
|
442
|
526 result = Fcons (fullpath, result);
|
428
|
527 #if defined(HAVE_SHLIB)
|
442
|
528 {
|
|
529 Extbyte *fullpathext;
|
|
530
|
|
531 LISP_STRING_TO_EXTERNAL (fullpath, fullpathext,
|
502
|
532 Qdll_filename_encoding);
|
442
|
533 (void) dll_init (fullpathext);
|
|
534 }
|
428
|
535 #endif
|
|
536 }
|
|
537 else
|
|
538 #endif
|
442
|
539 result = Fcons (build_ext_string (argv[i],
|
|
540 Qcommand_argument_encoding),
|
440
|
541 result);
|
428
|
542 }
|
|
543 }
|
|
544 return result;
|
|
545 }
|
|
546
|
|
547 Lisp_Object
|
442
|
548 make_arg_list (int argc, Extbyte **argv)
|
428
|
549 {
|
|
550 return make_arg_list_1 (argc, argv, 0);
|
|
551 }
|
|
552
|
|
553 /* Calling functions are also responsible for calling free_argc_argv
|
|
554 when they are done with the generated list. */
|
|
555 void
|
442
|
556 make_argc_argv (Lisp_Object argv_list, int *argc, Extbyte ***argv)
|
428
|
557 {
|
|
558 Lisp_Object next;
|
|
559 int n = XINT (Flength (argv_list));
|
|
560 REGISTER int i;
|
442
|
561 *argv = (Extbyte**) xmalloc ((n+1) * sizeof (Extbyte*));
|
428
|
562
|
|
563 for (i = 0, next = argv_list; i < n; i++, next = XCDR (next))
|
|
564 {
|
442
|
565 const Extbyte *temp;
|
428
|
566 CHECK_STRING (XCAR (next));
|
|
567
|
442
|
568 LISP_STRING_TO_EXTERNAL (XCAR (next), temp, Qcommand_argument_encoding);
|
428
|
569 (*argv) [i] = xstrdup (temp);
|
|
570 }
|
|
571 (*argv) [n] = 0;
|
|
572 *argc = i;
|
|
573 }
|
|
574
|
|
575 void
|
442
|
576 free_argc_argv (Extbyte **argv)
|
428
|
577 {
|
|
578 int elt = 0;
|
|
579
|
|
580 while (argv[elt])
|
|
581 {
|
|
582 xfree (argv[elt]);
|
|
583 elt++;
|
|
584 }
|
|
585 xfree (argv);
|
|
586 }
|
|
587
|
|
588 static void
|
442
|
589 init_cmdargs (int argc, Extbyte **argv, int skip_args)
|
428
|
590 {
|
|
591 initial_argv = argv;
|
|
592 initial_argc = argc;
|
|
593
|
|
594 Vcommand_line_args = make_arg_list_1 (argc, argv, skip_args);
|
|
595 }
|
|
596
|
|
597 DEFUN ("invocation-name", Finvocation_name, 0, 0, 0, /*
|
|
598 Return the program name that was used to run XEmacs.
|
|
599 Any directory names are omitted.
|
|
600 */
|
|
601 ())
|
|
602 {
|
|
603 return Fcopy_sequence (Vinvocation_name);
|
|
604 }
|
|
605
|
|
606 DEFUN ("invocation-directory", Finvocation_directory, 0, 0, 0, /*
|
|
607 Return the directory name in which the Emacs executable was located.
|
|
608 */
|
|
609 ())
|
|
610 {
|
|
611 return Fcopy_sequence (Vinvocation_directory);
|
|
612 }
|
|
613
|
|
614
|
|
615
|
776
|
616 /* Test whether the next argument in ARGV matches SSTR or a prefix of LSTR
|
|
617 (at least MINLEN characters; if MINLEN is 0, set to size of LSTR). If
|
|
618 so, then if VALPTR is non-null (the argument is supposed to have a
|
|
619 value) store in *VALPTR either the next argument or the portion of this
|
|
620 one after the equal sign. ARGV is read starting at position *SKIPPTR;
|
|
621 this index is advanced by the number of arguments used.
|
428
|
622
|
|
623 Too bad we can't just use getopt for all of this, but we don't have
|
|
624 enough information to do it right. */
|
|
625
|
|
626 static int
|
|
627 argmatch (char **argv, int argc, char *sstr, char *lstr,
|
|
628 int minlen, char **valptr, int *skipptr)
|
|
629 {
|
|
630 char *p = NULL;
|
|
631 int arglen;
|
|
632 char *arg;
|
|
633
|
|
634 /* Don't access argv[argc]; give up in advance. */
|
|
635 if (argc <= *skipptr + 1)
|
|
636 return 0;
|
|
637
|
|
638 arg = argv[*skipptr+1];
|
|
639 if (arg == NULL)
|
|
640 return 0;
|
|
641 if (strcmp (arg, sstr) == 0)
|
|
642 {
|
|
643 if (valptr != NULL)
|
|
644 {
|
|
645 *valptr = argv[*skipptr+2];
|
|
646 *skipptr += 2;
|
|
647 }
|
|
648 else
|
|
649 *skipptr += 1;
|
|
650 return 1;
|
|
651 }
|
|
652 arglen = (valptr != NULL && (p = strchr (arg, '=')) != NULL
|
664
|
653 ? p - arg : (int) strlen (arg));
|
776
|
654 if (lstr && !minlen)
|
|
655 minlen = strlen (lstr);
|
428
|
656 if (lstr == 0 || arglen < minlen || strncmp (arg, lstr, arglen) != 0)
|
|
657 return 0;
|
|
658 else if (valptr == NULL)
|
|
659 {
|
|
660 *skipptr += 1;
|
|
661 return 1;
|
|
662 }
|
|
663 else if (p != NULL)
|
|
664 {
|
|
665 *valptr = p+1;
|
|
666 *skipptr += 1;
|
|
667 return 1;
|
|
668 }
|
|
669 else if (argv[*skipptr+2] != NULL)
|
|
670 {
|
|
671 *valptr = argv[*skipptr+2];
|
|
672 *skipptr += 2;
|
|
673 return 1;
|
|
674 }
|
|
675 else
|
|
676 {
|
|
677 return 0;
|
|
678 }
|
|
679 }
|
|
680
|
771
|
681
|
|
682 /************************************************************************/
|
|
683 /* main and friends: XEmacs startup */
|
|
684 /************************************************************************/
|
|
685
|
428
|
686 /* Make stack traces always identify version + configuration */
|
|
687 #define main_1 STACK_TRACE_EYE_CATCHER
|
|
688
|
|
689 /* This function is not static, so that the compiler is less likely to
|
446
|
690 inline it, which would make it not show up in stack traces.
|
|
691
|
|
692 The restart argument is a flag that indicates that main_1 is now
|
771
|
693 being called for the second time in this invocation of xemacs; this
|
|
694 happens as a result of using `run-temacs' in the command line, when
|
|
695 invoking a bare (without dumped data) XEmacs (i.e. `temacs' with
|
|
696 the conventional dumper or `xemacs -nd' with the pdumper). See
|
446
|
697 Frun_emacs_from_temacs().
|
|
698
|
|
699 restart interacts with initialized as follows (per Olivier Galibert):
|
|
700
|
|
701 It's perverted.
|
|
702
|
|
703 initialized==0 => temacs
|
|
704 initialized!=0 && restart!=0 => run-temacs
|
771
|
705 initialized!=0 && restart==0 => either xemacs after conventional dump,
|
|
706 or xemacs post pdump_load()
|
446
|
707 */
|
428
|
708 DECLARE_DOESNT_RETURN (main_1 (int, char **, char **, int));
|
|
709 DOESNT_RETURN
|
|
710 main_1 (int argc, char **argv, char **envp, int restart)
|
|
711 {
|
|
712 char stack_bottom_variable;
|
|
713 int skip_args = 0;
|
|
714 Lisp_Object load_me;
|
|
715 int inhibit_window_system;
|
|
716 #ifdef NeXT
|
|
717 extern int malloc_cookie;
|
|
718 #endif
|
|
719
|
|
720 #if (!defined (SYSTEM_MALLOC) && !defined (HAVE_LIBMCHECK) \
|
|
721 && !defined (DOUG_LEA_MALLOC))
|
|
722 /* Make sure that any libraries we link against haven't installed a
|
|
723 hook for a gmalloc of a potentially incompatible version. */
|
|
724 /* If we're using libmcheck, the hooks have already been initialized, */
|
|
725 /* don't touch them. -slb */
|
|
726 __malloc_hook = NULL;
|
|
727 __realloc_hook = NULL;
|
|
728 __free_hook = NULL;
|
|
729 #endif /* not SYSTEM_MALLOC or HAVE_LIBMCHECK or DOUG_LEA_MALLOC */
|
|
730
|
|
731 noninteractive = 0;
|
771
|
732 inhibit_non_essential_printing_operations = 1;
|
428
|
733
|
|
734 #ifdef NeXT
|
|
735 /* 19-Jun-1995 -baw
|
|
736 * NeXT secret magic, ripped from Emacs-for-NS by Carl Edman
|
|
737 * <cedman@princeton.edu>. Note that even Carl doesn't know what this
|
776
|
738 * does; it was provided by NeXT, and it presumably makes NS's mallocator
|
428
|
739 * work with dumping. But malloc_jumpstart() and malloc_freezedry() in
|
|
740 * unexnext.c are both completely undocumented, even in NS header files!
|
|
741 * But hey, it solves all NS related memory problems, so who's
|
|
742 * complaining? */
|
|
743 if (initialized && malloc_jumpstart (malloc_cookie) != 0)
|
442
|
744 stderr_out ("malloc jumpstart failed!\n");
|
428
|
745 #endif /* NeXT */
|
|
746
|
|
747 /*
|
|
748 #if defined (GNU_MALLOC) && \
|
|
749 defined (ERROR_CHECK_MALLOC) && \
|
|
750 !defined (HAVE_LIBMCHECK)
|
|
751 */
|
|
752 #if defined(LOSING_GCC_DESTRUCTOR_FREE_BUG)
|
|
753 /* Prior to XEmacs 21, this was `#if 0'ed out. */
|
|
754 /* I'm enabling this because it is the only reliable way I've found to */
|
|
755 /* prevent a very annoying problem where GCC will attempt to free(3) */
|
|
756 /* memory at exit() and cause a coredump. */
|
|
757 init_free_hook ();
|
|
758 #endif
|
|
759
|
|
760 sort_args (argc, argv);
|
|
761
|
442
|
762 #if defined (WIN32_NATIVE) || defined (_SCO_DS)
|
428
|
763 environ = envp;
|
|
764 #endif
|
|
765
|
|
766 /* Record (approximately) where the stack begins. */
|
|
767 stack_bottom = &stack_bottom_variable;
|
|
768
|
|
769 #ifdef USG_SHARED_LIBRARIES
|
|
770 if (bss_end)
|
|
771 brk ((void *) bss_end);
|
|
772 #endif
|
|
773
|
|
774 clearerr (stdin);
|
|
775
|
|
776 #if defined (HAVE_MMAP) && defined (REL_ALLOC)
|
|
777 /* ralloc can only be used if using the GNU memory allocator. */
|
|
778 init_ralloc ();
|
|
779 #elif defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
|
|
780 if (initialized)
|
|
781 init_ralloc();
|
|
782 #endif
|
|
783
|
|
784 #ifdef HAVE_SOCKS
|
|
785 if (initialized)
|
|
786 SOCKSinit (argv[0]);
|
|
787 #endif /* HAVE_SOCKS */
|
|
788
|
|
789 #ifndef SYSTEM_MALLOC
|
|
790 if (!initialized)
|
|
791 /* Arrange to get warning messages as memory fills up. */
|
|
792 memory_warnings (0, malloc_warning);
|
|
793 #endif /* not SYSTEM_MALLOC */
|
|
794
|
|
795 #ifdef SET_EMACS_PRIORITY
|
|
796 if (emacs_priority != 0)
|
|
797 nice (-emacs_priority);
|
|
798 setuid (getuid ());
|
|
799 #endif /* SET_EMACS_PRIORITY */
|
|
800
|
|
801 #ifdef EXTRA_INITIALIZE
|
|
802 EXTRA_INITIALIZE;
|
|
803 #endif
|
|
804
|
|
805 #ifdef HAVE_WINDOW_SYSTEM
|
|
806 inhibit_window_system = 0;
|
|
807 #else
|
|
808 inhibit_window_system = 1;
|
|
809 #endif
|
|
810
|
776
|
811 /* NOTE NOTE NOTE: Keep the following args in sync with the big list of
|
|
812 arguments below in standard_args[], with the help text in startup.el,
|
|
813 and with the list of non-clobbered variables near where pdump_load()
|
|
814 is called! */
|
|
815
|
|
816 /* Handle the -sd/--show-dump-id switch, which means show the hex dump_id
|
|
817 and quit */
|
|
818 if (argmatch (argv, argc, "-sd", "--show-dump-id", 0, NULL, &skip_args))
|
442
|
819 {
|
|
820 #ifdef PDUMP
|
|
821 printf ("%08x\n", dump_id);
|
|
822 #else
|
446
|
823 printf ("Portable dumper not configured; -sd just forces exit.\n");
|
442
|
824 #endif
|
|
825 exit (0);
|
|
826 }
|
771
|
827
|
428
|
828 /* Handle the -t switch, which specifies filename to use as terminal */
|
|
829 {
|
771
|
830 Extbyte *term;
|
776
|
831 if (argmatch (argv, argc, "-t", "--terminal", 0, &term, &skip_args))
|
428
|
832 {
|
771
|
833 retry_close (0);
|
|
834 retry_close (1);
|
428
|
835 if (open (term, O_RDWR | OPEN_BINARY, 2) < 0)
|
|
836 fatal ("%s: %s", term, strerror (errno));
|
|
837 dup (0);
|
|
838 if (! isatty (0))
|
|
839 fatal ("%s: not a tty", term);
|
|
840
|
|
841 #if 0
|
|
842 stderr_out ("Using %s", ttyname (0));
|
|
843 #endif
|
|
844 stderr_out ("Using %s", term);
|
|
845 inhibit_window_system = 1; /* -t => -nw */
|
|
846 }
|
|
847 }
|
|
848
|
776
|
849 /* Handle the --no-dump-file/-nd switch, which means don't load the dump
|
|
850 file (ignored when not using pdump) */
|
|
851 if (argmatch (argv, argc, "-nd", "--no-dump-file", 0, NULL, &skip_args))
|
|
852 nodumpfile = 1;
|
442
|
853
|
428
|
854 /* Handle -nw switch */
|
776
|
855 if (argmatch (argv, argc, "-nw", "--no-windows", 0, NULL, &skip_args))
|
428
|
856 inhibit_window_system = 1;
|
|
857
|
|
858 /* Handle the -batch switch, which means don't do interactive display. */
|
776
|
859 if (argmatch (argv, argc, "-batch", "--batch", 0, NULL, &skip_args))
|
428
|
860 {
|
|
861 #if 0 /* I don't think this is correct. */
|
|
862 inhibit_autoloads = 1;
|
|
863 #endif
|
|
864 noninteractive = 1;
|
|
865 }
|
|
866
|
771
|
867 #ifdef WIN32_NATIVE
|
|
868 /* Handle the -nuni switch, which forces XEmacs to use the ANSI
|
|
869 versions of Unicode-split API's even on Windows NT, which has
|
|
870 full Unicode support. This helps flush out problems in the code
|
|
871 we've written to convert between ANSI and Unicode. */
|
776
|
872 if (argmatch (argv, argc, "-nuni", "--no-unicode-lib-calls", 0, NULL,
|
771
|
873 &skip_args))
|
|
874 no_mswin_unicode_lib_calls = 1;
|
|
875 #endif /* WIN32_NATIVE */
|
|
876
|
428
|
877 if (argmatch (argv, argc, "-debug-paths", "--debug-paths",
|
776
|
878 0, NULL, &skip_args))
|
|
879 debug_paths = 1;
|
|
880
|
|
881 /* Handle (maybe partially) some inhibiting flags. Packages are searched
|
|
882 prior to the rest of the command line being parsed in startup.el. */
|
|
883
|
|
884 if (argmatch (argv, argc, "-no-packages", "--no-packages",
|
|
885 0, NULL, &skip_args))
|
|
886 {
|
|
887 inhibit_all_packages = 1;
|
|
888 inhibit_early_packages = 1;
|
|
889 vanilla_inhibiting = 1;
|
|
890 }
|
|
891
|
428
|
892 if (argmatch (argv, argc, "-no-early-packages", "--no-early-packages",
|
776
|
893 0, NULL, &skip_args))
|
|
894 inhibit_early_packages = 1;
|
|
895
|
|
896 #ifdef HAVE_SHLIB
|
|
897 if (argmatch (argv, argc, "-no-site-modules", "--no-site-modules",
|
|
898 0, NULL, &skip_args))
|
|
899 #endif
|
|
900 inhibit_site_modules = 1;
|
|
901
|
|
902 if (argmatch (argv, argc, "-vanilla", "--vanilla",
|
|
903 0, NULL, &skip_args))
|
428
|
904 {
|
|
905 inhibit_early_packages = 1;
|
776
|
906 vanilla_inhibiting = 1;
|
428
|
907 }
|
|
908
|
|
909 if (argmatch (argv, argc, "-no-autoloads", "--no-autoloads",
|
776
|
910 0, NULL, &skip_args))
|
428
|
911 {
|
|
912 inhibit_autoloads = 1;
|
776
|
913 inhibit_early_packages = 1;
|
|
914 vanilla_inhibiting = 1;
|
428
|
915 }
|
|
916
|
|
917 /* Partially handle the -version and -help switches: they imply -batch,
|
|
918 but are not removed from the list. */
|
|
919 if (argmatch (argv, argc, "-help", "--help", 3, NULL, &skip_args))
|
|
920 noninteractive = 1, skip_args--;
|
|
921
|
|
922 if (argmatch (argv, argc, "-version", "--version", 3, NULL, &skip_args) ||
|
|
923 argmatch (argv, argc, "-V", 0, 2, NULL, &skip_args))
|
|
924 noninteractive = 1, skip_args--;
|
|
925
|
|
926 /* Now, figure out which type of console is our first console. */
|
|
927
|
|
928 display_arg = 0;
|
|
929
|
|
930 if (noninteractive)
|
|
931 display_use = "stream";
|
|
932 else
|
|
933 display_use = "tty";
|
|
934
|
|
935 #ifndef HAVE_TTY
|
|
936 if (inhibit_window_system)
|
|
937 fatal ("Sorry, this XEmacs was not compiled with TTY support");
|
|
938 #endif
|
|
939
|
|
940 #ifdef HAVE_WINDOW_SYSTEM
|
|
941 /* Stupid kludge to catch command-line display spec. We can't
|
|
942 handle this argument entirely in window-system-dependent code
|
|
943 because we don't even know which window-system-dependent code
|
|
944 to run until we've recognized this argument. */
|
|
945 if (!inhibit_window_system && !noninteractive)
|
|
946 {
|
|
947 #ifdef HAVE_X_WINDOWS
|
|
948 char *dpy = 0;
|
|
949 int count_before = skip_args;
|
|
950
|
|
951 if (argmatch (argv, argc, "-d", "--display", 3, &dpy, &skip_args) ||
|
|
952 argmatch (argv, argc, "-display", 0, 3, &dpy, &skip_args))
|
|
953 {
|
|
954 display_arg = 1;
|
|
955 display_use = "x";
|
|
956 }
|
|
957 /* If we have the form --display=NAME,
|
|
958 convert it into -d name.
|
|
959 This requires inserting a new element into argv. */
|
|
960 if (dpy != 0 && skip_args - count_before == 1)
|
|
961 {
|
|
962 char **new = (char **) xmalloc (sizeof (char *) * (argc + 2));
|
|
963 int j;
|
|
964
|
|
965 for (j = 0; j < count_before + 1; j++)
|
|
966 new[j] = argv[j];
|
|
967 new[count_before + 1] = "-d";
|
|
968 new[count_before + 2] = dpy;
|
|
969 for (j = count_before + 2; j <argc; j++)
|
|
970 new[j + 1] = argv[j];
|
|
971 argv = new;
|
|
972 argc++;
|
|
973 }
|
|
974 /* Change --display to -d, when its arg is separate. */
|
|
975 else if (dpy != 0 && skip_args > count_before
|
|
976 && argv[count_before + 1][1] == '-')
|
|
977 argv[count_before + 1] = "-d";
|
|
978
|
|
979 /* Don't actually discard this arg. */
|
|
980 skip_args = count_before;
|
|
981
|
|
982 /* If there is a non-empty environment var DISPLAY, set
|
|
983 `display_use', but not `display_arg', which is only to be set
|
|
984 if the display was specified on the command line. */
|
|
985 if ((dpy = getenv ("DISPLAY")) && dpy[0])
|
|
986 display_use = "x";
|
|
987
|
|
988 #endif /* HAVE_X_WINDOWS */
|
462
|
989 #ifdef HAVE_GTK
|
|
990 {
|
|
991 char *dpy = getenv ("DISPLAY");
|
|
992 if (dpy && dpy[0])
|
|
993 display_use = "gtk";
|
|
994 }
|
|
995 #endif
|
428
|
996 #ifdef HAVE_MS_WINDOWS
|
771
|
997 if (strcmp (display_use, "x") != 0)
|
428
|
998 display_use = "mswindows";
|
|
999 #endif /* HAVE_MS_WINDOWS */
|
|
1000 }
|
|
1001 #endif /* HAVE_WINDOW_SYSTEM */
|
|
1002
|
|
1003 noninteractive1 = noninteractive;
|
|
1004
|
|
1005 /****** Now initialize everything *******/
|
|
1006
|
|
1007 /* First, do really basic environment initialization -- catching signals
|
|
1008 and the like. These functions have no dependence on any part of
|
|
1009 the Lisp engine and need to be done both at dump time and at run time. */
|
|
1010
|
|
1011 init_signals_very_early ();
|
|
1012 init_data_very_early (); /* Catch math errors. */
|
|
1013 #ifdef LISP_FLOAT_TYPE
|
|
1014 init_floatfns_very_early (); /* Catch floating-point math errors. */
|
|
1015 #endif
|
|
1016 init_process_times_very_early (); /* Initialize our process timers.
|
|
1017 As early as possible, of course,
|
|
1018 so we can be fairly accurate. */
|
771
|
1019
|
|
1020 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
1021 init_win32_very_early ();
|
|
1022 #endif
|
657
|
1023 #ifdef HAVE_MS_WINDOWS
|
771
|
1024 /* Depends on XEUNICODE_P, only accurate after the previous call */
|
|
1025 init_mswindows_dde_very_early (); /* DDE needs to be initialized early so
|
|
1026 that the client doesn't give up
|
|
1027 waiting. */
|
657
|
1028 #endif
|
428
|
1029
|
|
1030 /* Now initialize the Lisp engine and the like. Done only during
|
|
1031 dumping. No dependence on anything that may be in the user's
|
|
1032 environment when the dumped XEmacs is run.
|
|
1033
|
|
1034 We try to do things in an order that minimizes the non-obvious
|
|
1035 dependencies between functions. */
|
|
1036
|
|
1037 /* purify_flag 1 is correct even if CANNOT_DUMP.
|
|
1038 * loadup.el will set to nil at end. */
|
|
1039
|
|
1040 purify_flag = 0;
|
|
1041 #ifdef PDUMP
|
|
1042 if (restart)
|
|
1043 initialized = 1;
|
771
|
1044 else if (nodumpfile)
|
|
1045 {
|
|
1046 initialized = 0;
|
442
|
1047 purify_flag = 1;
|
771
|
1048 }
|
|
1049 else
|
|
1050 {
|
|
1051
|
|
1052 /* Keep command options from getting stomped.
|
|
1053
|
|
1054 Some LISP-visible options are changed by XEmacs _after_ the data is
|
|
1055 dumped in building a --pdump XEmacs, but _before_ it is restored in
|
|
1056 normal operation. Thus the restored values overwrite the values
|
|
1057 XEmacs is getting at run-time. Such variables must be saved here,
|
|
1058 and restored after loading the dumped data.
|
|
1059
|
776
|
1060 (Remember: Only LISP-visible options that are set up to this point
|
|
1061 need to be listed here.)
|
771
|
1062 */
|
|
1063
|
|
1064 /* noninteractive1 is saved in noninteractive, which isn't
|
|
1065 LISP-visible */
|
|
1066 int inhibit_early_packages_save = inhibit_early_packages;
|
|
1067 int inhibit_autoloads_save = inhibit_autoloads;
|
776
|
1068 int inhibit_all_packages_save = inhibit_all_packages;
|
|
1069 int vanilla_inhibiting_save = vanilla_inhibiting;
|
771
|
1070 int debug_paths_save = debug_paths;
|
776
|
1071 int inhibit_site_lisp_save = inhibit_site_lisp;
|
771
|
1072 int inhibit_site_modules_save = inhibit_site_modules;
|
|
1073
|
|
1074 initialized = pdump_load (argv[0]);
|
|
1075
|
|
1076 /* Now unstomp everything */
|
|
1077 noninteractive1 = noninteractive;
|
|
1078 inhibit_early_packages = inhibit_early_packages_save;
|
|
1079 inhibit_autoloads = inhibit_autoloads_save;
|
776
|
1080 inhibit_all_packages = inhibit_all_packages_save;
|
|
1081 vanilla_inhibiting = vanilla_inhibiting_save;
|
771
|
1082 debug_paths = debug_paths_save;
|
776
|
1083 inhibit_site_lisp = inhibit_site_lisp_save;
|
771
|
1084 inhibit_site_modules = inhibit_site_modules_save;
|
|
1085
|
|
1086 if (initialized)
|
|
1087 run_temacs_argc = -1;
|
|
1088 else
|
|
1089 purify_flag = 1;
|
|
1090 }
|
428
|
1091 #else
|
|
1092 if (!initialized)
|
|
1093 purify_flag = 1;
|
|
1094 #endif
|
|
1095
|
771
|
1096 if (initialized)
|
|
1097 {
|
|
1098 /* Reset some vars that were also set during loadup (we called
|
|
1099 these same functions below) */
|
|
1100 init_alloc_early ();
|
|
1101 }
|
|
1102
|
428
|
1103 if (!initialized)
|
|
1104 {
|
|
1105 /* Initialize things so that new Lisp objects
|
|
1106 can be created and objects can be staticpro'd.
|
|
1107 Must be basically the very first thing done
|
|
1108 because pretty much all of the initialization
|
|
1109 routines below create new objects. */
|
|
1110 init_alloc_once_early ();
|
|
1111
|
|
1112 /* Initialize Qnil, Qt, Qunbound, and the
|
|
1113 obarray. After this, symbols can be
|
442
|
1114 interned. This depends on init_alloc_once_early(). */
|
428
|
1115 init_symbols_once_early ();
|
|
1116
|
|
1117 /* Declare the basic symbols pertaining to errors,
|
442
|
1118 So that DEFERROR*() can be called. */
|
428
|
1119 init_errors_once_early ();
|
|
1120
|
|
1121 /* Make sure that opaque pointers can be created. */
|
|
1122 init_opaque_once_early ();
|
|
1123
|
771
|
1124 /* Make sure that hash tables can be created. */
|
|
1125 init_elhash_once_early ();
|
|
1126
|
|
1127 /* Make sure that eistrings can be created. */
|
|
1128 init_eistring_once_early ();
|
|
1129
|
|
1130 /* Initialize some vars that will also be reset post-dumping
|
|
1131 (see above) */
|
|
1132 init_alloc_early ();
|
|
1133
|
428
|
1134 /* Now declare all the symbols and define all the Lisp primitives.
|
|
1135
|
|
1136 The *only* thing that the syms_of_*() functions are allowed to do
|
442
|
1137 is call one of the following:
|
|
1138
|
|
1139 INIT_LRECORD_IMPLEMENTATION()
|
|
1140 defsymbol(), DEFSYMBOL(), or DEFSYMBOL_MULTIWORD_PREDICATE()
|
428
|
1141 defsubr() (i.e. DEFSUBR)
|
442
|
1142 deferror(), DEFERROR(), or DEFERROR_STANDARD()
|
|
1143 defkeyword() or DEFKEYWORD()
|
563
|
1144 Fput()
|
428
|
1145
|
|
1146 Order does not matter in these functions.
|
|
1147 */
|
|
1148
|
|
1149 syms_of_abbrev ();
|
|
1150 syms_of_alloc ();
|
|
1151 syms_of_buffer ();
|
|
1152 syms_of_bytecode ();
|
|
1153 syms_of_callint ();
|
|
1154 syms_of_callproc ();
|
|
1155 syms_of_casefiddle ();
|
|
1156 syms_of_casetab ();
|
|
1157 syms_of_chartab ();
|
|
1158 syms_of_cmdloop ();
|
|
1159 syms_of_cmds ();
|
|
1160 syms_of_console ();
|
|
1161 syms_of_data ();
|
|
1162 #ifdef DEBUG_XEMACS
|
|
1163 syms_of_debug ();
|
440
|
1164 syms_of_tests ();
|
428
|
1165 #endif /* DEBUG_XEMACS */
|
|
1166 syms_of_device ();
|
|
1167 #ifdef HAVE_DIALOGS
|
|
1168 syms_of_dialog ();
|
|
1169 #endif
|
|
1170 syms_of_dired ();
|
|
1171 syms_of_doc ();
|
|
1172 syms_of_editfns ();
|
|
1173 syms_of_elhash ();
|
|
1174 syms_of_emacs ();
|
|
1175 syms_of_eval ();
|
|
1176 #ifdef HAVE_X_WINDOWS
|
|
1177 syms_of_event_Xt ();
|
|
1178 #endif
|
462
|
1179 #ifdef HAVE_GTK
|
|
1180 syms_of_event_gtk ();
|
|
1181 #endif
|
428
|
1182 #ifdef HAVE_DRAGNDROP
|
|
1183 syms_of_dragdrop ();
|
|
1184 #endif
|
|
1185 syms_of_event_stream ();
|
|
1186 syms_of_events ();
|
|
1187 syms_of_extents ();
|
|
1188 syms_of_faces ();
|
|
1189 syms_of_fileio ();
|
|
1190 #ifdef CLASH_DETECTION
|
|
1191 syms_of_filelock ();
|
|
1192 #endif /* CLASH_DETECTION */
|
|
1193 syms_of_floatfns ();
|
|
1194 syms_of_fns ();
|
|
1195 syms_of_font_lock ();
|
|
1196 syms_of_frame ();
|
|
1197 syms_of_general ();
|
|
1198 syms_of_glyphs ();
|
|
1199 syms_of_glyphs_eimage ();
|
563
|
1200 syms_of_glyphs_shared ();
|
428
|
1201 syms_of_glyphs_widget ();
|
|
1202 syms_of_gui ();
|
|
1203 syms_of_gutter ();
|
|
1204 syms_of_indent ();
|
|
1205 syms_of_intl ();
|
|
1206 syms_of_keymap ();
|
|
1207 syms_of_lread ();
|
|
1208 syms_of_macros ();
|
|
1209 syms_of_marker ();
|
|
1210 syms_of_md5 ();
|
|
1211 #ifdef HAVE_DATABASE
|
|
1212 syms_of_database ();
|
|
1213 #endif
|
|
1214 #ifdef HAVE_MENUBARS
|
|
1215 syms_of_menubar ();
|
|
1216 #endif
|
|
1217 syms_of_minibuf ();
|
|
1218 #ifdef HAVE_SHLIB
|
|
1219 syms_of_module ();
|
|
1220 #endif
|
|
1221 syms_of_objects ();
|
|
1222 syms_of_print ();
|
|
1223 #if !defined (NO_SUBPROCESSES)
|
|
1224 syms_of_process ();
|
|
1225 #ifdef HAVE_WIN32_PROCESSES
|
|
1226 syms_of_process_nt ();
|
|
1227 #endif
|
|
1228 #endif
|
|
1229 syms_of_profile ();
|
|
1230 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
|
|
1231 syms_of_ralloc ();
|
|
1232 #endif /* HAVE_MMAP && REL_ALLOC */
|
|
1233 syms_of_rangetab ();
|
|
1234 syms_of_redisplay ();
|
|
1235 syms_of_search ();
|
|
1236 syms_of_select ();
|
|
1237 syms_of_signal ();
|
|
1238 syms_of_sound ();
|
|
1239 syms_of_specifier ();
|
|
1240 syms_of_symbols ();
|
|
1241 syms_of_syntax ();
|
|
1242 #ifdef HAVE_SCROLLBARS
|
|
1243 syms_of_scrollbar ();
|
|
1244 #endif
|
771
|
1245 syms_of_text ();
|
428
|
1246 #ifdef HAVE_TOOLBARS
|
|
1247 syms_of_toolbar ();
|
|
1248 #endif
|
|
1249 syms_of_undo ();
|
|
1250 syms_of_widget ();
|
|
1251 syms_of_window ();
|
|
1252
|
|
1253 #ifdef HAVE_TTY
|
|
1254 syms_of_console_tty ();
|
|
1255 syms_of_device_tty ();
|
771
|
1256 syms_of_frame_tty ();
|
428
|
1257 syms_of_objects_tty ();
|
|
1258 #endif
|
|
1259
|
462
|
1260 #ifdef HAVE_GTK
|
|
1261 syms_of_device_gtk ();
|
|
1262 syms_of_frame_gtk ();
|
|
1263 syms_of_glyphs_gtk ();
|
|
1264 syms_of_objects_gtk ();
|
|
1265 syms_of_ui_gtk ();
|
|
1266 syms_of_select_gtk ();
|
|
1267 #ifdef HAVE_DIALOGS
|
|
1268 syms_of_dialog_gtk ();
|
|
1269 #endif
|
|
1270 #ifdef HAVE_MENUBARS
|
|
1271 syms_of_menubar_gtk ();
|
|
1272 #endif
|
|
1273 syms_of_select_gtk ();
|
|
1274
|
771
|
1275 #ifdef HAVE_GUI_OBJECTS
|
462
|
1276 syms_of_gui_gtk ();
|
|
1277 #endif
|
|
1278 #endif /* HAVE_GTK */
|
|
1279
|
428
|
1280 #ifdef HAVE_X_WINDOWS
|
442
|
1281 #ifdef HAVE_BALLOON_HELP
|
440
|
1282 syms_of_balloon_x ();
|
442
|
1283 #endif
|
428
|
1284 syms_of_device_x ();
|
771
|
1285 #ifdef HAVE_X_DIALOGS
|
428
|
1286 syms_of_dialog_x ();
|
|
1287 #endif
|
|
1288 syms_of_frame_x ();
|
|
1289 syms_of_glyphs_x ();
|
|
1290 syms_of_objects_x ();
|
|
1291 #ifdef HAVE_MENUBARS
|
|
1292 syms_of_menubar_x ();
|
|
1293 #endif
|
440
|
1294 syms_of_select_x ();
|
771
|
1295 #ifdef HAVE_GUI_OBJECTS
|
428
|
1296 syms_of_gui_x ();
|
|
1297 #endif
|
771
|
1298 syms_of_intl_x ();
|
428
|
1299 #ifdef HAVE_XIM
|
|
1300 #ifdef XIM_XLIB
|
|
1301 syms_of_input_method_xlib ();
|
|
1302 #endif
|
|
1303 #endif /* HAVE_XIM */
|
|
1304 #endif /* HAVE_X_WINDOWS */
|
|
1305
|
|
1306 #ifdef HAVE_MS_WINDOWS
|
|
1307 syms_of_console_mswindows ();
|
|
1308 syms_of_device_mswindows ();
|
771
|
1309 #ifdef HAVE_DIALOGS
|
442
|
1310 syms_of_dialog_mswindows ();
|
771
|
1311 #endif
|
428
|
1312 syms_of_frame_mswindows ();
|
|
1313 syms_of_objects_mswindows ();
|
|
1314 syms_of_select_mswindows ();
|
|
1315 syms_of_glyphs_mswindows ();
|
771
|
1316 #ifdef HAVE_GUI_OBJECTS
|
440
|
1317 syms_of_gui_mswindows ();
|
771
|
1318 #endif
|
428
|
1319 #ifdef HAVE_MENUBARS
|
|
1320 syms_of_menubar_mswindows ();
|
|
1321 #endif
|
|
1322 #ifdef HAVE_SCROLLBARS
|
|
1323 syms_of_scrollbar_mswindows ();
|
|
1324 #endif
|
442
|
1325 #endif /* HAVE_MS_WINDOWS */
|
428
|
1326 #ifdef HAVE_MSW_C_DIRED
|
|
1327 syms_of_dired_mswindows ();
|
|
1328 #endif
|
442
|
1329 #ifdef WIN32_NATIVE
|
771
|
1330 syms_of_nt ();
|
428
|
1331 #endif
|
442
|
1332 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
1333 syms_of_win32 ();
|
|
1334 #endif
|
428
|
1335
|
771
|
1336 syms_of_file_coding ();
|
|
1337 syms_of_unicode ();
|
428
|
1338 #ifdef MULE
|
|
1339 syms_of_mule_ccl ();
|
|
1340 syms_of_mule_charset ();
|
771
|
1341 syms_of_mule_coding ();
|
428
|
1342 #ifdef HAVE_WNN
|
|
1343 syms_of_mule_wnn ();
|
|
1344 #endif
|
|
1345 #ifdef HAVE_CANNA
|
|
1346 syms_of_mule_canna ();
|
|
1347 #endif /* HAVE_CANNA */
|
|
1348 #endif /* MULE */
|
|
1349
|
771
|
1350 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
1351 syms_of_intl_win32 ();
|
|
1352 #endif
|
|
1353
|
428
|
1354 #ifdef SYMS_SYSTEM
|
|
1355 SYMS_SYSTEM;
|
|
1356 #endif
|
|
1357
|
|
1358 #ifdef SYMS_MACHINE
|
|
1359 SYMS_MACHINE;
|
|
1360 #endif
|
|
1361
|
|
1362 /*
|
|
1363 #if defined (GNU_MALLOC) && \
|
|
1364 defined (ERROR_CHECK_MALLOC) && \
|
|
1365 !defined (HAVE_LIBMCHECK)
|
|
1366 */
|
|
1367 /* Prior to XEmacs 21, this was `#if 0'ed out. -slb */
|
|
1368 #if defined (LOSING_GCC_DESTRUCTOR_FREE_BUG)
|
|
1369 syms_of_free_hook ();
|
|
1370 #endif
|
|
1371
|
|
1372 #ifdef TOOLTALK
|
|
1373 syms_of_tooltalk ();
|
|
1374 #endif
|
|
1375
|
|
1376 #ifdef SUNPRO
|
|
1377 syms_of_sunpro ();
|
|
1378 #endif
|
|
1379
|
|
1380 #ifdef HAVE_LDAP
|
|
1381 syms_of_eldap ();
|
|
1382 #endif
|
|
1383
|
|
1384 #ifdef HAVE_GPM
|
442
|
1385 syms_of_gpmevent ();
|
|
1386 #endif
|
|
1387
|
|
1388 #ifdef HAVE_POSTGRESQL
|
|
1389 syms_of_postgresql ();
|
428
|
1390 #endif
|
|
1391
|
|
1392 /* Now create the subtypes for the types that have them.
|
|
1393 We do this before the vars_*() because more symbols
|
|
1394 may get initialized here. */
|
|
1395
|
|
1396 /* Now initialize the console types and associated symbols.
|
|
1397 Other than the first function below, the functions may
|
|
1398 make exactly the following function/macro calls:
|
|
1399
|
|
1400 INITIALIZE_CONSOLE_TYPE()
|
|
1401 CONSOLE_HAS_METHOD()
|
|
1402
|
|
1403 For any given console type, the former macro must be called
|
|
1404 before the any calls to the latter macro. */
|
|
1405
|
|
1406 console_type_create ();
|
|
1407
|
|
1408 console_type_create_stream ();
|
|
1409
|
|
1410 #ifdef HAVE_TTY
|
|
1411 console_type_create_tty ();
|
|
1412 console_type_create_device_tty ();
|
|
1413 console_type_create_frame_tty ();
|
|
1414 console_type_create_objects_tty ();
|
|
1415 console_type_create_redisplay_tty ();
|
|
1416 #endif
|
|
1417
|
462
|
1418 #ifdef HAVE_GTK
|
|
1419 console_type_create_gtk ();
|
|
1420 console_type_create_select_gtk ();
|
|
1421 console_type_create_device_gtk ();
|
|
1422 console_type_create_frame_gtk ();
|
|
1423 console_type_create_objects_gtk ();
|
|
1424 console_type_create_glyphs_gtk ();
|
|
1425 console_type_create_redisplay_gtk ();
|
|
1426 #ifdef HAVE_MENUBARS
|
|
1427 console_type_create_menubar_gtk ();
|
|
1428 #endif
|
|
1429 #ifdef HAVE_SCROLLBARS
|
|
1430 console_type_create_scrollbar_gtk ();
|
|
1431 #endif
|
|
1432 #ifdef HAVE_TOOLBARS
|
|
1433 console_type_create_toolbar_gtk ();
|
|
1434 #endif
|
|
1435 #ifdef HAVE_DIALOGS
|
|
1436 console_type_create_dialog_gtk ();
|
|
1437 #endif
|
|
1438 #endif /* HAVE_GTK */
|
|
1439
|
428
|
1440 #ifdef HAVE_X_WINDOWS
|
|
1441 console_type_create_x ();
|
|
1442 console_type_create_device_x ();
|
|
1443 console_type_create_frame_x ();
|
|
1444 console_type_create_glyphs_x ();
|
|
1445 console_type_create_select_x ();
|
|
1446 #ifdef HAVE_MENUBARS
|
|
1447 console_type_create_menubar_x ();
|
|
1448 #endif
|
|
1449 console_type_create_objects_x ();
|
|
1450 console_type_create_redisplay_x ();
|
|
1451 #ifdef HAVE_SCROLLBARS
|
|
1452 console_type_create_scrollbar_x ();
|
|
1453 #endif
|
|
1454 #ifdef HAVE_TOOLBARS
|
|
1455 console_type_create_toolbar_x ();
|
|
1456 #endif
|
771
|
1457 #ifdef HAVE_X_DIALOGS
|
428
|
1458 console_type_create_dialog_x ();
|
|
1459 #endif
|
|
1460 #endif /* HAVE_X_WINDOWS */
|
|
1461
|
|
1462 #ifdef HAVE_MS_WINDOWS
|
|
1463 console_type_create_mswindows ();
|
|
1464 console_type_create_device_mswindows ();
|
|
1465 console_type_create_frame_mswindows ();
|
|
1466 console_type_create_objects_mswindows ();
|
|
1467 console_type_create_redisplay_mswindows ();
|
|
1468 console_type_create_glyphs_mswindows ();
|
|
1469 console_type_create_select_mswindows ();
|
|
1470 # ifdef HAVE_SCROLLBARS
|
|
1471 console_type_create_scrollbar_mswindows ();
|
|
1472 # endif
|
|
1473 #ifdef HAVE_MENUBARS
|
|
1474 console_type_create_menubar_mswindows ();
|
|
1475 #endif
|
|
1476 #ifdef HAVE_TOOLBARS
|
|
1477 console_type_create_toolbar_mswindows ();
|
|
1478 #endif
|
|
1479 #ifdef HAVE_DIALOGS
|
|
1480 console_type_create_dialog_mswindows ();
|
|
1481 #endif
|
|
1482 #endif
|
|
1483
|
|
1484 /* Now initialize the specifier types and associated symbols.
|
|
1485 Other than the first function below, the functions may
|
|
1486 make exactly the following function/macro calls:
|
|
1487
|
|
1488 INITIALIZE_SPECIFIER_TYPE()
|
|
1489 SPECIFIER_HAS_METHOD()
|
|
1490
|
|
1491 For any given specifier type, the former macro must be called
|
|
1492 before the any calls to the latter macro. */
|
|
1493
|
|
1494 specifier_type_create ();
|
|
1495
|
|
1496 specifier_type_create_image ();
|
|
1497 specifier_type_create_gutter ();
|
|
1498 specifier_type_create_objects ();
|
|
1499 #ifdef HAVE_TOOLBARS
|
|
1500 specifier_type_create_toolbar ();
|
|
1501 #endif
|
|
1502
|
771
|
1503 /* Now initialize the coding system types and associated symbols.
|
|
1504 Other than the first function below, the functions may
|
|
1505 make exactly the following function/macro calls:
|
|
1506
|
|
1507 INITIALIZE_CODING_SYSTEM_TYPE()
|
|
1508 CODING_SYSTEM_HAS_METHOD()
|
|
1509
|
|
1510 For any given coding system type, the former macro must be called
|
|
1511 before the any calls to the latter macro. */
|
|
1512
|
|
1513 coding_system_type_create ();
|
|
1514 coding_system_type_create_unicode ();
|
|
1515 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
1516 coding_system_type_create_intl_win32 ();
|
|
1517 #endif
|
|
1518 #ifdef MULE
|
|
1519 coding_system_type_create_mule_coding ();
|
|
1520 #endif
|
|
1521
|
428
|
1522 /* Now initialize the structure types and associated symbols.
|
|
1523 Other than the first function below, the functions may
|
|
1524 make exactly the following function/macro calls:
|
|
1525
|
|
1526 define_structure_type()
|
|
1527 define_structure_type_keyword()
|
|
1528
|
|
1529 */
|
|
1530
|
|
1531 structure_type_create ();
|
|
1532
|
|
1533 structure_type_create_chartab ();
|
|
1534 structure_type_create_faces ();
|
|
1535 structure_type_create_rangetab ();
|
|
1536 structure_type_create_hash_table ();
|
|
1537
|
|
1538 /* Now initialize the image instantiator formats and associated symbols.
|
|
1539 Other than the first function below, the functions may
|
|
1540 make exactly the following function/macro calls:
|
|
1541
|
|
1542 INITIALIZE_IMAGE_INSTANTIATOR_FORMAT()
|
|
1543 IIFORMAT_HAS_METHOD()
|
|
1544 IIFORMAT_VALID_KEYWORD()
|
|
1545
|
|
1546 For any given image instantiator format, the first macro must be
|
|
1547 called before the any calls to the other macros. */
|
|
1548
|
|
1549 image_instantiator_format_create ();
|
|
1550 image_instantiator_format_create_glyphs_eimage ();
|
|
1551 image_instantiator_format_create_glyphs_widget ();
|
|
1552 #ifdef HAVE_TTY
|
|
1553 image_instantiator_format_create_glyphs_tty ();
|
|
1554 #endif
|
|
1555 #ifdef HAVE_X_WINDOWS
|
|
1556 image_instantiator_format_create_glyphs_x ();
|
|
1557 #endif /* HAVE_X_WINDOWS */
|
|
1558 #ifdef HAVE_MS_WINDOWS
|
|
1559 image_instantiator_format_create_glyphs_mswindows ();
|
|
1560 #endif /* HAVE_MSWINDOWS_WINDOWS */
|
462
|
1561 #ifdef HAVE_GTK
|
|
1562 image_instantiator_format_create_glyphs_gtk ();
|
|
1563 #endif
|
428
|
1564
|
|
1565 /* Now initialize the lstream types and associated symbols.
|
|
1566 Other than the first function below, the functions may
|
|
1567 make exactly the following function/macro calls:
|
|
1568
|
|
1569 LSTREAM_HAS_METHOD()
|
|
1570
|
|
1571 */
|
|
1572
|
|
1573 lstream_type_create ();
|
|
1574 lstream_type_create_file_coding ();
|
|
1575 #if defined (HAVE_MS_WINDOWS) && !defined(HAVE_MSG_SELECT)
|
|
1576 lstream_type_create_mswindows_selectable ();
|
|
1577 #endif
|
|
1578
|
|
1579 /* Initialize processes implementation.
|
|
1580 The functions may make exactly the following function/macro calls:
|
|
1581
|
|
1582 PROCESS_HAS_METHOD()
|
|
1583 */
|
|
1584 #ifdef HAVE_UNIX_PROCESSES
|
|
1585 process_type_create_unix ();
|
|
1586 #endif
|
|
1587 #ifdef HAVE_WIN32_PROCESSES
|
|
1588 process_type_create_nt ();
|
|
1589 #endif
|
|
1590
|
|
1591 /* Now initialize most variables.
|
|
1592
|
|
1593 These functions may do exactly the following:
|
|
1594
|
771
|
1595 -- assigning a symbol or constant value to a variable
|
|
1596 -- using a global variable that has been initialized
|
|
1597 earlier on in the same function
|
|
1598 -- DEFVAR_INT()
|
|
1599 -- DEFVAR_LISP()
|
|
1600 -- DEFVAR_BOOL()
|
|
1601 -- DEFER_GETTEXT()
|
|
1602 -- staticpro*()
|
|
1603 -- xmalloc*(), xnew*(), and friends
|
|
1604 -- Dynarr_*()
|
|
1605 -- Blocktype_*()
|
|
1606 -- Fprovide(symbol)
|
|
1607 -- intern()
|
|
1608 -- Fput()
|
|
1609 -- dump_add_*()
|
|
1610 -- C library functions with no external dependencies, e.g. str*()
|
|
1611 -- defsymbol(), if it's absolutely necessary and you're sure that
|
|
1612 the symbol isn't referenced anywhere else in the initialization
|
|
1613 code
|
|
1614 -- Fset() on a symbol that is unbound
|
|
1615 -- Any of the object-creating functions in alloc.c: e.g.
|
|
1616 - make_string()
|
|
1617 - build_intstring()
|
|
1618 - build_string()
|
|
1619 - make_vector()
|
|
1620 - make_int()
|
|
1621 - make_char()
|
|
1622 - make_extent()
|
|
1623 - alloc_lcrecord()
|
|
1624 - Fcons()
|
|
1625 - listN()
|
|
1626 - make_lcrecord_list()
|
|
1627 -- make_opaque_ptr()
|
|
1628 -- make_lisp_hash_table() (not allowed in 21.4!)
|
|
1629 -- certain specifier creation functions (but be careful; see
|
|
1630 glyphs.c for examples)
|
428
|
1631
|
|
1632 perhaps a few others.
|
446
|
1633
|
771
|
1634 NO EXTERNAL-FORMAT CONVERSIONS.
|
|
1635
|
446
|
1636 NB: Initialization or assignment should not be done here to certain
|
|
1637 variables settable from the command line. See the comment above
|
|
1638 the call to pdump_load() in main_1(). This caveat should only
|
|
1639 apply to vars_of_emacs().
|
428
|
1640 */
|
|
1641
|
|
1642 /* Now allow Fprovide() statements to be made. */
|
|
1643 init_provide_once ();
|
|
1644
|
|
1645 /* Do that before any specifier creation (esp. vars_of_glyphs()) */
|
|
1646 vars_of_specifier ();
|
|
1647
|
|
1648 vars_of_abbrev ();
|
|
1649 vars_of_alloc ();
|
|
1650 vars_of_buffer ();
|
|
1651 vars_of_bytecode ();
|
|
1652 vars_of_callint ();
|
|
1653 vars_of_callproc ();
|
|
1654 vars_of_chartab ();
|
|
1655 vars_of_cmdloop ();
|
|
1656 vars_of_cmds ();
|
|
1657 vars_of_console ();
|
|
1658 vars_of_data ();
|
|
1659 #ifdef DEBUG_XEMACS
|
|
1660 vars_of_debug ();
|
440
|
1661 vars_of_tests ();
|
428
|
1662 #endif
|
|
1663 vars_of_console_stream ();
|
|
1664 vars_of_device ();
|
|
1665 #ifdef HAVE_DIALOGS
|
|
1666 vars_of_dialog ();
|
|
1667 #endif
|
|
1668 vars_of_dired ();
|
|
1669 vars_of_doc ();
|
|
1670 #ifdef HAVE_DRAGNDROP
|
|
1671 vars_of_dragdrop ();
|
|
1672 #endif
|
|
1673 vars_of_editfns ();
|
|
1674 vars_of_emacs ();
|
|
1675 vars_of_eval ();
|
771
|
1676 init_eval_early ();
|
428
|
1677
|
|
1678 #ifdef HAVE_X_WINDOWS
|
|
1679 vars_of_event_Xt ();
|
|
1680 #endif
|
|
1681 #if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
|
|
1682 vars_of_event_tty ();
|
|
1683 #endif
|
|
1684 #ifdef HAVE_MS_WINDOWS
|
|
1685 vars_of_event_mswindows ();
|
|
1686 #endif
|
|
1687 vars_of_event_stream ();
|
|
1688
|
|
1689 vars_of_events ();
|
|
1690 vars_of_extents ();
|
|
1691 vars_of_faces ();
|
771
|
1692 vars_of_file_coding ();
|
428
|
1693 vars_of_fileio ();
|
444
|
1694 #ifdef CLASH_DETECTION
|
|
1695 vars_of_filelock ();
|
|
1696 #endif
|
428
|
1697 vars_of_floatfns ();
|
771
|
1698 vars_of_fns ();
|
428
|
1699 vars_of_font_lock ();
|
|
1700 vars_of_frame ();
|
|
1701 vars_of_glyphs ();
|
|
1702 vars_of_glyphs_eimage ();
|
|
1703 vars_of_glyphs_widget ();
|
|
1704 vars_of_gui ();
|
|
1705 vars_of_gutter ();
|
|
1706 vars_of_indent ();
|
|
1707 vars_of_insdel ();
|
|
1708 vars_of_intl ();
|
771
|
1709 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
1710 vars_of_intl_win32 ();
|
|
1711 #endif
|
428
|
1712 #ifdef HAVE_XIM
|
|
1713 #ifdef XIM_MOTIF
|
|
1714 vars_of_input_method_motif ();
|
|
1715 #else /* XIM_XLIB */
|
|
1716 vars_of_input_method_xlib ();
|
|
1717 #endif
|
|
1718 #endif /* HAVE_XIM */
|
|
1719 vars_of_keymap ();
|
|
1720 vars_of_lread ();
|
|
1721 vars_of_lstream ();
|
|
1722 vars_of_macros ();
|
|
1723 vars_of_md5 ();
|
|
1724 #ifdef HAVE_DATABASE
|
|
1725 vars_of_database ();
|
|
1726 #endif
|
|
1727 #ifdef HAVE_MENUBARS
|
|
1728 vars_of_menubar ();
|
|
1729 #endif
|
|
1730 vars_of_minibuf ();
|
|
1731 #ifdef HAVE_SHLIB
|
|
1732 vars_of_module ();
|
|
1733 #endif
|
442
|
1734 #ifdef WIN32_NATIVE
|
440
|
1735 vars_of_nt ();
|
428
|
1736 vars_of_ntproc ();
|
|
1737 #endif
|
|
1738 vars_of_objects ();
|
|
1739 vars_of_print ();
|
|
1740
|
|
1741 #ifndef NO_SUBPROCESSES
|
|
1742 vars_of_process ();
|
|
1743 #ifdef HAVE_UNIX_PROCESSES
|
|
1744 vars_of_process_unix ();
|
|
1745 #endif
|
|
1746 #ifdef HAVE_WIN32_PROCESSES
|
|
1747 vars_of_process_nt ();
|
|
1748 #endif
|
|
1749 #endif
|
|
1750
|
|
1751 vars_of_profile ();
|
|
1752 #if defined (HAVE_MMAP) && defined (REL_ALLOC) && !defined(DOUG_LEA_MALLOC)
|
|
1753 vars_of_ralloc ();
|
|
1754 #endif /* HAVE_MMAP && REL_ALLOC */
|
|
1755 vars_of_redisplay ();
|
|
1756 #ifdef HAVE_SCROLLBARS
|
|
1757 vars_of_scrollbar ();
|
|
1758 #endif
|
|
1759 vars_of_search ();
|
|
1760 vars_of_select ();
|
|
1761 vars_of_sound ();
|
|
1762 vars_of_symbols ();
|
|
1763 vars_of_syntax ();
|
771
|
1764 vars_of_text ();
|
428
|
1765 #ifdef HAVE_TOOLBARS
|
|
1766 vars_of_toolbar ();
|
|
1767 #endif
|
|
1768 vars_of_undo ();
|
|
1769 vars_of_window ();
|
771
|
1770 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
1771 vars_of_win32 ();
|
|
1772 #endif
|
428
|
1773
|
|
1774 #ifdef HAVE_TTY
|
|
1775 vars_of_console_tty ();
|
|
1776 vars_of_frame_tty ();
|
|
1777 vars_of_objects_tty ();
|
|
1778 #endif
|
|
1779
|
462
|
1780 #ifdef HAVE_GTK
|
|
1781 vars_of_device_gtk ();
|
|
1782 #ifdef HAVE_DIALOGS
|
|
1783 vars_of_dialog_gtk ();
|
|
1784 #endif
|
|
1785 vars_of_event_gtk ();
|
|
1786 vars_of_frame_gtk ();
|
|
1787 vars_of_glyphs_gtk ();
|
|
1788 vars_of_ui_gtk ();
|
|
1789 #ifdef HAVE_MENUBARS
|
|
1790 vars_of_menubar_gtk ();
|
|
1791 #endif
|
|
1792 vars_of_objects_gtk ();
|
|
1793 vars_of_select_gtk ();
|
|
1794 #ifdef HAVE_SCROLLBARS
|
|
1795 vars_of_scrollbar_gtk ();
|
|
1796 #endif
|
|
1797 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_DIALOGS) || defined (HAVE_TOOLBARS)
|
|
1798 vars_of_gui_gtk ();
|
|
1799 #endif
|
|
1800 #endif /* HAVE_GTK */
|
|
1801
|
428
|
1802 #ifdef HAVE_X_WINDOWS
|
442
|
1803 #ifdef HAVE_BALLOON_HELP
|
440
|
1804 vars_of_balloon_x ();
|
442
|
1805 #endif
|
428
|
1806 vars_of_device_x ();
|
771
|
1807 #ifdef HAVE_X_DIALOGS
|
428
|
1808 vars_of_dialog_x ();
|
|
1809 #endif
|
|
1810 vars_of_frame_x ();
|
|
1811 vars_of_glyphs_x ();
|
|
1812 #ifdef HAVE_MENUBARS
|
|
1813 vars_of_menubar_x ();
|
|
1814 #endif
|
|
1815 vars_of_objects_x ();
|
440
|
1816 vars_of_select_x ();
|
428
|
1817 #ifdef HAVE_SCROLLBARS
|
|
1818 vars_of_scrollbar_x ();
|
|
1819 #endif
|
771
|
1820 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
|
428
|
1821 vars_of_gui_x ();
|
|
1822 #endif
|
440
|
1823 #endif /* HAVE_X_WINDOWS */
|
428
|
1824
|
462
|
1825
|
428
|
1826 #ifdef HAVE_MS_WINDOWS
|
|
1827 vars_of_device_mswindows ();
|
|
1828 vars_of_console_mswindows ();
|
|
1829 vars_of_frame_mswindows ();
|
|
1830 vars_of_objects_mswindows ();
|
|
1831 vars_of_select_mswindows ();
|
|
1832 vars_of_glyphs_mswindows ();
|
|
1833 #ifdef HAVE_SCROLLBARS
|
|
1834 vars_of_scrollbar_mswindows ();
|
|
1835 #endif
|
|
1836 #ifdef HAVE_MENUBARS
|
|
1837 vars_of_menubar_mswindows ();
|
|
1838 #endif
|
|
1839 #ifdef HAVE_MSW_C_DIRED
|
|
1840 vars_of_dired_mswindows ();
|
|
1841 #endif
|
|
1842 #ifdef HAVE_DIALOGS
|
|
1843 vars_of_dialog_mswindows ();
|
|
1844 #endif
|
|
1845 #endif /* HAVE_MS_WINDOWS */
|
|
1846
|
|
1847 #ifdef MULE
|
|
1848 vars_of_mule_ccl ();
|
|
1849 vars_of_mule_charset ();
|
|
1850 #endif
|
|
1851 vars_of_file_coding ();
|
771
|
1852 vars_of_unicode ();
|
428
|
1853 #ifdef MULE
|
771
|
1854 vars_of_mule_coding ();
|
428
|
1855 #ifdef HAVE_WNN
|
|
1856 vars_of_mule_wnn ();
|
|
1857 #endif
|
|
1858 #ifdef HAVE_CANNA
|
|
1859 vars_of_mule_canna ();
|
|
1860 #endif /* HAVE_CANNA */
|
|
1861 #endif /* MULE */
|
|
1862
|
|
1863 #ifdef TOOLTALK
|
|
1864 vars_of_tooltalk ();
|
|
1865 #endif
|
|
1866
|
|
1867 #ifdef SUNPRO
|
|
1868 vars_of_sunpro ();
|
|
1869 #endif
|
|
1870
|
|
1871 #ifdef HAVE_LDAP
|
|
1872 vars_of_eldap ();
|
|
1873 #endif
|
|
1874
|
442
|
1875 #ifdef HAVE_POSTGRESQL
|
771
|
1876 vars_of_postgresql ();
|
442
|
1877 #endif
|
|
1878
|
428
|
1879 #ifdef HAVE_GPM
|
442
|
1880 vars_of_gpmevent ();
|
428
|
1881 #endif
|
|
1882
|
|
1883 /* Now initialize any specifier variables. We do this later
|
|
1884 because it has some dependence on the vars initialized
|
|
1885 above.
|
|
1886
|
|
1887 These functions should *only* initialize specifier variables,
|
|
1888 and may make use of the following functions/macros in addition
|
|
1889 to the ones listed above:
|
|
1890
|
|
1891 DEFVAR_SPECIFIER()
|
|
1892 Fmake_specifier()
|
|
1893 set_specifier_fallback()
|
|
1894 set_specifier_caching()
|
|
1895 */
|
|
1896
|
|
1897 specifier_vars_of_glyphs ();
|
|
1898 specifier_vars_of_gutter ();
|
|
1899 #ifdef HAVE_MENUBARS
|
|
1900 specifier_vars_of_menubar ();
|
|
1901 #endif
|
|
1902 specifier_vars_of_redisplay ();
|
|
1903 #ifdef HAVE_SCROLLBARS
|
|
1904 specifier_vars_of_scrollbar ();
|
|
1905 #endif
|
|
1906 #ifdef HAVE_TOOLBARS
|
|
1907 specifier_vars_of_toolbar ();
|
|
1908 #endif
|
|
1909 specifier_vars_of_window ();
|
|
1910
|
|
1911 /* Now comes all the rest of the variables that couldn't
|
|
1912 be handled above. There may be dependencies on variables
|
|
1913 initialized above, and dependencies between one complex_vars_()
|
|
1914 function and another. */
|
|
1915
|
|
1916 #ifdef MULE
|
|
1917 /* These two depend on hash tables and various variables declared
|
|
1918 earlier. The second may also depend on the first. */
|
|
1919 complex_vars_of_mule_charset ();
|
|
1920 #endif
|
|
1921 complex_vars_of_file_coding ();
|
771
|
1922 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
1923 complex_vars_of_intl_win32 ();
|
428
|
1924 #endif
|
|
1925
|
771
|
1926 /* Calls Fmake_range_table(). */
|
|
1927 complex_vars_of_regex ();
|
|
1928 /* Calls Fmake_range_table(). */
|
|
1929 complex_vars_of_search ();
|
|
1930
|
|
1931 /* Depends on specifiers. */
|
|
1932 complex_vars_of_faces ();
|
|
1933
|
428
|
1934 /* This calls allocate_glyph(), which creates specifiers
|
|
1935 and also relies on a variable (Vthe_nothing_vector) initialized
|
771
|
1936 above. */
|
428
|
1937 complex_vars_of_glyphs ();
|
|
1938
|
|
1939 /* These rely on the glyphs just created in the previous function,
|
|
1940 and call Fadd_spec_to_specifier(), which relies on various
|
|
1941 variables initialized above. */
|
462
|
1942 #ifdef HAVE_GTK
|
|
1943 complex_vars_of_glyphs_gtk ();
|
|
1944 #endif
|
428
|
1945 #ifdef HAVE_X_WINDOWS
|
|
1946 complex_vars_of_glyphs_x ();
|
|
1947 #endif
|
|
1948 #ifdef HAVE_MS_WINDOWS
|
|
1949 complex_vars_of_glyphs_mswindows ();
|
|
1950 #endif
|
|
1951
|
|
1952 /* This calls Fmake_glyph_internal(). */
|
|
1953 complex_vars_of_alloc ();
|
|
1954
|
|
1955 /* This calls Fmake_glyph_internal(). */
|
|
1956 #ifdef HAVE_MENUBARS
|
|
1957 complex_vars_of_menubar ();
|
|
1958 #endif
|
|
1959
|
617
|
1960 #ifdef HAVE_SCROLLBARS
|
428
|
1961 /* This calls Fmake_glyph_internal(). */
|
|
1962 complex_vars_of_scrollbar ();
|
617
|
1963 #ifdef HAVE_MS_WINDOWS
|
|
1964 /* Calls make_lisp_hash_table(). */
|
|
1965 complex_vars_of_scrollbar_mswindows ();
|
|
1966 #endif
|
428
|
1967 #endif
|
|
1968
|
|
1969 /* This calls allocate_glyph(). */
|
|
1970 complex_vars_of_frame ();
|
|
1971
|
|
1972 /* This calls Fcopy_category_table() under Mule, which calls who
|
|
1973 knows what. */
|
|
1974 complex_vars_of_chartab ();
|
|
1975
|
|
1976 /* This calls set_string_char(), which (under Mule) depends on the
|
|
1977 charsets being initialized. */
|
|
1978 complex_vars_of_casetab ();
|
|
1979
|
|
1980 /* This calls Fcopy_syntax_table(), which relies on char tables. */
|
|
1981 complex_vars_of_syntax ();
|
|
1982
|
|
1983 /* This initializes buffer-local variables, sets things up so
|
|
1984 that buffers can be created, and creates a couple of basic
|
|
1985 buffers. This depends on Vstandard_syntax_table and
|
|
1986 Vstandard_category_table (initialized in the previous
|
|
1987 functions), as well as a whole horde of variables that may
|
|
1988 have been initialized above. */
|
|
1989 complex_vars_of_buffer ();
|
|
1990
|
|
1991 /* This initializes console-local variables. */
|
|
1992 complex_vars_of_console ();
|
|
1993
|
|
1994 /* This creates a couple more buffers, and depends on the
|
|
1995 previous function. */
|
|
1996 complex_vars_of_minibuf ();
|
|
1997
|
|
1998 /* These two might call Ffile_name_as_directory(), which
|
|
1999 might depend on all sorts of things; I'm not sure. */
|
|
2000 complex_vars_of_emacs ();
|
|
2001
|
|
2002 /* This creates a couple of basic keymaps and depends on Lisp
|
|
2003 hash tables and Ffset() (both of which depend on some variables
|
|
2004 initialized in the vars_of_*() section) and possibly other
|
|
2005 stuff. */
|
|
2006 complex_vars_of_keymap ();
|
|
2007
|
|
2008 #ifdef ERROR_CHECK_GC
|
|
2009 {
|
|
2010 extern int always_gc;
|
|
2011 if (always_gc) /* purification debugging hack */
|
|
2012 garbage_collect_1 ();
|
|
2013 }
|
|
2014 #endif
|
|
2015 #ifdef PDUMP
|
771
|
2016 }
|
|
2017 else if (!restart) /* after successful pdump_load()
|
|
2018 (note, we are inside ifdef PDUMP) */
|
|
2019 {
|
428
|
2020 reinit_alloc_once_early ();
|
440
|
2021 reinit_symbols_once_early ();
|
428
|
2022 reinit_opaque_once_early ();
|
|
2023
|
|
2024 reinit_console_type_create_stream ();
|
|
2025 #ifdef HAVE_TTY
|
|
2026 reinit_console_type_create_tty ();
|
|
2027 #endif
|
|
2028 #ifdef HAVE_X_WINDOWS
|
|
2029 reinit_console_type_create_x ();
|
|
2030 reinit_console_type_create_device_x ();
|
|
2031 #endif
|
|
2032 #ifdef HAVE_MS_WINDOWS
|
|
2033 reinit_console_type_create_mswindows ();
|
|
2034 #endif
|
462
|
2035 #ifdef HAVE_GTK
|
|
2036 reinit_console_type_create_gtk ();
|
|
2037 #endif
|
428
|
2038
|
|
2039 reinit_specifier_type_create ();
|
|
2040 reinit_specifier_type_create_image ();
|
|
2041 reinit_specifier_type_create_gutter ();
|
|
2042 reinit_specifier_type_create_objects ();
|
|
2043 #ifdef HAVE_TOOLBARS
|
|
2044 reinit_specifier_type_create_toolbar ();
|
|
2045 #endif
|
|
2046
|
|
2047 structure_type_create ();
|
|
2048
|
771
|
2049 reinit_coding_system_type_create ();
|
|
2050 reinit_coding_system_type_create_unicode ();
|
|
2051 #ifdef HAVE_WIN32_CODING_SYSTEMS
|
|
2052 reinit_coding_system_type_create_intl_win32 ();
|
|
2053 #endif
|
|
2054 #ifdef MULE
|
|
2055 reinit_coding_system_type_create_mule_coding ();
|
|
2056 #endif
|
|
2057
|
428
|
2058 structure_type_create_chartab ();
|
|
2059 structure_type_create_faces ();
|
|
2060 structure_type_create_rangetab ();
|
|
2061 structure_type_create_hash_table ();
|
|
2062
|
|
2063 lstream_type_create ();
|
|
2064 lstream_type_create_file_coding ();
|
771
|
2065 #if defined (HAVE_MS_WINDOWS) && !defined (HAVE_MSG_SELECT)
|
428
|
2066 lstream_type_create_mswindows_selectable ();
|
|
2067 #endif
|
|
2068 #ifdef HAVE_UNIX_PROCESSES
|
|
2069 process_type_create_unix ();
|
|
2070 #endif
|
|
2071 #ifdef HAVE_WIN32_PROCESSES
|
|
2072 process_type_create_nt ();
|
|
2073 #endif
|
|
2074
|
|
2075 reinit_vars_of_buffer ();
|
|
2076 reinit_vars_of_console ();
|
|
2077 #ifdef DEBUG_XEMACS
|
|
2078 reinit_vars_of_debug ();
|
|
2079 #endif
|
|
2080 reinit_vars_of_device ();
|
|
2081 reinit_vars_of_eval ();
|
|
2082 #if defined(HAVE_TTY) && (defined (DEBUG_TTY_EVENT_STREAM) || !defined (HAVE_X_WINDOWS))
|
|
2083 reinit_vars_of_event_tty ();
|
|
2084 #endif
|
|
2085 reinit_vars_of_event_stream ();
|
|
2086 reinit_vars_of_events ();
|
|
2087 reinit_vars_of_extents ();
|
771
|
2088 reinit_vars_of_file_coding ();
|
442
|
2089 reinit_vars_of_fileio ();
|
428
|
2090 reinit_vars_of_font_lock ();
|
|
2091 reinit_vars_of_glyphs ();
|
|
2092 reinit_vars_of_glyphs_widget ();
|
|
2093 reinit_vars_of_insdel ();
|
|
2094 reinit_vars_of_lread ();
|
|
2095 reinit_vars_of_lstream ();
|
|
2096 reinit_vars_of_minibuf ();
|
438
|
2097 #ifdef HAVE_SHLIB
|
428
|
2098 reinit_vars_of_module ();
|
438
|
2099 #endif
|
428
|
2100 reinit_vars_of_objects ();
|
|
2101 reinit_vars_of_print ();
|
|
2102 reinit_vars_of_search ();
|
771
|
2103 reinit_vars_of_text ();
|
428
|
2104 reinit_vars_of_undo ();
|
771
|
2105 reinit_vars_of_unicode ();
|
428
|
2106 reinit_vars_of_window ();
|
|
2107
|
|
2108 #ifdef HAVE_MS_WINDOWS
|
788
|
2109 reinit_vars_of_event_mswindows ();
|
428
|
2110 reinit_vars_of_frame_mswindows ();
|
788
|
2111 reinit_vars_of_object_mswindows ();
|
428
|
2112 #endif
|
|
2113
|
462
|
2114 #ifdef HAVE_GTK
|
788
|
2115 reinit_vars_of_event_gtk ();
|
462
|
2116 reinit_vars_of_menubar_gtk ();
|
|
2117 #endif
|
|
2118
|
428
|
2119 #ifdef HAVE_X_WINDOWS
|
|
2120 reinit_vars_of_device_x ();
|
788
|
2121 reinit_vars_of_event_Xt ();
|
438
|
2122 #ifdef HAVE_SCROLLBARS
|
|
2123 reinit_vars_of_scrollbar_x ();
|
440
|
2124 #endif
|
428
|
2125 #ifdef HAVE_MENUBARS
|
|
2126 reinit_vars_of_menubar_x ();
|
|
2127 #endif
|
440
|
2128 reinit_vars_of_select_x ();
|
771
|
2129 #if defined (HAVE_MENUBARS) || defined (HAVE_SCROLLBARS) || defined (HAVE_X_DIALOGS) || defined (HAVE_TOOLBARS)
|
428
|
2130 reinit_vars_of_gui_x ();
|
|
2131 #endif
|
440
|
2132 #endif /* HAVE_X_WINDOWS */
|
428
|
2133
|
771
|
2134 #ifdef MULE
|
|
2135 reinit_vars_of_mule_coding ();
|
|
2136 #endif
|
617
|
2137 #if defined (MULE) && defined (HAVE_WNN)
|
428
|
2138 reinit_vars_of_mule_wnn ();
|
|
2139 #endif
|
|
2140
|
771
|
2141 reinit_complex_vars_of_buffer_runtime_only ();
|
|
2142 reinit_complex_vars_of_console_runtime_only ();
|
428
|
2143 reinit_complex_vars_of_minibuf ();
|
440
|
2144 #endif /* PDUMP */
|
428
|
2145 }
|
|
2146
|
|
2147 /* CONGRATULATIONS!!! We have successfully initialized the Lisp
|
|
2148 engine. */
|
|
2149
|
|
2150 if (initialized)
|
771
|
2151 init_eval_early ();
|
|
2152
|
|
2153 #ifdef MULE
|
|
2154 init_mule_charset ();
|
428
|
2155 #endif
|
|
2156
|
|
2157 /* Now do further initialization/setup of stuff that is not needed by the
|
|
2158 syms_of_() routines. This involves stuff that only is enabled in
|
|
2159 an interactive run (redisplay, user input, etc.) and stuff that is
|
|
2160 not needed until we start loading Lisp code (the reader). A lot
|
|
2161 of this stuff involves querying the current environment and needs
|
771
|
2162 to be done both at dump time and at run time. Some will be done
|
|
2163 only at run time, by querying the `initialized' variable. */
|
|
2164
|
|
2165 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
2166 init_intl_win32 (); /* Under Windows, determine whether we use Unicode
|
|
2167 or ANSI to call the system routines -- i.e.
|
|
2168 determine what the coding system `mswindows-tstr'
|
|
2169 is aliased to */
|
|
2170 #endif
|
|
2171 init_buffer_1 (); /* Create *scratch* buffer; init_intl() is going to
|
|
2172 call Lisp code (the very first code we call),
|
|
2173 and needs a current buffer */
|
|
2174 #ifdef MULE
|
|
2175 init_intl (); /* Figure out the locale and set native and
|
|
2176 file-name coding systems, initialize the Unicode tables
|
|
2177 so that we will be able to process non-ASCII from here
|
|
2178 on out! */
|
428
|
2179 #endif
|
|
2180
|
|
2181 init_callproc (); /* Set up the process environment (so that egetenv
|
|
2182 works), the basic directory variables
|
|
2183 (exec-directory and so on), and stuff
|
|
2184 related to subprocesses. This should be
|
|
2185 first because many of the functions below
|
|
2186 call egetenv() to get environment variables. */
|
771
|
2187
|
|
2188 #ifdef WIN32_NATIVE
|
|
2189 /*
|
|
2190 * For Win32, call init_environment() to properly enter environment/registry
|
|
2191 * variables into Vprocess_environment.
|
|
2192 */
|
|
2193 init_environment ();
|
|
2194 #endif
|
|
2195
|
|
2196 init_initial_directory (); /* get the directory to use for the
|
|
2197 "*scratch*" buffer, etc. */
|
|
2198
|
428
|
2199 init_lread (); /* Set up the Lisp reader. */
|
442
|
2200 init_cmdargs (argc, (Extbyte **) argv,
|
|
2201 skip_args); /* Create list Vcommand_line_args */
|
771
|
2202 init_buffer_2 (); /* Set default directory of *scratch* buffer */
|
428
|
2203
|
442
|
2204 #ifdef WIN32_NATIVE
|
771
|
2205 init_ntproc ();
|
|
2206 init_select_mswindows ();
|
428
|
2207 #endif
|
|
2208
|
|
2209 init_redisplay (); /* Determine terminal type.
|
|
2210 init_sys_modes uses results */
|
438
|
2211 init_frame ();
|
428
|
2212 init_event_stream (); /* Set up so we can get user input. */
|
|
2213 init_macros (); /* set up so we can run macros. */
|
|
2214 init_editfns (); /* Determine the name of the user we're running as */
|
|
2215 init_xemacs_process (); /* set up for calling subprocesses */
|
|
2216 #ifdef SUNPRO
|
|
2217 init_sunpro (); /* Set up Sunpro usage tracking */
|
|
2218 #endif
|
442
|
2219 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
2220 init_win32 ();
|
|
2221 #endif
|
428
|
2222 #if defined (HAVE_NATIVE_SOUND) && defined (hp9000s800)
|
|
2223 init_hpplay ();
|
|
2224 #endif
|
771
|
2225 #ifdef HAVE_POSTGRESQL
|
|
2226 /* Set some values taken from environment variables */
|
|
2227 init_postgresql_from_environment ();
|
|
2228 #endif
|
428
|
2229 #ifdef HAVE_TTY
|
|
2230 init_device_tty ();
|
|
2231 #endif
|
442
|
2232 init_console_stream (restart); /* Create the first console */
|
428
|
2233
|
|
2234 /* try to get the actual pathname of the exec file we are running */
|
|
2235 if (!restart)
|
771
|
2236 {
|
|
2237 Vinvocation_name = Fcar (Vcommand_line_args);
|
|
2238 if (XSTRING_DATA(Vinvocation_name)[0] == '-')
|
|
2239 {
|
|
2240 /* XEmacs as a login shell, oh goody! */
|
|
2241 Vinvocation_name = build_intstring (egetenv ("SHELL"));
|
|
2242 }
|
428
|
2243 Vinvocation_directory = Vinvocation_name;
|
|
2244
|
771
|
2245 if (!NILP (Ffile_name_directory (Vinvocation_name)))
|
|
2246 {
|
|
2247 /* invocation-name includes a directory component -- presumably it
|
|
2248 is relative to cwd, not $PATH */
|
|
2249 Vinvocation_directory = Fexpand_file_name (Vinvocation_name,
|
|
2250 Qnil);
|
|
2251 Vinvocation_path = Qnil;
|
|
2252 }
|
|
2253 else
|
|
2254 {
|
|
2255 Vinvocation_path = split_env_path ("PATH", NULL);
|
|
2256 locate_file (Vinvocation_path, Vinvocation_name,
|
|
2257 Vlisp_EXEC_SUFFIXES,
|
|
2258 &Vinvocation_directory, X_OK);
|
|
2259 }
|
|
2260
|
|
2261 if (NILP (Vinvocation_directory))
|
|
2262 Vinvocation_directory = Vinvocation_name;
|
|
2263
|
|
2264 Vinvocation_name = Ffile_name_nondirectory (Vinvocation_directory);
|
|
2265 Vinvocation_directory = Ffile_name_directory (Vinvocation_directory);
|
|
2266 }
|
428
|
2267
|
442
|
2268 #if defined(HAVE_SHLIB) && !defined(WIN32_NATIVE)
|
428
|
2269 /* This is Unix only. MS Windows NT has a library call that does
|
|
2270 The Right Thing on that system. Rumor has it, this must be
|
|
2271 called for GNU dld in temacs and xemacs. */
|
|
2272 {
|
|
2273 char *buf = (char *)alloca (XSTRING_LENGTH (Vinvocation_directory)
|
|
2274 + XSTRING_LENGTH (Vinvocation_name)
|
|
2275 + 2);
|
|
2276 sprintf (buf, "%s/%s", XSTRING_DATA (Vinvocation_directory),
|
|
2277 XSTRING_DATA (Vinvocation_name));
|
|
2278
|
771
|
2279 C_STRING_TO_EXTERNAL (buf, buf, Qfile_name);
|
428
|
2280 /* All we can do is cry if an error happens, so ignore it. */
|
|
2281 (void) dll_init (buf);
|
|
2282 }
|
|
2283 #endif
|
|
2284
|
|
2285 #if defined (LOCALTIME_CACHE) && defined (HAVE_TZSET)
|
|
2286 /* sun's localtime() has a bug. it caches the value of the time
|
|
2287 zone rather than looking it up every time. Since localtime() is
|
|
2288 called to bolt the undumping time into the undumped emacs, this
|
|
2289 results in localtime() ignoring the TZ environment variable.
|
|
2290 This flushes the new TZ value into localtime(). */
|
|
2291 tzset ();
|
|
2292 #endif /* LOCALTIME_CACHE and TZSET */
|
|
2293
|
|
2294 load_me = Qnil;
|
|
2295 if (!initialized)
|
|
2296 {
|
|
2297 /* Handle -l loadup-and-dump, args passed by Makefile. */
|
|
2298 if (argc > 2 + skip_args && !strcmp (argv[1 + skip_args], "-l"))
|
771
|
2299 /* !!#### need to be Mule-translating this, but later */
|
428
|
2300 load_me = build_string (argv[2 + skip_args]);
|
|
2301 }
|
|
2302
|
|
2303 #ifdef QUANTIFY
|
|
2304 if (initialized)
|
|
2305 quantify_start_recording_data ();
|
|
2306 #endif /* QUANTIFY */
|
|
2307
|
|
2308 initialized = 1;
|
771
|
2309 inhibit_non_essential_printing_operations = 0;
|
428
|
2310
|
|
2311 /* This never returns. */
|
|
2312 initial_command_loop (load_me);
|
|
2313 /* NOTREACHED */
|
|
2314 }
|
|
2315
|
|
2316
|
|
2317 /* Sort the args so we can find the most important ones
|
|
2318 at the beginning of argv. */
|
|
2319
|
|
2320 /* First, here's a table of all the standard options. */
|
|
2321
|
|
2322 struct standard_args
|
|
2323 {
|
442
|
2324 const char *name;
|
|
2325 const char *longname;
|
428
|
2326 int priority;
|
|
2327 int nargs;
|
|
2328 };
|
|
2329
|
442
|
2330 static const struct standard_args standard_args[] =
|
428
|
2331 {
|
776
|
2332 /* Handled by main_1 above: Each must have its own priority and must be
|
|
2333 in the order mentioned in main_1. */
|
442
|
2334 { "-sd", "--show-dump-id", 105, 0 },
|
|
2335 { "-t", "--terminal", 100, 1 },
|
|
2336 { "-nd", "--no-dump-file", 95, 0 },
|
428
|
2337 { "-nw", "--no-windows", 90, 0 },
|
|
2338 { "-batch", "--batch", 85, 0 },
|
771
|
2339 #ifdef WIN32_NATIVE
|
|
2340 { "-nuni", "--no-unicode-lib-calls", 83, 0 },
|
|
2341 #endif /* WIN32_NATIVE */
|
428
|
2342 { "-debug-paths", "--debug-paths", 82, 0 },
|
776
|
2343 { "-no-packages", "--no-packages", 81, 0 },
|
|
2344 { "-no-early-packages", "--no-early-packages", 80, 0 },
|
|
2345 { "-no-site-modules", "--no-site-modules", 78, 0 },
|
|
2346 { "-vanilla", "--vanilla", 76, 0 },
|
|
2347 { "-no-autoloads", "--no-autoloads", 74, 0 },
|
|
2348 { "-help", "--help", 72, 0 },
|
|
2349 { "-version", "--version", 70, 0 },
|
|
2350 { "-V", 0, 68, 0 },
|
|
2351 { "-d", "--display", 66, 1 },
|
|
2352 { "-display", 0, 64, 1 },
|
428
|
2353
|
|
2354 /* Handled by command-line-early in startup.el: */
|
|
2355 { "-q", "--no-init-file", 50, 0 },
|
|
2356 { "-no-init-file", 0, 50, 0 },
|
776
|
2357 { "-no-site-file", "--no-site-file", 50, 0 },
|
|
2358 { "-unmapped", "--unmapped", 50, 0 },
|
|
2359 { "-u", "--user", 50, 1 },
|
|
2360 { "-user", 0, 50, 1 },
|
|
2361 { "-user-init-file", "--user-init-file", 50, 1 },
|
|
2362 { "-user-init-directory", "--user-init-directory", 50, 1 },
|
|
2363 { "-debug-init", "--debug-init", 50, 0 },
|
428
|
2364
|
|
2365 /* Xt options: */
|
|
2366 { "-i", "--icon-type", 15, 0 },
|
|
2367 { "-itype", 0, 15, 0 },
|
|
2368 { "-iconic", "--iconic", 15, 0 },
|
|
2369 { "-bg", "--background-color", 10, 1 },
|
|
2370 { "-background", 0, 10, 1 },
|
|
2371 { "-fg", "--foreground-color", 10, 1 },
|
|
2372 { "-foreground", 0, 10, 1 },
|
|
2373 { "-bd", "--border-color", 10, 1 },
|
|
2374 { "-bw", "--border-width", 10, 1 },
|
|
2375 { "-ib", "--internal-border", 10, 1 },
|
|
2376 { "-ms", "--mouse-color", 10, 1 },
|
|
2377 { "-cr", "--cursor-color", 10, 1 },
|
|
2378 { "-fn", "--font", 10, 1 },
|
|
2379 { "-font", 0, 10, 1 },
|
|
2380 { "-g", "--geometry", 10, 1 },
|
|
2381 { "-geometry", 0, 10, 1 },
|
|
2382 { "-T", "--title", 10, 1 },
|
|
2383 { "-title", 0, 10, 1 },
|
|
2384 { "-name", "--name", 10, 1 },
|
|
2385 { "-xrm", "--xrm", 10, 1 },
|
|
2386 { "-r", "--reverse-video", 5, 0 },
|
|
2387 { "-rv", 0, 5, 0 },
|
|
2388 { "-reverse", 0, 5, 0 },
|
|
2389 { "-hb", "--horizontal-scroll-bars", 5, 0 },
|
|
2390 { "-vb", "--vertical-scroll-bars", 5, 0 },
|
|
2391
|
776
|
2392 { "-eol", "--enable-eol-detection", 2, 0 },
|
|
2393 { "-enable-eol-detection", 0, 2, 0 },
|
428
|
2394 /* These have the same priority as ordinary file name args,
|
|
2395 so they are not reordered with respect to those. */
|
|
2396 { "-L", "--directory", 0, 1 },
|
|
2397 { "-directory", 0, 0, 1 },
|
|
2398 { "-l", "--load", 0, 1 },
|
|
2399 { "-load", 0, 0, 1 },
|
|
2400 { "-f", "--funcall", 0, 1 },
|
|
2401 { "-funcall", 0, 0, 1 },
|
|
2402 { "-eval", "--eval", 0, 1 },
|
|
2403 { "-insert", "--insert", 0, 1 },
|
|
2404 /* This should be processed after ordinary file name args and the like. */
|
|
2405 { "-kill", "--kill", -10, 0 },
|
|
2406 };
|
|
2407
|
|
2408 /* Reorder the elements of ARGV (assumed to have ARGC elements)
|
|
2409 so that the highest priority ones come first.
|
|
2410 Do not change the order of elements of equal priority.
|
|
2411 If an option takes an argument, keep it and its argument together. */
|
|
2412
|
|
2413 static void
|
|
2414 sort_args (int argc, char **argv)
|
|
2415 {
|
|
2416 char **new_argv = xnew_array (char *, argc);
|
|
2417 /* For each element of argv,
|
|
2418 the corresponding element of options is:
|
|
2419 0 for an option that takes no arguments,
|
|
2420 1 for an option that takes one argument, etc.
|
|
2421 -1 for an ordinary non-option argument. */
|
|
2422 int *options = xnew_array (int, argc);
|
|
2423 int *priority = xnew_array (int, argc);
|
|
2424 int to = 1;
|
|
2425 int from;
|
|
2426 int i;
|
|
2427 int end_of_options_p = 0;
|
|
2428
|
|
2429 /* Categorize all the options,
|
|
2430 and figure out which argv elts are option arguments. */
|
|
2431 for (from = 1; from < argc; from++)
|
|
2432 {
|
|
2433 options[from] = -1;
|
|
2434 priority[from] = 0;
|
|
2435 /* Pseudo options "--" and "run-temacs" indicate end of options */
|
|
2436 if (!strcmp (argv[from], "--") ||
|
|
2437 !strcmp (argv[from], "run-temacs"))
|
|
2438 end_of_options_p = 1;
|
|
2439 if (!end_of_options_p && argv[from][0] == '-')
|
|
2440 {
|
|
2441 int match, thislen;
|
|
2442 char *equals;
|
|
2443
|
|
2444 /* Look for a match with a known old-fashioned option. */
|
|
2445 for (i = 0; i < countof (standard_args); i++)
|
|
2446 if (!strcmp (argv[from], standard_args[i].name))
|
|
2447 {
|
|
2448 options[from] = standard_args[i].nargs;
|
|
2449 priority[from] = standard_args[i].priority;
|
|
2450 if (from + standard_args[i].nargs >= argc)
|
|
2451 fatal ("Option `%s' requires an argument\n", argv[from]);
|
|
2452 from += standard_args[i].nargs;
|
|
2453 goto done;
|
|
2454 }
|
|
2455
|
|
2456 /* Look for a match with a known long option.
|
|
2457 MATCH is -1 if no match so far, -2 if two or more matches so far,
|
|
2458 >= 0 (the table index of the match) if just one match so far. */
|
|
2459 if (argv[from][1] == '-')
|
|
2460 {
|
|
2461 match = -1;
|
|
2462 thislen = strlen (argv[from]);
|
|
2463 equals = strchr (argv[from], '=');
|
|
2464 if (equals != 0)
|
|
2465 thislen = equals - argv[from];
|
|
2466
|
|
2467 for (i = 0; i < countof (standard_args); i++)
|
|
2468 if (standard_args[i].longname
|
|
2469 && !strncmp (argv[from], standard_args[i].longname,
|
|
2470 thislen))
|
|
2471 {
|
|
2472 if (match == -1)
|
|
2473 match = i;
|
|
2474 else
|
|
2475 match = -2;
|
|
2476 }
|
|
2477
|
|
2478 /* If we found exactly one match, use that. */
|
|
2479 if (match >= 0)
|
|
2480 {
|
|
2481 options[from] = standard_args[match].nargs;
|
|
2482 priority[from] = standard_args[match].priority;
|
|
2483 /* If --OPTION=VALUE syntax is used,
|
|
2484 this option uses just one argv element. */
|
|
2485 if (equals != 0)
|
|
2486 options[from] = 0;
|
|
2487 if (from + options[from] >= argc)
|
|
2488 fatal ("Option `%s' requires an argument\n", argv[from]);
|
|
2489 from += options[from];
|
|
2490 }
|
|
2491 }
|
|
2492 done: ;
|
|
2493 }
|
|
2494 }
|
|
2495
|
|
2496 /* Copy the arguments, in order of decreasing priority, to NEW_ARGV. */
|
|
2497 new_argv[0] = argv[0];
|
|
2498 while (to < argc)
|
|
2499 {
|
|
2500 int best = -1;
|
|
2501 int best_priority = -9999;
|
|
2502
|
|
2503 /* Find the highest priority remaining option.
|
|
2504 If several have equal priority, take the first of them. */
|
|
2505 for (from = 1; from < argc; from++)
|
|
2506 {
|
|
2507 if (argv[from] != 0 && priority[from] > best_priority)
|
|
2508 {
|
|
2509 best_priority = priority[from];
|
|
2510 best = from;
|
|
2511 }
|
|
2512 /* Skip option arguments--they are tied to the options. */
|
|
2513 if (options[from] > 0)
|
|
2514 from += options[from];
|
|
2515 }
|
|
2516
|
|
2517 if (best < 0)
|
|
2518 abort ();
|
|
2519
|
|
2520 /* Copy the highest priority remaining option, with its args, to NEW_ARGV. */
|
|
2521 new_argv[to++] = argv[best];
|
|
2522 for (i = 0; i < options[best]; i++)
|
|
2523 new_argv[to++] = argv[best + i + 1];
|
|
2524
|
|
2525 /* Clear out this option in ARGV. */
|
|
2526 argv[best] = 0;
|
|
2527 for (i = 0; i < options[best]; i++)
|
|
2528 argv[best + i + 1] = 0;
|
|
2529 }
|
|
2530
|
|
2531 memcpy (argv, new_argv, sizeof (char *) * argc);
|
|
2532 xfree (new_argv);
|
|
2533 xfree (options);
|
|
2534 xfree (priority);
|
|
2535 }
|
|
2536
|
|
2537 DEFUN ("running-temacs-p", Frunning_temacs_p, 0, 0, 0, /*
|
|
2538 True if running temacs. This means we are in the dumping stage.
|
|
2539 This is false during normal execution of the `xemacs' program, and
|
|
2540 becomes false once `run-emacs-from-temacs' is run.
|
|
2541 */
|
|
2542 ())
|
|
2543 {
|
|
2544 return run_temacs_argc >= 0 ? Qt : Qnil;
|
|
2545 }
|
|
2546
|
|
2547 DEFUN ("run-emacs-from-temacs", Frun_emacs_from_temacs, 0, MANY, 0, /*
|
|
2548 Do not call this. It will reinitialize your XEmacs. You'll be sorry.
|
|
2549 */
|
|
2550 /* If this function is called from startup.el, it will be possible to run
|
|
2551 temacs as an editor using 'temacs -batch -l loadup.el run-temacs', instead
|
|
2552 of having to dump an emacs and then run that (when debugging emacs itself,
|
|
2553 this can be much faster)). [Actually, the speed difference isn't that
|
|
2554 much as long as your filesystem is local, and you don't end up with
|
|
2555 a dumped version in case you want to rerun it. This function is most
|
|
2556 useful when used as part of the `make all-elc' command. --ben]
|
|
2557 This will "restart" emacs with the specified command-line arguments.
|
|
2558
|
|
2559 Martin thinks this function is most useful when using debugging
|
|
2560 tools like Purify or tcov that get confused by XEmacs' dumping. */
|
|
2561 (int nargs, Lisp_Object *args))
|
|
2562 {
|
|
2563 int ac;
|
442
|
2564 const Extbyte *wampum;
|
428
|
2565 int namesize;
|
|
2566 int total_len;
|
|
2567 Lisp_Object orig_invoc_name = Fcar (Vcommand_line_args);
|
442
|
2568 const Extbyte **wampum_all = alloca_array (const Extbyte *, nargs);
|
428
|
2569 int *wampum_all_len = alloca_array (int, nargs);
|
|
2570
|
|
2571 assert (!gc_in_progress);
|
|
2572
|
|
2573 if (run_temacs_argc < 0)
|
563
|
2574 invalid_operation ("I've lost my temacs-hood.", Qunbound);
|
428
|
2575
|
|
2576 /* Need to convert the orig_invoc_name and all of the arguments
|
|
2577 to external format. */
|
|
2578
|
440
|
2579 TO_EXTERNAL_FORMAT (LISP_STRING, orig_invoc_name,
|
|
2580 ALLOCA, (wampum, namesize),
|
|
2581 Qnative);
|
428
|
2582 namesize++;
|
|
2583
|
|
2584 for (ac = 0, total_len = namesize; ac < nargs; ac++)
|
|
2585 {
|
|
2586 CHECK_STRING (args[ac]);
|
440
|
2587 TO_EXTERNAL_FORMAT (LISP_STRING, args[ac],
|
|
2588 ALLOCA, (wampum_all[ac], wampum_all_len[ac]),
|
|
2589 Qnative);
|
428
|
2590 wampum_all_len[ac]++;
|
|
2591 total_len += wampum_all_len[ac];
|
|
2592 }
|
|
2593 DO_REALLOC (run_temacs_args, run_temacs_args_size, total_len, char);
|
|
2594 DO_REALLOC (run_temacs_argv, run_temacs_argv_size, nargs+2, char *);
|
|
2595
|
|
2596 memcpy (run_temacs_args, wampum, namesize);
|
|
2597 run_temacs_argv [0] = run_temacs_args;
|
|
2598 for (ac = 0; ac < nargs; ac++)
|
|
2599 {
|
|
2600 memcpy (run_temacs_args + namesize,
|
|
2601 wampum_all[ac], wampum_all_len[ac]);
|
|
2602 run_temacs_argv [ac + 1] = run_temacs_args + namesize;
|
|
2603 namesize += wampum_all_len[ac];
|
|
2604 }
|
|
2605 run_temacs_argv [nargs + 1] = 0;
|
|
2606 catchlist = NULL; /* Important! Otherwise free_cons() calls in
|
|
2607 condition_case_unwind() may lead to GC death. */
|
771
|
2608 unbind_to (0); /* this closes loadup.el */
|
428
|
2609 purify_flag = 0;
|
|
2610 run_temacs_argc = nargs + 1;
|
442
|
2611 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
|
428
|
2612 report_sheap_usage (0);
|
|
2613 #endif
|
|
2614 LONGJMP (run_temacs_catch, 1);
|
|
2615 return Qnil; /* not reached; warning suppression */
|
|
2616 }
|
|
2617
|
|
2618 /* ARGSUSED */
|
|
2619 int
|
|
2620 main (int argc, char **argv, char **envp)
|
|
2621 {
|
442
|
2622
|
|
2623 #ifdef _MSC_VER
|
|
2624 /* Under VC++, access violations and the like are not sent through
|
|
2625 the standard signal() mechanism. Rather, they need to be handled
|
|
2626 using the Microsoft "structured exception handling" mechanism,
|
|
2627 which vaguely resembles the C++ mechanisms. */
|
|
2628 __try
|
|
2629 {
|
|
2630 #endif
|
|
2631
|
428
|
2632 int volatile vol_argc = argc;
|
|
2633 char ** volatile vol_argv = argv;
|
|
2634 char ** volatile vol_envp = envp;
|
|
2635 /* This is hairy. We need to compute where the XEmacs binary was invoked
|
|
2636 from because temacs initialization requires it to find the lisp
|
|
2637 directories. The code that recomputes the path is guarded by the
|
|
2638 restarted flag. There are three possible paths I've found so far
|
|
2639 through this:
|
|
2640
|
|
2641 temacs -- When running temacs for basic build stuff, the first main_1
|
|
2642 will be the only one invoked. It must compute the path else there
|
|
2643 will be a very ugly bomb in startup.el (can't find obvious location
|
|
2644 for doc-directory data-directory, etc.).
|
|
2645
|
|
2646 temacs w/ run-temacs on the command line -- This is run to bytecompile
|
|
2647 all the out of date dumped lisp. It will execute both of the main_1
|
|
2648 calls and the second one must not touch the first computation because
|
|
2649 argc/argv are hosed the second time through.
|
|
2650
|
|
2651 xemacs -- Only the second main_1 is executed. The invocation path must
|
|
2652 computed but this only matters when running in place or when running
|
|
2653 as a login shell.
|
|
2654
|
|
2655 As a bonus for straightening this out, XEmacs can now be run in place
|
|
2656 as a login shell. This never used to work.
|
|
2657
|
|
2658 As another bonus, we can now guarantee that
|
|
2659 (concat invocation-directory invocation-name) contains the filename
|
|
2660 of the XEmacs binary we are running. This can now be used in a
|
|
2661 definite test for out of date dumped files. -slb */
|
|
2662 int restarted = 0;
|
|
2663 #ifdef QUANTIFY
|
|
2664 quantify_stop_recording_data ();
|
|
2665 quantify_clear_data ();
|
|
2666 #endif /* QUANTIFY */
|
|
2667
|
771
|
2668 inhibit_non_essential_printing_operations = 1;
|
428
|
2669 suppress_early_error_handler_backtrace = 0;
|
|
2670 lim_data = 0; /* force reinitialization of this variable */
|
|
2671
|
|
2672 /* Lisp_Object must fit in a word; check VALBITS and GCTYPEBITS */
|
|
2673 assert (sizeof (Lisp_Object) == sizeof (void *));
|
|
2674
|
|
2675 #ifdef LINUX_SBRK_BUG
|
|
2676 sbrk (1);
|
|
2677 #endif
|
|
2678
|
|
2679 if (!initialized)
|
|
2680 {
|
|
2681 #ifdef DOUG_LEA_MALLOC
|
|
2682 mallopt (M_MMAP_MAX, 0);
|
|
2683 #endif
|
|
2684 run_temacs_argc = 0;
|
|
2685 if (! SETJMP (run_temacs_catch))
|
|
2686 {
|
|
2687 main_1 (vol_argc, vol_argv, vol_envp, 0);
|
|
2688 }
|
|
2689 /* run-emacs-from-temacs called */
|
|
2690 restarted = 1;
|
|
2691 vol_argc = run_temacs_argc;
|
|
2692 vol_argv = run_temacs_argv;
|
|
2693 #ifdef _SCO_DS
|
|
2694 /* This makes absolutely no sense to anyone involved. There are
|
|
2695 several people using this stuff. We've compared versions on
|
|
2696 everything we can think of. We can find no difference.
|
|
2697 However, on both my systems environ is a plain old global
|
|
2698 variable initialized to zero. _environ is the one that
|
|
2699 contains pointers to the actual environment.
|
|
2700
|
|
2701 Since we can't figure out the difference (and we're hours
|
|
2702 away from a release), this takes a very cowardly approach and
|
|
2703 is bracketed with both a system specific preprocessor test
|
|
2704 and a runtime "do you have this problem" test
|
|
2705
|
|
2706 06/20/96 robertl@dgii.com */
|
|
2707 {
|
442
|
2708 extern char **_environ;
|
428
|
2709 if ((unsigned) environ == 0)
|
|
2710 environ=_environ;
|
|
2711 }
|
|
2712 #endif /* _SCO_DS */
|
|
2713 vol_envp = environ;
|
|
2714 }
|
456
|
2715 #if defined (RUN_TIME_REMAP) && ! defined (PDUMP)
|
428
|
2716 else
|
|
2717 /* obviously no-one uses this because where it was before initialized was
|
|
2718 *always* true */
|
|
2719 run_time_remap (argv[0]);
|
|
2720 #endif
|
|
2721
|
|
2722 #ifdef DOUG_LEA_MALLOC
|
|
2723 if (initialized && (malloc_state_ptr != NULL))
|
|
2724 {
|
|
2725 int rc = malloc_set_state (malloc_state_ptr);
|
|
2726 if (rc != 0)
|
|
2727 {
|
442
|
2728 stderr_out ("malloc_set_state failed, rc = %d\n", rc);
|
428
|
2729 abort ();
|
|
2730 }
|
|
2731 #if 0
|
|
2732 free (malloc_state_ptr);
|
|
2733 #endif
|
|
2734 /* mmap works in glibc-2.1, glibc-2.0 (Non-Mule only) and Linux libc5 */
|
|
2735 #if (defined(__GLIBC__) && __GLIBC_MINOR__ >= 1) || \
|
|
2736 defined(_NO_MALLOC_WARNING_) || \
|
|
2737 (defined(__GLIBC__) && __GLIBC_MINOR__ < 1 && !defined(MULE)) || \
|
|
2738 defined(DEBUG_DOUG_LEA_MALLOC)
|
|
2739 mallopt (M_MMAP_MAX, 64);
|
|
2740 #endif
|
|
2741 #ifdef REL_ALLOC
|
|
2742 r_alloc_reinit ();
|
|
2743 #endif
|
|
2744 }
|
|
2745 #endif /* DOUG_LEA_MALLOC */
|
|
2746
|
|
2747 run_temacs_argc = -1;
|
|
2748
|
|
2749 main_1 (vol_argc, vol_argv, vol_envp, restarted);
|
442
|
2750
|
|
2751 #ifdef _MSC_VER
|
|
2752 }
|
|
2753 /* VC++ documentation says that
|
|
2754 GetExceptionCode() cannot be called inside the filter itself. */
|
|
2755 __except (mswindows_handle_hardware_exceptions (GetExceptionCode ())) {}
|
|
2756 #endif
|
|
2757
|
428
|
2758 return 0; /* unreached */
|
|
2759 }
|
|
2760
|
|
2761
|
771
|
2762 /************************************************************************/
|
|
2763 /* dumping XEmacs (to a new EXE file) */
|
|
2764 /************************************************************************/
|
|
2765
|
|
2766 #ifndef CANNOT_DUMP
|
|
2767
|
|
2768 #if !defined(PDUMP) || !defined(SYSTEM_MALLOC)
|
|
2769 extern char my_edata[];
|
428
|
2770 #endif
|
771
|
2771
|
|
2772 extern void disable_free_hook (void);
|
|
2773
|
|
2774 DEFUN ("dump-emacs", Fdump_emacs, 2, 2, 0, /*
|
|
2775 Dump current state of XEmacs into executable file FILENAME.
|
|
2776 Take symbols from SYMFILE (presumably the file you executed to run XEmacs).
|
|
2777 This is used in the file `loadup.el' when building XEmacs.
|
|
2778
|
|
2779 Remember to set `command-line-processed' to nil before dumping
|
|
2780 if you want the dumped XEmacs to process its command line
|
|
2781 and announce itself normally when it is run.
|
428
|
2782 */
|
771
|
2783 (filename, symfile))
|
428
|
2784 {
|
|
2785 /* This function can GC */
|
771
|
2786 struct gcpro gcpro1, gcpro2;
|
|
2787 int opurify;
|
|
2788
|
|
2789 GCPRO2 (filename, symfile);
|
|
2790
|
|
2791 #ifdef FREE_CHECKING
|
|
2792 Freally_free (Qnil);
|
|
2793
|
|
2794 /* When we're dumping, we can't use the debugging free() */
|
|
2795 disable_free_hook ();
|
|
2796 #endif
|
|
2797
|
|
2798 CHECK_STRING (filename);
|
|
2799 filename = Fexpand_file_name (filename, Qnil);
|
|
2800 if (!NILP (symfile))
|
428
|
2801 {
|
771
|
2802 CHECK_STRING (symfile);
|
|
2803 if (XSTRING_LENGTH (symfile) > 0)
|
|
2804 symfile = Fexpand_file_name (symfile, Qnil);
|
|
2805 else
|
|
2806 symfile = Qnil;
|
428
|
2807 }
|
|
2808
|
771
|
2809 opurify = purify_flag;
|
|
2810 purify_flag = 0;
|
|
2811
|
|
2812 #if defined (HEAP_IN_DATA) && !defined(PDUMP)
|
|
2813 report_sheap_usage (1);
|
|
2814 #endif
|
|
2815
|
|
2816 clear_message ();
|
|
2817
|
|
2818 fflush (stderr);
|
|
2819 fflush (stdout);
|
|
2820
|
|
2821 disksave_object_finalization ();
|
|
2822 release_breathing_space ();
|
|
2823
|
|
2824 /* Tell malloc where start of impure now is */
|
|
2825 /* Also arrange for warnings when nearly out of space. */
|
|
2826 #ifndef SYSTEM_MALLOC
|
|
2827 memory_warnings (my_edata, malloc_warning);
|
|
2828 #endif
|
|
2829
|
428
|
2830 UNGCPRO;
|
|
2831
|
771
|
2832 {
|
|
2833 Extbyte *filename_ext;
|
|
2834 Extbyte *symfile_ext;
|
|
2835
|
|
2836 LISP_STRING_TO_EXTERNAL (filename, filename_ext, Qfile_name);
|
|
2837
|
|
2838 if (STRINGP (symfile))
|
|
2839 LISP_STRING_TO_EXTERNAL (symfile, symfile_ext, Qfile_name);
|
|
2840 else
|
|
2841 symfile_ext = 0;
|
|
2842
|
|
2843 garbage_collect_1 ();
|
|
2844
|
|
2845 #ifdef PDUMP
|
|
2846 pdump ();
|
|
2847 #else
|
|
2848
|
|
2849 #ifdef DOUG_LEA_MALLOC
|
|
2850 malloc_state_ptr = malloc_get_state ();
|
|
2851 #endif
|
|
2852 /* here we break our rule that the filename conversion should
|
|
2853 be performed at the actual time that the system call is made.
|
|
2854 It's a whole lot easier to do the conversion here than to
|
|
2855 modify all the unexec routines to ensure that filename
|
|
2856 conversion is applied everywhere. Don't worry about memory
|
|
2857 leakage because this call only happens once. */
|
|
2858 unexec (filename_ext, symfile_ext, (uintptr_t) my_edata, 0, 0);
|
|
2859 #ifdef DOUG_LEA_MALLOC
|
|
2860 free (malloc_state_ptr);
|
|
2861 #endif
|
|
2862 #endif /* not PDUMP */
|
|
2863 }
|
|
2864
|
|
2865 purify_flag = opurify;
|
|
2866
|
|
2867 return Qnil;
|
|
2868 }
|
|
2869
|
|
2870 #endif /* not CANNOT_DUMP */
|
|
2871
|
|
2872
|
|
2873 /************************************************************************/
|
|
2874 /* exiting XEmacs (intended or not) */
|
|
2875 /************************************************************************/
|
|
2876
|
|
2877 /* Ben's capsule summary about expected and unexpected exits from XEmacs.
|
|
2878
|
|
2879 Expected exits occur when the user directs XEmacs to exit, for example
|
|
2880 by pressing the close button on the only frame in XEmacs, or by typing
|
|
2881 C-x C-c. This runs `save-buffers-kill-emacs', which saves any necessary
|
|
2882 buffers, and then exits using the primitive `kill-emacs'.
|
|
2883
|
|
2884 However, unexpected exits occur in a few different ways:
|
|
2885
|
|
2886 -- a memory access violation or other hardware-generated exception
|
|
2887 occurs. This is the worst possible problem to deal with, because
|
|
2888 the fault can occur while XEmacs is in any state whatsoever, even
|
|
2889 quite unstable ones. As a result, we need to be *extremely* careful
|
|
2890 what we do.
|
|
2891 -- we are using one X display (or if we've used more, we've closed the
|
|
2892 others already), and some hardware or other problem happens and
|
|
2893 suddenly we've lost our connection to the display. In this situation,
|
|
2894 things are not so dire as in the last one; our code itself isn't
|
|
2895 trashed, so we can continue execution as normal, after having set
|
|
2896 things up so that we can exit at the appropriate time. Our exit
|
|
2897 still needs to be of the emergency nature; we have no displays, so
|
|
2898 any attempts to use them will fail. We simply want to auto-save
|
|
2899 (the single most important thing to do during shut-down), do minimal
|
|
2900 cleanup of stuff that has an independent existence outside of XEmacs,
|
|
2901 and exit.
|
|
2902
|
|
2903 Currently, both unexpected exit scenarios described above set
|
|
2904 preparing_for_armageddon to indicate that nonessential and possibly
|
|
2905 dangerous things should not be done, specifically:
|
|
2906
|
|
2907 -- no garbage collection.
|
|
2908 -- no hooks are run.
|
|
2909 -- no messages of any sort from autosaving.
|
|
2910 -- autosaving tries harder, ignoring certain failures.
|
|
2911 -- existing frames are not deleted.
|
|
2912
|
|
2913 (Also, all places that set preparing_for_armageddon also
|
|
2914 set dont_check_for_quit. This happens separately because it's
|
|
2915 also necessary to set other variables to make absolutely sure
|
|
2916 no quitting happens.)
|
|
2917
|
|
2918 In the first scenario above (the access violation), we also set
|
|
2919 fatal_error_in_progress. This causes more things to not happen:
|
|
2920
|
|
2921 -- assertion failures do not abort.
|
|
2922 -- printing code does not do code conversion or gettext when
|
|
2923 printing to stdout/stderr.
|
|
2924 */
|
|
2925
|
|
2926 /* ------------------------------- */
|
|
2927 /* low-level debugging functions */
|
|
2928 /* ------------------------------- */
|
|
2929
|
|
2930 #if defined (WIN32_NATIVE) && defined (DEBUG_XEMACS)
|
|
2931 #define debugging_breakpoint() DebugBreak ()
|
|
2932 #else
|
|
2933 #define debugging_breakpoint()
|
|
2934 #endif
|
|
2935
|
|
2936 void
|
|
2937 debug_break (void)
|
|
2938 {
|
|
2939 debugging_breakpoint ();
|
|
2940 }
|
|
2941
|
|
2942 #if defined (WIN32_NATIVE) || defined (CYGWIN)
|
|
2943
|
|
2944 /* Return whether all bytes in the specified memory block can be read. */
|
|
2945 int
|
|
2946 debug_can_access_memory (void *ptr, Bytecount len)
|
|
2947 {
|
|
2948 return !IsBadReadPtr (ptr, len);
|
|
2949 }
|
|
2950
|
|
2951 #else /* !(defined (WIN32_NATIVE) || defined (CYGWIN)) */
|
|
2952
|
|
2953 /* #### There must be a better way!!!! */
|
|
2954
|
|
2955 static JMP_BUF memory_error_jump;
|
|
2956
|
|
2957 static SIGTYPE
|
|
2958 debug_memory_error (int signum)
|
|
2959 {
|
|
2960 EMACS_REESTABLISH_SIGNAL (signum, debug_memory_error);
|
|
2961 EMACS_UNBLOCK_SIGNAL (signum);
|
|
2962 LONGJMP (memory_error_jump, 1);
|
|
2963 }
|
|
2964
|
|
2965 /* Return whether all bytes in the specified memory block can be read. */
|
|
2966 int
|
|
2967 debug_can_access_memory (void *ptr, Bytecount len)
|
|
2968 {
|
|
2969 /* Use volatile to protect variables from being clobbered by longjmp. */
|
|
2970 SIGTYPE (*volatile old_sigbus) (int);
|
|
2971 SIGTYPE (*volatile old_sigsegv) (int);
|
|
2972 volatile int old_errno = errno;
|
|
2973 volatile int retval = 1;
|
|
2974
|
|
2975 if (!SETJMP (memory_error_jump))
|
|
2976 {
|
|
2977 old_sigbus =
|
|
2978 (SIGTYPE (*) (int)) EMACS_SIGNAL (SIGBUS, debug_memory_error);
|
|
2979 old_sigsegv =
|
|
2980 (SIGTYPE (*) (int)) EMACS_SIGNAL (SIGSEGV, debug_memory_error);
|
|
2981
|
|
2982 if (len > 1)
|
|
2983 /* If we can, try to avoid problems with super-optimizing compilers
|
|
2984 that might decide that memcmp (ptr, ptr, len) can be optimized
|
|
2985 away since its result is always 1. */
|
|
2986 memcmp (ptr, (char *) ptr + 1, len - 1);
|
|
2987 else
|
|
2988 memcmp (ptr, ptr, len);
|
|
2989 }
|
|
2990 else
|
|
2991 retval = 0;
|
|
2992 EMACS_SIGNAL (SIGBUS, old_sigbus);
|
|
2993 EMACS_SIGNAL (SIGSEGV, old_sigsegv);
|
|
2994 errno = old_errno;
|
|
2995
|
|
2996 return retval;
|
|
2997 }
|
|
2998
|
|
2999 #endif /* defined (WIN32_NATIVE) || defined (CYGWIN) */
|
|
3000
|
|
3001 #ifdef DEBUG_XEMACS
|
|
3002
|
|
3003 DEFUN ("force-debugging-signal", Fforce_debugging_signal, 0, 1, 0, /*
|
|
3004 Cause XEmacs to enter the debugger.
|
|
3005 On some systems, there may be no way to do this gracefully; if so,
|
|
3006 nothing happens unless ABORT is non-nil, in which case XEmacs will
|
|
3007 abort() -- a sure-fire way to immediately get back to the debugger,
|
|
3008 but also a sure-fire way to kill XEmacs (and dump core on Unix
|
|
3009 systems)!
|
|
3010 */
|
|
3011 (abort_))
|
|
3012 {
|
|
3013 debugging_breakpoint ();
|
|
3014 if (!NILP (abort_))
|
|
3015 abort ();
|
|
3016 return Qnil;
|
|
3017 }
|
|
3018
|
|
3019 #endif /* DEBUG_XEMACS */
|
|
3020
|
|
3021 /* ------------------------------- */
|
|
3022 /* some helper functions */
|
|
3023 /* ------------------------------- */
|
|
3024
|
|
3025 static void
|
|
3026 ensure_no_quitting_from_now_on (void)
|
|
3027 {
|
|
3028 /* make sure no quitting from now on!! */
|
|
3029 dont_check_for_quit = 1;
|
|
3030 Vinhibit_quit = Qt;
|
|
3031 Vquit_flag = Qnil;
|
|
3032 }
|
|
3033
|
442
|
3034 #ifdef HAVE_MS_WINDOWS
|
771
|
3035 static void
|
|
3036 pause_so_user_can_read_messages (int allow_further)
|
|
3037 {
|
|
3038 static int already_paused;
|
|
3039
|
|
3040 if (already_paused)
|
|
3041 return;
|
|
3042 if (!allow_further)
|
|
3043 already_paused = 1;
|
442
|
3044 /* If we displayed a message on the console, then we must allow the
|
|
3045 user to see this message. This may be unnecessary, but can't hurt,
|
|
3046 and we can't necessarily check arg; e.g. xemacs --help kills with
|
|
3047 argument 0. */
|
|
3048 if (mswindows_message_outputted)
|
771
|
3049 Fmswindows_message_box
|
|
3050 (build_msg_string ("Messages outputted. XEmacs is exiting."),
|
|
3051 Qnil, Qnil);
|
|
3052 }
|
442
|
3053 #endif
|
|
3054
|
771
|
3055 /* -------------------------------- */
|
|
3056 /* a (more-or-less) normal shutdown */
|
|
3057 /* -------------------------------- */
|
428
|
3058
|
|
3059 /* Perform an orderly shutdown of XEmacs. Autosave any modified
|
|
3060 buffers, kill any child processes, clean up the terminal modes (if
|
|
3061 we're in the foreground), and other stuff like that. Don't perform
|
|
3062 any redisplay; this may be called when XEmacs is shutting down in
|
|
3063 the background, or after its X connection has died.
|
|
3064
|
|
3065 If SIG is a signal number, print a message for it.
|
|
3066
|
442
|
3067 This is called by fatal signal handlers and Fkill_emacs. It used to
|
|
3068 be called by X protocol error handlers, but instead they now call
|
|
3069 Fkill_emacs. */
|
771
|
3070
|
428
|
3071 static void
|
442
|
3072 shut_down_emacs (int sig, Lisp_Object stuff, int no_auto_save)
|
428
|
3073 {
|
|
3074 /* This function can GC */
|
|
3075 /* Prevent running of hooks and other non-essential stuff
|
|
3076 from now on. */
|
|
3077 preparing_for_armageddon = 1;
|
|
3078
|
442
|
3079 ensure_no_quitting_from_now_on ();
|
428
|
3080
|
|
3081 #ifdef QUANTIFY
|
|
3082 quantify_stop_recording_data ();
|
|
3083 #endif /* QUANTIFY */
|
|
3084
|
|
3085 /* This is absolutely the most important thing to do, so make sure
|
|
3086 we do it now, before anything else. We might have crashed and
|
|
3087 be in a weird inconsistent state, and potentially anything could
|
|
3088 set off another protection fault and cause us to bail out
|
|
3089 immediately. */
|
442
|
3090 /* Steve writes the following:
|
|
3091
|
|
3092 [[I'm not removing the code entirely, yet. We have run up against
|
428
|
3093 a spate of problems in diagnosing crashes due to crashes within
|
|
3094 crashes. It has very definitely been determined that code called
|
|
3095 during auto-saving cannot work if XEmacs crashed inside of GC.
|
|
3096 We already auto-save on an itimer so there cannot be too much
|
|
3097 unsaved stuff around, and if we get better crash reports we might
|
442
|
3098 be able to get more problems fixed so I'm disabling this. -slb]]
|
|
3099
|
|
3100 and DISABLES AUTO-SAVING ENTIRELY during crashes! Way way bad idea.
|
|
3101
|
|
3102 Instead let's just be more intelligent about avoiding crashing
|
|
3103 when possible, esp. nested crashes.
|
|
3104 */
|
|
3105 if (!no_auto_save)
|
|
3106 Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */
|
428
|
3107
|
|
3108 fflush (stdout);
|
|
3109 reset_all_consoles ();
|
|
3110 if (sig && sig != SIGTERM)
|
|
3111 {
|
442
|
3112 if (sig == -1)
|
|
3113 stderr_out ("\nFatal error.\n\n");
|
|
3114 else
|
|
3115 stderr_out ("\nFatal error (%d).\n\n", sig);
|
428
|
3116 stderr_out
|
|
3117 ("Your files have been auto-saved.\n"
|
|
3118 "Use `M-x recover-session' to recover them.\n"
|
|
3119 "\n"
|
|
3120 "If you have access to the PROBLEMS file that came with your\n"
|
|
3121 "version of XEmacs, please check to see if your crash is described\n"
|
|
3122 "there, as there may be a workaround available.\n"
|
|
3123 #ifdef INFODOCK
|
|
3124 "Otherwise, please report this bug by selecting `Report-Bug'\n"
|
|
3125 "in the InfoDock menu.\n"
|
|
3126 #else
|
|
3127 "Otherwise, please report this bug by running the send-pr\n"
|
|
3128 "script included with XEmacs, or selecting `Send Bug Report'\n"
|
|
3129 "from the help menu.\n"
|
|
3130 "As a last resort send ordinary email to `crashes@xemacs.org'.\n"
|
|
3131 #endif
|
|
3132 "*MAKE SURE* to include the information in the command\n"
|
|
3133 "M-x describe-installation.\n"
|
442
|
3134 #ifndef _MSC_VER
|
428
|
3135 "\n"
|
|
3136 "If at all possible, *please* try to obtain a C stack backtrace;\n"
|
|
3137 "it will help us immensely in determining what went wrong.\n"
|
|
3138 "To do this, locate the core file that was produced as a result\n"
|
|
3139 "of this crash (it's usually called `core' and is located in the\n"
|
|
3140 "directory in which you started the editor, or maybe in your home\n"
|
|
3141 "directory), and type\n"
|
|
3142 "\n"
|
442
|
3143 " gdb "
|
|
3144 #endif
|
|
3145 );
|
|
3146 #ifndef _MSC_VER
|
428
|
3147 {
|
442
|
3148 const char *name;
|
428
|
3149 char *dir = 0;
|
|
3150
|
|
3151 /* Now try to determine the actual path to the executable,
|
|
3152 to try to make the backtrace-determination process as foolproof
|
|
3153 as possible. */
|
|
3154 if (STRINGP (Vinvocation_name))
|
|
3155 name = (char *) XSTRING_DATA (Vinvocation_name);
|
|
3156 else
|
|
3157 name = "xemacs";
|
|
3158 if (STRINGP (Vinvocation_directory))
|
|
3159 dir = (char *) XSTRING_DATA (Vinvocation_directory);
|
|
3160 if (!dir || dir[0] != '/')
|
|
3161 stderr_out ("`which %s`", name);
|
|
3162 else if (dir[strlen (dir) - 1] != '/')
|
|
3163 stderr_out ("%s/%s", dir, name);
|
|
3164 else
|
|
3165 stderr_out ("%s%s", dir, name);
|
|
3166 }
|
|
3167 stderr_out
|
|
3168 (" core\n\n"
|
|
3169 "then type `where' when the debugger prompt comes up.\n"
|
|
3170 "(If you don't have GDB on your system, you might have DBX,\n"
|
|
3171 "or XDB, or SDB. A similar procedure should work for all of\n"
|
|
3172 "these. Ask your system administrator if you need more help.)\n");
|
442
|
3173 #endif /* _MSC_VER */
|
428
|
3174 }
|
|
3175
|
|
3176 stuff_buffered_input (stuff);
|
|
3177
|
|
3178 kill_buffer_processes (Qnil);
|
|
3179
|
|
3180 #ifdef CLASH_DETECTION
|
|
3181 unlock_all_files ();
|
|
3182 #endif
|
|
3183
|
|
3184 #ifdef TOOLTALK
|
|
3185 tt_session_quit (tt_default_session ());
|
|
3186 #if 0
|
|
3187 /* The following crashes when built on X11R5 and run on X11R6 */
|
|
3188 tt_close ();
|
|
3189 #endif
|
|
3190 #endif /* TOOLTALK */
|
|
3191 }
|
|
3192
|
771
|
3193 /* Dumping apparently isn't supported by versions of GCC >= 2.8. */
|
|
3194 /* The following needs conditionalization on whether either XEmacs or */
|
|
3195 /* various system shared libraries have been built and linked with */
|
|
3196 /* GCC >= 2.8. -slb */
|
|
3197 #if defined(GNU_MALLOC)
|
|
3198 static void
|
|
3199 voodoo_free_hook (void *mem)
|
|
3200 {
|
|
3201 /* Disable all calls to free() when XEmacs is exiting and it doesn't */
|
|
3202 /* matter. */
|
|
3203 __free_hook =
|
|
3204 #ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */
|
|
3205 (__typeof__ (__free_hook))
|
440
|
3206 #endif
|
771
|
3207 voodoo_free_hook;
|
|
3208 }
|
|
3209 #endif /* GNU_MALLOC */
|
|
3210
|
|
3211 DEFUN ("kill-emacs", Fkill_emacs, 0, 1, "P", /*
|
|
3212 Exit the XEmacs job and kill it. Ask for confirmation, without argument.
|
|
3213 If ARG is an integer, return ARG as the exit program code.
|
|
3214 If ARG is a string, stuff it as keyboard input.
|
|
3215
|
|
3216 The value of `kill-emacs-hook', if not void,
|
|
3217 is a list of functions (of no args),
|
|
3218 all of which are called before XEmacs is actually killed.
|
428
|
3219 */
|
771
|
3220 (arg))
|
428
|
3221 {
|
|
3222 /* This function can GC */
|
771
|
3223 struct gcpro gcpro1;
|
|
3224
|
|
3225 GCPRO1 (arg);
|
|
3226
|
|
3227 if (feof (stdin))
|
|
3228 arg = Qt;
|
|
3229
|
|
3230 if (!preparing_for_armageddon && !noninteractive)
|
|
3231 run_hook (Qkill_emacs_hook);
|
|
3232
|
|
3233 ensure_no_quitting_from_now_on ();
|
|
3234
|
|
3235 if (!preparing_for_armageddon)
|
428
|
3236 {
|
771
|
3237 Lisp_Object concons, nextcons;
|
|
3238
|
|
3239 /* Normally, go ahead and delete all the consoles now.
|
|
3240 Some unmentionably lame window systems (MS Wwwww...... eek,
|
|
3241 I can't even say it) don't properly clean up after themselves,
|
|
3242 and even for those that do, it might be cleaner this way.
|
|
3243 If we're going down, however, we don't do this (might
|
|
3244 be too dangerous), and if we get a crash somewhere within
|
|
3245 this loop, we'll still autosave and won't try this again. */
|
|
3246
|
|
3247 LIST_LOOP_DELETING (concons, nextcons, Vconsole_list)
|
|
3248 {
|
|
3249 /* There is very little point in deleting the stream console.
|
|
3250 It uses stdio, which should flush any buffered output and
|
|
3251 something can only go wrong. -slb */
|
|
3252 /* I changed my mind. There's a stupid hack in close to add
|
|
3253 a trailing newline. */
|
|
3254 /*if (!CONSOLE_STREAM_P (XCONSOLE (XCAR (concons))))*/
|
|
3255 delete_console_internal (XCONSOLE (XCAR (concons)), 1, 1, 0);
|
|
3256 }
|
428
|
3257 }
|
|
3258
|
|
3259 UNGCPRO;
|
|
3260
|
771
|
3261 #ifdef HAVE_MS_WINDOWS
|
|
3262 pause_so_user_can_read_messages (1);
|
428
|
3263 #endif
|
771
|
3264
|
|
3265 shut_down_emacs (0, STRINGP (arg) ? arg : Qnil, 0);
|
|
3266
|
|
3267 #if defined(GNU_MALLOC)
|
|
3268 __free_hook =
|
|
3269 #ifdef __GNUC__ /* prototype of __free_hook varies with glibc version */
|
|
3270 (__typeof__ (__free_hook))
|
|
3271 #endif
|
|
3272 voodoo_free_hook;
|
428
|
3273 #endif
|
771
|
3274
|
|
3275 exit (INTP (arg) ? XINT (arg) : 0);
|
|
3276 /* NOTREACHED */
|
|
3277 return Qnil; /* I'm sick of the compiler warning */
|
428
|
3278 }
|
|
3279
|
771
|
3280 /* -------------------------------- */
|
|
3281 /* abnormal shutdowns: GP faults */
|
|
3282 /* -------------------------------- */
|
|
3283
|
|
3284 /* Handle bus errors, illegal instruction, etc: actual implementation. */
|
|
3285 static void
|
|
3286 guts_of_fatal_error_signal (int sig)
|
428
|
3287 {
|
771
|
3288 fatal_error_in_progress++;
|
|
3289 inhibit_non_essential_printing_operations = 1;
|
|
3290 preparing_for_armageddon = 1;
|
|
3291
|
|
3292 ensure_no_quitting_from_now_on ();
|
|
3293
|
|
3294 /* Only try auto-saving first time through. If we crash in auto-saving,
|
|
3295 don't do it again. */
|
|
3296 if (fatal_error_in_progress == 1)
|
428
|
3297 {
|
771
|
3298 Fdo_auto_save (Qt, Qnil); /* do this before anything hazardous */
|
|
3299 /* Do this so that the variable has the same value of 2 regardless of
|
|
3300 whether we made it through auto-saving correctly. */
|
|
3301 fatal_error_in_progress++;
|
428
|
3302 }
|
771
|
3303 else if (fatal_error_in_progress == 2)
|
|
3304 stderr_out ("WARNING: Unable to auto-save your files properly.\n"
|
|
3305 "Some or all may in fact have been auto-saved.\n"
|
|
3306 "\n");
|
|
3307
|
|
3308 /* Now, reset our signal handler, so the next time, we just die.
|
|
3309 Don't do this before auto-saving. */
|
|
3310 if (sig >= 0)
|
|
3311 EMACS_SIGNAL (sig, SIG_DFL);
|
|
3312
|
|
3313 /* Keep in mind that there's more than one signal that we can crash
|
|
3314 on. */
|
|
3315 /* If fatal error occurs in code below, avoid infinite recursion. */
|
|
3316 if (fatal_error_in_progress <= 2)
|
|
3317 {
|
|
3318 shut_down_emacs (sig, Qnil, 1);
|
|
3319 stderr_out ("\nLisp backtrace follows:\n\n");
|
|
3320 debug_backtrace ();
|
|
3321 # if 0 /* This is evil, rarely useful, and causes grief in some cases. */
|
|
3322 /* Check for Sun-style stack printing via /proc */
|
|
3323 {
|
|
3324 const Char_ASCII *pstack = "/usr/proc/bin/pstack";
|
|
3325 if (access (pstack, X_OK) == 0)
|
|
3326 {
|
|
3327 Char_ASCII buf[100];
|
|
3328 stderr_out ("\nC backtrace follows:\n"
|
|
3329 "(A real debugger may provide better information)\n\n");
|
|
3330 sprintf (buf, "%s %d >&2", pstack, (int)getpid());
|
|
3331 system (buf);
|
|
3332 }
|
|
3333 }
|
|
3334 # endif
|
|
3335 #ifdef HAVE_MS_WINDOWS
|
|
3336 pause_so_user_can_read_messages (0);
|
|
3337 #endif
|
|
3338 }
|
428
|
3339 }
|
|
3340
|
771
|
3341 /* This is called when a fatal signal (SIGBUS aka "bus error", SIGSEGV aka
|
|
3342 "segmentation violation", SIGILL aka "illegal instruction", and many
|
|
3343 others) is sent to the program. This generally happens under Unix,
|
|
3344 not MS Windows. */
|
|
3345 SIGTYPE
|
|
3346 fatal_error_signal (int sig)
|
428
|
3347 {
|
771
|
3348 /* Unblock the signal so that if the same signal gets sent in the
|
|
3349 code below, we avoid a deadlock. */
|
|
3350 EMACS_UNBLOCK_SIGNAL (sig);
|
|
3351
|
|
3352 guts_of_fatal_error_signal (sig);
|
|
3353
|
|
3354 /* Signal the same code; this time it will really be fatal. */
|
|
3355 #ifdef WIN32_NATIVE
|
|
3356 raise (sig);
|
|
3357 #else
|
|
3358 kill (qxe_getpid (), sig);
|
|
3359 #endif
|
|
3360 SIGRETURN;
|
428
|
3361 }
|
|
3362
|
771
|
3363 #ifdef _MSC_VER
|
|
3364
|
|
3365 #define STATUS_ASSERTION_FAILURE 0xE0000001
|
|
3366
|
|
3367 static DWORD
|
|
3368 mswindows_handle_hardware_exceptions_1 (void)
|
428
|
3369 {
|
793
|
3370 inhibit_non_essential_printing_operations = 1;
|
|
3371 preparing_for_armageddon = 1;
|
771
|
3372 pause_so_user_can_read_messages (0);
|
|
3373 return EXCEPTION_EXECUTE_HANDLER;
|
428
|
3374 }
|
|
3375
|
771
|
3376 /* This is called under MS Windows when an exception (this encompasses both
|
|
3377 user-defined exceptions and hardware exceptions such as GP faults aka
|
|
3378 SIGBUS or SIGSEGV) is triggered. */
|
|
3379
|
|
3380 static DWORD
|
|
3381 mswindows_handle_hardware_exceptions (DWORD code)
|
428
|
3382 {
|
771
|
3383 if (code != STATUS_ACCESS_VIOLATION && code != STATUS_ILLEGAL_INSTRUCTION
|
|
3384 && code != STATUS_PRIVILEGED_INSTRUCTION
|
|
3385 && code != STATUS_DATATYPE_MISALIGNMENT
|
|
3386 && code != STATUS_ASSERTION_FAILURE)
|
|
3387 return EXCEPTION_CONTINUE_SEARCH;
|
|
3388
|
|
3389 /* I don't know if this filter is still wrapped in the outer __try, but
|
|
3390 it doesn't hurt to have another one, and it lets us control more
|
|
3391 exactly what we really want to do in such a situation. What we do is
|
|
3392 pause, if we haven't already done so, so that the user can see what's
|
|
3393 output. This is critical because otherwise the output is gone. */
|
|
3394 __try
|
|
3395 {
|
|
3396 guts_of_fatal_error_signal (-1);
|
|
3397 }
|
|
3398 /* VC++ documentation says that
|
|
3399 GetExceptionCode() cannot be called inside the filter itself. */
|
|
3400
|
|
3401 /* __except (mswindows_handle_hardware_exceptions (GetExceptionCode ())) {}
|
|
3402
|
|
3403 The line above is original. Unfortunately, when an error is tripped
|
|
3404 inside of the handler (e.g. during Fbacktrace()), and the handler for
|
|
3405 the handler is invoked, it correctly notices that something is amiss
|
|
3406 and it should just return -- but it returns EXCEPTION_CONTINUE_SEARCH,
|
|
3407 which causes the debugger to be invoked debugging the handler code in
|
|
3408 this function -- and WITH THE STACK UNWOUND so that you see main()
|
|
3409 calling mswindows_handle_hardware_exceptions(), calling Fbacktrace(),
|
|
3410 and a crash a couple of frames in -- AND NO SIGN OF THE ORIGINAL CRASH!
|
|
3411
|
|
3412 There's some real weirdness going on in the stack handling -- unlike
|
|
3413 in Unix, where further crashes just keep adding to the stack, it seems
|
|
3414 that under the structured-exception-handling, the stack can actually
|
|
3415 bounce back and forth between the full stack at the location of the
|
|
3416 exception and the unwound stack at the place where the __try clause was
|
|
3417 established. I don't completely understand it. What I do know is that
|
|
3418 returning EXCEPTION_EXECUTE_HANDLER on nested crash has the effect of
|
|
3419 aborting execution of the handler and going back to the outer filter
|
|
3420 function, which returns EXCEPTION_CONTINUE_SEARCH and everything is
|
|
3421 hunky-dorey -- your debugger sees a crash at the right location with
|
|
3422 the right stack.
|
|
3423
|
|
3424 I'm leaving in the trickier Unix-like code in the handler; someone who
|
|
3425 understands better than me how the stack works in these handlers could
|
|
3426 fix it up more. As it is, it works pretty well, so I'm not likely to
|
|
3427 touch it more. --ben
|
|
3428 */
|
|
3429
|
|
3430 __except (mswindows_handle_hardware_exceptions_1 ()) {}
|
|
3431
|
|
3432 /* pretend we didn't handle this, so that the debugger is invoked and/or
|
|
3433 the normal GPF box appears. */
|
|
3434 return EXCEPTION_CONTINUE_SEARCH;
|
428
|
3435 }
|
|
3436
|
771
|
3437 #endif /* _MSC_VER */
|
|
3438
|
|
3439 /* -------------------------------------- */
|
|
3440 /* abnormal shutdowns: assertion failures */
|
|
3441 /* -------------------------------------- */
|
428
|
3442
|
|
3443 /* This flag is useful to define if you're under a debugger; this way, you
|
|
3444 can put a breakpoint of assert_failed() and debug multiple problems
|
|
3445 in one session without having to recompile. */
|
|
3446 /* #define ASSERTIONS_DONT_ABORT */
|
|
3447
|
|
3448 #ifdef USE_ASSERTIONS
|
|
3449 /* This highly dubious kludge ... shut up Jamie, I'm tired of your slagging. */
|
|
3450
|
771
|
3451 /* Nonzero if handling an assertion failure. (Bumped by one each time
|
|
3452 we recursively hit such a failure.) */
|
442
|
3453 static int in_assert_failed;
|
771
|
3454
|
442
|
3455 static const char *assert_failed_file;
|
|
3456 static int assert_failed_line;
|
|
3457 static const char *assert_failed_expr;
|
|
3458
|
|
3459 #ifdef fprintf
|
|
3460 #undef fprintf
|
|
3461 #endif
|
|
3462
|
771
|
3463 /* This is called when an assert() fails or when abort() is called -- both
|
|
3464 of those are defined in the preprocessor to an expansion involving
|
|
3465 assert_failed(). */
|
442
|
3466 void
|
|
3467 assert_failed (const char *file, int line, const char *expr)
|
428
|
3468 {
|
442
|
3469 /* If we're already crashing, let's not crash again. This might be
|
|
3470 critical to getting auto-saving working properly. */
|
|
3471 if (fatal_error_in_progress)
|
|
3472 return;
|
|
3473
|
|
3474 /* We are extremely paranoid so we sensibly deal with recursive
|
|
3475 assertion failures. */
|
|
3476 in_assert_failed++;
|
771
|
3477 inhibit_non_essential_printing_operations = 1;
|
442
|
3478
|
|
3479 if (in_assert_failed >= 4)
|
|
3480 _exit (-1);
|
|
3481 else if (in_assert_failed == 3)
|
|
3482 {
|
771
|
3483 debugging_breakpoint ();
|
442
|
3484 _exit (-1);
|
|
3485 }
|
|
3486 else if (in_assert_failed == 2)
|
|
3487 {
|
771
|
3488 /* Ultra-paranoia. stderr_out() tries very hard not to do
|
|
3489 anything during assertion failures that might trigger more
|
|
3490 failures; but we might have messed up somewhere. fprintf was
|
|
3491 undeffed above, in case it was encapsulated. */
|
442
|
3492 fprintf (stderr,
|
|
3493 "Fatal error: recursive assertion failure, "
|
|
3494 "file %s, line %d, %s\n",
|
|
3495 file, line, expr);
|
|
3496 fprintf (stderr,
|
|
3497 "Original assertion failure: file %s, line %d, %s\n",
|
|
3498 assert_failed_file, assert_failed_line, assert_failed_expr);
|
|
3499 }
|
|
3500 else
|
|
3501 {
|
|
3502 assert_failed_file = file;
|
|
3503 assert_failed_line = line;
|
|
3504 assert_failed_expr = expr;
|
|
3505
|
771
|
3506 stderr_out ("\nFatal error: assertion failed, file %s, line %d, %s\n",
|
|
3507 file, line, expr);
|
442
|
3508 }
|
|
3509
|
771
|
3510 /* Enable the following if you want a breakpoint right away to the
|
|
3511 debugger, without the whole shutdown processing first. This can be
|
|
3512 useful if you're afraid the shutdown processing will modify state that
|
|
3513 you're trying to debug (generally fairly unlikely); but you then don't
|
|
3514 get the auto-save behavior, which may be extremely important if you
|
|
3515 were in the middle of doing something */
|
|
3516 /* debugging_breakpoint (); */
|
442
|
3517 #if !defined (ASSERTIONS_DONT_ABORT)
|
771
|
3518 #ifdef _MSC_VER
|
|
3519 /* Calling abort() directly just seems to exit, in a way we can't
|
|
3520 trap. (#### The docs say it does raise(SIGABRT), which we should be
|
|
3521 able to trap. Perhaps we're messing up somewhere? Or perhaps MS is
|
|
3522 messed up.)
|
|
3523
|
|
3524 So, instead we cause an exception and enter into the structured
|
|
3525 exception-handling mechanism, which is just like what happens when a
|
|
3526 GPF occurs, and is cleaner anyway. (If we entered into one of the
|
|
3527 signal handlers, a crash in there would enter anyway into the
|
|
3528 structured exception stuff, and you'd get some weird mixture. Cleaner
|
|
3529 to keep it all in the expected way.)
|
|
3530 */
|
|
3531 /* Either of the following work in terms of causing an exception. The
|
|
3532 second one looks cleaner but you get an odd message about "Unknown
|
|
3533 software exception ..." without the obvious "OK to terminate", "Cancel
|
|
3534 to debug"; instead, you just get OK/Cancel, which in fact do those
|
|
3535 same things. */
|
|
3536 * ((int *) 0) = 666;
|
|
3537 /* RaiseException (STATUS_ASSERTION_FAILURE, EXCEPTION_NONCONTINUABLE, 0,
|
|
3538 0); */
|
|
3539 #else
|
|
3540 really_abort ();
|
|
3541 #endif /* _MSC_VER */
|
|
3542 #endif /* !defined (ASSERTIONS_DONT_ABORT) */
|
|
3543 inhibit_non_essential_printing_operations = 0;
|
442
|
3544 in_assert_failed = 0;
|
428
|
3545 }
|
|
3546 #endif /* USE_ASSERTIONS */
|
|
3547
|
771
|
3548 /* -------------------------------------- */
|
|
3549 /* low-memory notification */
|
|
3550 /* -------------------------------------- */
|
|
3551
|
|
3552 #ifdef SIGDANGER
|
|
3553
|
|
3554 /* Handler for SIGDANGER. */
|
|
3555 SIGTYPE
|
|
3556 memory_warning_signal (int sig)
|
|
3557 {
|
|
3558 /* #### bad bad bad; this function shouldn't do anything except
|
|
3559 set a flag, or weird corruption could happen. */
|
|
3560 EMACS_SIGNAL (sig, memory_warning_signal);
|
|
3561
|
|
3562 malloc_warning
|
|
3563 (GETTEXT ("Operating system warns that virtual memory is running low.\n"));
|
|
3564
|
|
3565 /* It might be unsafe to call do_auto_save now. */
|
|
3566 force_auto_save_soon ();
|
|
3567 }
|
|
3568 #endif /* SIGDANGER */
|
|
3569
|
|
3570
|
|
3571 /************************************************************************/
|
|
3572 /* Miscellaneous */
|
|
3573 /************************************************************************/
|
|
3574
|
|
3575 DEFUN ("noninteractive", Fnoninteractive, 0, 0, 0, /*
|
|
3576 Non-nil return value means XEmacs is running without interactive terminal.
|
528
|
3577 */
|
771
|
3578 ())
|
528
|
3579 {
|
771
|
3580 return noninteractive ? Qt : Qnil;
|
528
|
3581 }
|
|
3582
|
428
|
3583 #ifdef QUANTIFY
|
|
3584 DEFUN ("quantify-start-recording-data", Fquantify_start_recording_data,
|
|
3585 0, 0, "", /*
|
|
3586 Start recording Quantify data.
|
|
3587 */
|
|
3588 ())
|
|
3589 {
|
|
3590 quantify_start_recording_data ();
|
|
3591 return Qnil;
|
|
3592 }
|
|
3593
|
|
3594 DEFUN ("quantify-stop-recording-data", Fquantify_stop_recording_data,
|
|
3595 0, 0, "", /*
|
|
3596 Stop recording Quantify data.
|
|
3597 */
|
|
3598 ())
|
|
3599 {
|
|
3600 quantify_stop_recording_data ();
|
|
3601 return Qnil;
|
|
3602 }
|
|
3603
|
|
3604 DEFUN ("quantify-clear-data", Fquantify_clear_data, 0, 0, "", /*
|
|
3605 Clear all Quantify data.
|
|
3606 */
|
|
3607 ())
|
|
3608 {
|
|
3609 quantify_clear_data ();
|
|
3610 return Qnil;
|
|
3611 }
|
|
3612 #endif /* QUANTIFY */
|
|
3613
|
|
3614 void
|
|
3615 syms_of_emacs (void)
|
|
3616 {
|
|
3617 #ifndef CANNOT_DUMP
|
|
3618 DEFSUBR (Fdump_emacs);
|
|
3619 #endif /* !CANNOT_DUMP */
|
|
3620
|
|
3621 DEFSUBR (Frun_emacs_from_temacs);
|
|
3622 DEFSUBR (Frunning_temacs_p);
|
|
3623 DEFSUBR (Finvocation_name);
|
|
3624 DEFSUBR (Finvocation_directory);
|
|
3625 DEFSUBR (Fkill_emacs);
|
|
3626 DEFSUBR (Fnoninteractive);
|
|
3627
|
528
|
3628 #ifdef DEBUG_XEMACS
|
|
3629 DEFSUBR (Fforce_debugging_signal);
|
|
3630 #endif
|
|
3631
|
428
|
3632 #ifdef QUANTIFY
|
|
3633 DEFSUBR (Fquantify_start_recording_data);
|
|
3634 DEFSUBR (Fquantify_stop_recording_data);
|
|
3635 DEFSUBR (Fquantify_clear_data);
|
|
3636 #endif /* QUANTIFY */
|
|
3637
|
563
|
3638 DEFSYMBOL (Qkill_emacs_hook);
|
|
3639 DEFSYMBOL (Qsave_buffers_kill_emacs);
|
428
|
3640 }
|
|
3641
|
776
|
3642 /* Yuck! These variables may get set from command-line options when
|
|
3643 dumping; if we don't clear them, they will still be on once the dumped
|
|
3644 XEmacs reloads. (not an issue with pdump, as we kludge around this in
|
|
3645 main_1().) */
|
|
3646
|
|
3647 void
|
|
3648 zero_out_command_line_status_vars (void)
|
|
3649 {
|
|
3650 vanilla_inhibiting = 0;
|
|
3651 inhibit_early_packages = 0;
|
|
3652 inhibit_all_packages = 0;
|
|
3653 inhibit_autoloads = 0;
|
|
3654 debug_paths = 0;
|
|
3655 #ifndef INHIBIT_SITE_LISP
|
|
3656 inhibit_site_lisp = 0;
|
|
3657 #else
|
|
3658 inhibit_site_lisp = 1;
|
|
3659 #endif
|
|
3660 #ifndef INHIBIT_SITE_MODULES
|
|
3661 inhibit_site_modules = 0;
|
|
3662 #else
|
|
3663 inhibit_site_modules = 1;
|
|
3664 #endif
|
|
3665 }
|
|
3666
|
428
|
3667 void
|
|
3668 vars_of_emacs (void)
|
|
3669 {
|
|
3670 DEFVAR_BOOL ("suppress-early-error-handler-backtrace",
|
|
3671 &suppress_early_error_handler_backtrace /*
|
|
3672 Non-nil means early error handler shouldn't print a backtrace.
|
|
3673 */ );
|
|
3674
|
|
3675 DEFVAR_LISP ("command-line-args", &Vcommand_line_args /*
|
|
3676 Args passed by shell to XEmacs, as a list of strings.
|
|
3677 */ );
|
|
3678
|
|
3679 DEFVAR_LISP ("invocation-name", &Vinvocation_name /*
|
|
3680 The program name that was used to run XEmacs.
|
|
3681 Any directory names are omitted.
|
|
3682 */ );
|
|
3683
|
|
3684 DEFVAR_LISP ("invocation-directory", &Vinvocation_directory /*
|
|
3685 The directory in which the XEmacs executable was found, to run it.
|
|
3686 The value is simply the program name if that directory's name is not known.
|
|
3687 */ );
|
|
3688
|
|
3689 DEFVAR_LISP ("invocation-path", &Vinvocation_path /*
|
|
3690 The path in which the XEmacs executable was found, to run it.
|
|
3691 The value is simply the value of environment variable PATH on startup
|
|
3692 if XEmacs was found there.
|
|
3693 */ );
|
|
3694
|
|
3695 #if 0 /* FSFmacs */
|
776
|
3696 xxDEFVAR_LISP ("installation-directory", &Vinstallation_directory /*
|
|
3697 A directory within which to look for the `lib-src' and `etc' directories.
|
|
3698 This is non-nil when we can't find those directories in their standard
|
|
3699 installed locations, but we can find them ear where the XEmacs executable
|
|
3700 was found.
|
|
3701 */ );
|
428
|
3702 #endif
|
|
3703
|
|
3704 DEFVAR_LISP ("system-type", &Vsystem_type /*
|
|
3705 Symbol indicating type of operating system you are using.
|
|
3706 */ );
|
|
3707 Vsystem_type = intern (SYSTEM_TYPE);
|
771
|
3708 Fprovide (Vsystem_type);
|
428
|
3709
|
|
3710 #ifndef EMACS_CONFIGURATION
|
|
3711 # define EMACS_CONFIGURATION "UNKNOWN"
|
|
3712 #endif
|
|
3713 DEFVAR_LISP ("system-configuration", &Vsystem_configuration /*
|
|
3714 String naming the configuration XEmacs was built for.
|
|
3715 */ );
|
|
3716 Vsystem_configuration = build_string (EMACS_CONFIGURATION);
|
|
3717
|
|
3718 #ifndef EMACS_CONFIG_OPTIONS
|
|
3719 # define EMACS_CONFIG_OPTIONS "UNKNOWN"
|
|
3720 #endif
|
|
3721 DEFVAR_LISP ("system-configuration-options", &Vsystem_configuration_options /*
|
|
3722 String containing the configuration options XEmacs was built with.
|
|
3723 */ );
|
|
3724 Vsystem_configuration_options = build_string (EMACS_CONFIG_OPTIONS);
|
|
3725
|
|
3726 DEFVAR_LISP ("emacs-major-version", &Vemacs_major_version /*
|
|
3727 Major version number of this version of Emacs, as an integer.
|
|
3728 Warning: this variable did not exist in Emacs versions earlier than:
|
|
3729 FSF Emacs: 19.23
|
|
3730 XEmacs: 19.10
|
|
3731 */ );
|
|
3732 Vemacs_major_version = make_int (EMACS_MAJOR_VERSION);
|
|
3733
|
|
3734 DEFVAR_LISP ("emacs-minor-version", &Vemacs_minor_version /*
|
|
3735 Minor version number of this version of Emacs, as an integer.
|
|
3736 Warning: this variable did not exist in Emacs versions earlier than:
|
|
3737 FSF Emacs: 19.23
|
|
3738 XEmacs: 19.10
|
|
3739 */ );
|
|
3740 Vemacs_minor_version = make_int (EMACS_MINOR_VERSION);
|
|
3741
|
|
3742 DEFVAR_LISP ("emacs-patch-level", &Vemacs_patch_level /*
|
|
3743 The patch level of this version of Emacs, as an integer.
|
|
3744 The value is non-nil if this version of XEmacs is part of a series of
|
|
3745 stable XEmacsen, but has bug fixes applied.
|
|
3746 Warning: this variable does not exist in FSF Emacs or in XEmacs versions
|
|
3747 earlier than 21.1.1
|
|
3748 */ );
|
|
3749 #ifdef EMACS_PATCH_LEVEL
|
|
3750 Vemacs_patch_level = make_int (EMACS_PATCH_LEVEL);
|
|
3751 #else
|
|
3752 Vemacs_patch_level = Qnil;
|
|
3753 #endif
|
|
3754
|
|
3755 DEFVAR_LISP ("emacs-beta-version", &Vemacs_beta_version /*
|
|
3756 Beta number of this version of Emacs, as an integer.
|
|
3757 The value is nil if this is an officially released version of XEmacs.
|
|
3758 Warning: this variable does not exist in FSF Emacs or in XEmacs versions
|
|
3759 earlier than 20.3.
|
|
3760 */ );
|
|
3761 #ifdef EMACS_BETA_VERSION
|
|
3762 Vemacs_beta_version = make_int (EMACS_BETA_VERSION);
|
|
3763 #else
|
|
3764 Vemacs_beta_version = Qnil;
|
|
3765 #endif
|
|
3766
|
|
3767 #ifdef INFODOCK
|
|
3768 DEFVAR_LISP ("infodock-major-version", &Vinfodock_major_version /*
|
|
3769 Major version number of this InfoDock release.
|
|
3770 */ );
|
|
3771 Vinfodock_major_version = make_int (INFODOCK_MAJOR_VERSION);
|
|
3772
|
|
3773 DEFVAR_LISP ("infodock-minor-version", &Vinfodock_minor_version /*
|
|
3774 Minor version number of this InfoDock release.
|
|
3775 */ );
|
|
3776 Vinfodock_minor_version = make_int (INFODOCK_MINOR_VERSION);
|
|
3777
|
|
3778 DEFVAR_LISP ("infodock-build-version", &Vinfodock_build_version /*
|
|
3779 Build version of this InfoDock release.
|
|
3780 */ );
|
|
3781 Vinfodock_build_version = make_int (INFODOCK_BUILD_VERSION);
|
|
3782 #endif
|
|
3783
|
|
3784 DEFVAR_LISP ("xemacs-codename", &Vxemacs_codename /*
|
|
3785 Codename of this version of Emacs (a string).
|
|
3786 */ );
|
|
3787 #ifndef XEMACS_CODENAME
|
|
3788 #define XEMACS_CODENAME "Noname"
|
|
3789 #endif
|
|
3790 Vxemacs_codename = build_string (XEMACS_CODENAME);
|
|
3791
|
442
|
3792 /* Lisp variables which contain command line flags.
|
|
3793
|
|
3794 The portable dumper stomps on these; they must be saved and restored
|
|
3795 if they are processed before the call to pdump_load() in main_1().
|
|
3796 */
|
428
|
3797 DEFVAR_BOOL ("noninteractive", &noninteractive1 /*
|
|
3798 Non-nil means XEmacs is running without interactive terminal.
|
|
3799 */ );
|
|
3800
|
776
|
3801 DEFVAR_BOOL ("vanilla-inhibiting", &vanilla_inhibiting /*
|
|
3802 Set to non-nil when the user-init and site-start files should not be loaded.
|
|
3803 */ );
|
|
3804
|
428
|
3805 DEFVAR_BOOL ("inhibit-early-packages", &inhibit_early_packages /*
|
|
3806 Set to non-nil when the early packages should not be respected at startup.
|
|
3807 */ );
|
|
3808
|
776
|
3809 DEFVAR_BOOL ("inhibit-all-packages", &inhibit_all_packages /*
|
|
3810 Set to non-nil when the no packages should not be respected at startup.
|
|
3811 XEmacs will utterly ignore the packages -- not in load-path, not set up as
|
|
3812 autoloads, nothing.
|
|
3813 */ );
|
|
3814
|
428
|
3815 DEFVAR_BOOL ("inhibit-autoloads", &inhibit_autoloads /*
|
|
3816 Set to non-nil when autoloads should not be loaded at startup.
|
|
3817 */ );
|
|
3818
|
|
3819 DEFVAR_BOOL ("debug-paths", &debug_paths /*
|
|
3820 Set to non-nil when debug information about paths should be printed.
|
|
3821 */ );
|
|
3822
|
|
3823 DEFVAR_BOOL ("inhibit-site-lisp", &inhibit_site_lisp /*
|
|
3824 Set to non-nil when the site-lisp should not be searched at startup.
|
|
3825 */ );
|
|
3826 #ifdef INHIBIT_SITE_LISP
|
|
3827 inhibit_site_lisp = 1;
|
|
3828 #endif
|
|
3829
|
|
3830 DEFVAR_BOOL ("inhibit-site-modules", &inhibit_site_modules /*
|
|
3831 Set to non-nil when site-modules should not be searched at startup.
|
|
3832 */ );
|
|
3833 #ifdef INHIBIT_SITE_MODULES
|
|
3834 inhibit_site_modules = 1;
|
|
3835 #endif
|
|
3836
|
|
3837 DEFVAR_INT ("emacs-priority", &emacs_priority /*
|
|
3838 Priority for XEmacs to run at.
|
|
3839 This value is effective only if set before XEmacs is dumped,
|
|
3840 and only if the XEmacs executable is installed with setuid to permit
|
|
3841 it to change priority. (XEmacs sets its uid back to the real uid.)
|
|
3842 Currently, you need to define SET_EMACS_PRIORITY in `config.h'
|
|
3843 before you compile XEmacs, to enable the code for this feature.
|
|
3844 */ );
|
|
3845 emacs_priority = 0;
|
|
3846
|
|
3847 DEFVAR_CONST_LISP ("internal-error-checking", &Vinternal_error_checking /*
|
|
3848 Internal error checking built-in into this instance of XEmacs.
|
|
3849 This is a list of symbols, initialized at build-time. Legal symbols
|
|
3850 are:
|
|
3851
|
|
3852 extents - check extents prior to each extent change;
|
800
|
3853 types - check types strictly;
|
428
|
3854 malloc - check operation of malloc;
|
|
3855 gc - check garbage collection;
|
800
|
3856 text - check text and buffer positions;
|
|
3857 display - check redisplay structure consistency;
|
|
3858 glyphs - check glyph structure consistency;
|
|
3859 byte-code - check byte-code consistency;.
|
|
3860 structures - check other structure consistency.
|
442
|
3861
|
|
3862 quick-build - user has requested the "quick-build" configure option.
|
428
|
3863 */ );
|
|
3864 Vinternal_error_checking = Qnil;
|
|
3865 #ifdef ERROR_CHECK_EXTENTS
|
|
3866 Vinternal_error_checking = Fcons (intern ("extents"),
|
|
3867 Vinternal_error_checking);
|
|
3868 #endif
|
800
|
3869 #ifdef ERROR_CHECK_TYPES
|
|
3870 Vinternal_error_checking = Fcons (intern ("types"),
|
428
|
3871 Vinternal_error_checking);
|
|
3872 #endif
|
|
3873 #ifdef ERROR_CHECK_MALLOC
|
|
3874 Vinternal_error_checking = Fcons (intern ("malloc"),
|
|
3875 Vinternal_error_checking);
|
|
3876 #endif
|
|
3877 #ifdef ERROR_CHECK_GC
|
|
3878 Vinternal_error_checking = Fcons (intern ("gc"),
|
|
3879 Vinternal_error_checking);
|
|
3880 #endif
|
800
|
3881 #ifdef ERROR_CHECK_TEXT
|
|
3882 Vinternal_error_checking = Fcons (intern ("text"),
|
|
3883 Vinternal_error_checking);
|
|
3884 #endif
|
|
3885 #ifdef ERROR_CHECK_DISPLAY
|
|
3886 Vinternal_error_checking = Fcons (intern ("display"),
|
|
3887 Vinternal_error_checking);
|
|
3888 #endif
|
|
3889 #ifdef ERROR_CHECK_GLYPHS
|
|
3890 Vinternal_error_checking = Fcons (intern ("glyphs"),
|
|
3891 Vinternal_error_checking);
|
|
3892 #endif
|
|
3893 #ifdef ERROR_CHECK_BYTE_CODE
|
|
3894 Vinternal_error_checking = Fcons (intern ("byte-code"),
|
|
3895 Vinternal_error_checking);
|
|
3896 #endif
|
|
3897 #ifdef ERROR_CHECK_STRUCTURES
|
|
3898 Vinternal_error_checking = Fcons (intern ("structures"),
|
428
|
3899 Vinternal_error_checking);
|
|
3900 #endif
|
442
|
3901 #ifdef QUICK_BUILD
|
|
3902 Vinternal_error_checking = Fcons (intern ("quick-build"),
|
|
3903 Vinternal_error_checking);
|
|
3904 #endif
|
428
|
3905
|
438
|
3906 DEFVAR_CONST_LISP ("mail-lock-methods", &Vmail_lock_methods /*
|
|
3907 Mail spool locking methods supported by this instance of XEmacs.
|
|
3908 This is a list of symbols. Each of the symbols is one of the
|
|
3909 following: dot, lockf, flock, locking, mmdf.
|
|
3910 */ );
|
|
3911 {
|
|
3912 Vmail_lock_methods = Qnil;
|
|
3913 Vmail_lock_methods = Fcons (intern ("dot"), Vmail_lock_methods);
|
|
3914 #ifdef HAVE_LOCKF
|
|
3915 Vmail_lock_methods = Fcons (intern ("lockf"), Vmail_lock_methods);
|
|
3916 #endif
|
|
3917 #ifdef HAVE_FLOCK
|
|
3918 Vmail_lock_methods = Fcons (intern ("flock"), Vmail_lock_methods);
|
|
3919 #endif
|
|
3920 #ifdef HAVE_MMDF
|
|
3921 Vmail_lock_methods = Fcons (intern ("mmdf"), Vmail_lock_methods);
|
|
3922 #endif
|
|
3923 #ifdef HAVE_LOCKING
|
|
3924 Vmail_lock_methods = Fcons (intern ("locking"), Vmail_lock_methods);
|
|
3925 #endif
|
|
3926 }
|
442
|
3927
|
438
|
3928 DEFVAR_CONST_LISP ("configure-mail-lock-method", &Vconfigure_mail_lock_method /*
|
|
3929 Mail spool locking method suggested by configure. This is one
|
|
3930 of the symbols in MAIL-LOCK-METHODS.
|
|
3931 */ );
|
|
3932 {
|
|
3933 #if defined(MAIL_LOCK_FLOCK) && defined(HAVE_FLOCK)
|
771
|
3934 Vconfigure_mail_lock_method = intern ("flock");
|
438
|
3935 #elif defined(MAIL_LOCK_LOCKF) && defined(HAVE_LOCKF)
|
771
|
3936 Vconfigure_mail_lock_method = intern ("lockf");
|
438
|
3937 #elif defined(MAIL_LOCK_MMDF) && defined(HAVE_MMDF)
|
771
|
3938 Vconfigure_mail_lock_method = intern ("mmdf");
|
438
|
3939 #elif defined(MAIL_LOCK_LOCKING) && defined(HAVE_LOCKING)
|
771
|
3940 Vconfigure_mail_lock_method = intern ("locking");
|
438
|
3941 #else
|
771
|
3942 Vconfigure_mail_lock_method = intern ("dot");
|
438
|
3943 #endif
|
|
3944 }
|
428
|
3945 }
|
|
3946
|
|
3947 void
|
|
3948 complex_vars_of_emacs (void)
|
|
3949 {
|
|
3950 /* This is all related to path searching. */
|
|
3951
|
|
3952 DEFVAR_LISP ("emacs-program-name", &Vemacs_program_name /*
|
|
3953 *Name of the Emacs variant.
|
|
3954 For example, this may be \"xemacs\" or \"infodock\".
|
|
3955 This is mainly meant for use in path searching.
|
|
3956 */ );
|
771
|
3957 Vemacs_program_name = build_ext_string (PATH_PROGNAME, Qfile_name);
|
428
|
3958
|
|
3959 DEFVAR_LISP ("emacs-program-version", &Vemacs_program_version /*
|
|
3960 *Version of the Emacs variant.
|
444
|
3961 This typically has the form NN.NN-bNN.
|
428
|
3962 This is mainly meant for use in path searching.
|
|
3963 */ );
|
771
|
3964 Vemacs_program_version = build_ext_string (PATH_VERSION, Qfile_name);
|
428
|
3965
|
|
3966 DEFVAR_LISP ("exec-path", &Vexec_path /*
|
|
3967 *List of directories to search programs to run in subprocesses.
|
|
3968 Each element is a string (directory name) or nil (try default directory).
|
|
3969 */ );
|
|
3970 Vexec_path = Qnil;
|
|
3971
|
|
3972 DEFVAR_LISP ("exec-directory", &Vexec_directory /*
|
|
3973 *Directory of architecture-dependent files that come with XEmacs,
|
|
3974 especially executable programs intended for XEmacs to invoke.
|
|
3975 */ );
|
|
3976 Vexec_directory = Qnil;
|
|
3977
|
|
3978 DEFVAR_LISP ("configure-exec-directory", &Vconfigure_exec_directory /*
|
|
3979 For internal use by the build procedure only.
|
444
|
3980 configure's idea of what `exec-directory' will be.
|
428
|
3981 */ );
|
|
3982 #ifdef PATH_EXEC
|
|
3983 Vconfigure_exec_directory = Ffile_name_as_directory
|
771
|
3984 (build_ext_string (PATH_EXEC, Qfile_name));
|
428
|
3985 #else
|
|
3986 Vconfigure_exec_directory = Qnil;
|
|
3987 #endif
|
|
3988
|
|
3989 DEFVAR_LISP ("lisp-directory", &Vlisp_directory /*
|
|
3990 *Directory of core Lisp files that come with XEmacs.
|
|
3991 */ );
|
|
3992 Vlisp_directory = Qnil;
|
|
3993
|
|
3994 DEFVAR_LISP ("configure-lisp-directory", &Vconfigure_lisp_directory /*
|
|
3995 For internal use by the build procedure only.
|
444
|
3996 configure's idea of what `lisp-directory' will be.
|
428
|
3997 */ );
|
|
3998 #ifdef PATH_LOADSEARCH
|
|
3999 Vconfigure_lisp_directory = Ffile_name_as_directory
|
771
|
4000 (build_ext_string (PATH_LOADSEARCH, Qfile_name));
|
428
|
4001 #else
|
|
4002 Vconfigure_lisp_directory = Qnil;
|
|
4003 #endif
|
|
4004
|
460
|
4005 DEFVAR_LISP ("mule-lisp-directory", &Vmule_lisp_directory /*
|
|
4006 *Directory of Mule Lisp files that come with XEmacs.
|
|
4007 */ );
|
|
4008 Vmule_lisp_directory = Qnil;
|
|
4009
|
|
4010 DEFVAR_LISP ("configure-mule-lisp-directory", &Vconfigure_mule_lisp_directory /*
|
|
4011 For internal use by the build procedure only.
|
|
4012 configure's idea of what `mule-lisp-directory' will be.
|
|
4013 */ );
|
|
4014 #ifdef PATH_MULELOADSEARCH
|
|
4015 Vconfigure_mule_lisp_directory = Ffile_name_as_directory
|
|
4016 (build_string ((char *) PATH_MULELOADSEARCH));
|
|
4017 #else
|
|
4018 Vconfigure_mule_lisp_directory = Qnil;
|
|
4019 #endif
|
|
4020
|
428
|
4021 DEFVAR_LISP ("module-directory", &Vmodule_directory /*
|
|
4022 *Directory of core dynamic modules that come with XEmacs.
|
|
4023 */ );
|
|
4024 Vmodule_directory = Qnil;
|
|
4025
|
|
4026 DEFVAR_LISP ("configure-module-directory", &Vconfigure_module_directory /*
|
|
4027 For internal use by the build procedure only.
|
444
|
4028 configure's idea of what `module-directory' will be.
|
428
|
4029 */ );
|
|
4030 #ifdef PATH_MODULESEARCH
|
|
4031 Vconfigure_module_directory = Ffile_name_as_directory
|
771
|
4032 (build_ext_string (PATH_MODULESEARCH, Qfile_name));
|
428
|
4033 #else
|
|
4034 Vconfigure_module_directory = Qnil;
|
|
4035 #endif
|
|
4036
|
|
4037 DEFVAR_LISP ("configure-package-path", &Vconfigure_package_path /*
|
|
4038 For internal use by the build procedure only.
|
|
4039 configure's idea of what the package path will be.
|
|
4040 */ );
|
|
4041 #ifdef PATH_PACKAGEPATH
|
771
|
4042 Vconfigure_package_path = split_external_path (PATH_PACKAGEPATH);
|
428
|
4043 #else
|
|
4044 Vconfigure_package_path = Qnil;
|
|
4045 #endif
|
|
4046
|
|
4047 DEFVAR_LISP ("data-directory", &Vdata_directory /*
|
|
4048 *Directory of architecture-independent files that come with XEmacs,
|
|
4049 intended for XEmacs to use.
|
|
4050 Use of this variable in new code is almost never correct. See the
|
442
|
4051 functions `locate-data-file' and `locate-data-directory' and the variable
|
|
4052 `data-directory-list'.
|
428
|
4053 */ );
|
|
4054 Vdata_directory = Qnil;
|
|
4055
|
|
4056 DEFVAR_LISP ("configure-data-directory", &Vconfigure_data_directory /*
|
|
4057 For internal use by the build procedure only.
|
444
|
4058 configure's idea of what `data-directory' will be.
|
428
|
4059 */ );
|
|
4060 #ifdef PATH_DATA
|
|
4061 Vconfigure_data_directory = Ffile_name_as_directory
|
771
|
4062 (build_ext_string (PATH_DATA, Qfile_name));
|
428
|
4063 #else
|
|
4064 Vconfigure_data_directory = Qnil;
|
|
4065 #endif
|
|
4066
|
|
4067 DEFVAR_LISP ("data-directory-list", &Vdata_directory_list /*
|
|
4068 *List of directories of architecture-independent files that come with XEmacs
|
|
4069 or were installed as packages, and are intended for XEmacs to use.
|
|
4070 */ );
|
|
4071 Vdata_directory_list = Qnil;
|
|
4072
|
|
4073 DEFVAR_LISP ("site-directory", &Vsite_directory /*
|
|
4074 *Directory of site-specific Lisp files that come with XEmacs.
|
|
4075 */ );
|
|
4076 Vsite_directory = Qnil;
|
|
4077
|
|
4078 DEFVAR_LISP ("configure-site-directory", &Vconfigure_site_directory /*
|
|
4079 For internal use by the build procedure only.
|
444
|
4080 configure's idea of what `site-directory' will be.
|
428
|
4081 */ );
|
|
4082 #ifdef PATH_SITE
|
|
4083 Vconfigure_site_directory = Ffile_name_as_directory
|
771
|
4084 (build_ext_string (PATH_SITE, Qfile_name));
|
428
|
4085 #else
|
|
4086 Vconfigure_site_directory = Qnil;
|
|
4087 #endif
|
|
4088
|
|
4089 DEFVAR_LISP ("site-module-directory", &Vsite_module_directory /*
|
|
4090 *Directory of site-specific loadable modules that come with XEmacs.
|
|
4091 */ );
|
|
4092 Vsite_module_directory = Qnil;
|
|
4093
|
|
4094 DEFVAR_LISP ("configure-site-module-directory", &Vconfigure_site_module_directory /*
|
|
4095 For internal use by the build procedure only.
|
444
|
4096 configure's idea of what `site-directory' will be.
|
428
|
4097 */ );
|
|
4098 #ifdef PATH_SITE_MODULES
|
|
4099 Vconfigure_site_module_directory = Ffile_name_as_directory
|
771
|
4100 (build_ext_string (PATH_SITE_MODULES, Qfile_name));
|
428
|
4101 #else
|
|
4102 Vconfigure_site_module_directory = Qnil;
|
|
4103 #endif
|
|
4104
|
|
4105 DEFVAR_LISP ("doc-directory", &Vdoc_directory /*
|
|
4106 *Directory containing the DOC file that comes with XEmacs.
|
444
|
4107 This is usually the same as `exec-directory'.
|
428
|
4108 */ );
|
|
4109 Vdoc_directory = Qnil;
|
|
4110
|
|
4111 DEFVAR_LISP ("configure-doc-directory", &Vconfigure_doc_directory /*
|
|
4112 For internal use by the build procedure only.
|
444
|
4113 configure's idea of what `doc-directory' will be.
|
428
|
4114 */ );
|
|
4115 #ifdef PATH_DOC
|
|
4116 Vconfigure_doc_directory = Ffile_name_as_directory
|
771
|
4117 (build_ext_string (PATH_DOC, Qfile_name));
|
428
|
4118 #else
|
|
4119 Vconfigure_doc_directory = Qnil;
|
|
4120 #endif
|
|
4121
|
|
4122 DEFVAR_LISP ("configure-exec-prefix-directory", &Vconfigure_exec_prefix_directory /*
|
|
4123 For internal use by the build procedure only.
|
444
|
4124 configure's idea of what `exec-prefix-directory' will be.
|
428
|
4125 */ );
|
|
4126 #ifdef PATH_EXEC_PREFIX
|
|
4127 Vconfigure_exec_prefix_directory = Ffile_name_as_directory
|
771
|
4128 (build_ext_string (PATH_EXEC_PREFIX, Qfile_name));
|
428
|
4129 #else
|
|
4130 Vconfigure_exec_prefix_directory = Qnil;
|
|
4131 #endif
|
|
4132
|
|
4133 DEFVAR_LISP ("configure-prefix-directory", &Vconfigure_prefix_directory /*
|
|
4134 For internal use by the build procedure only.
|
444
|
4135 configure's idea of what `prefix-directory' will be.
|
428
|
4136 */ );
|
|
4137 #ifdef PATH_PREFIX
|
|
4138 Vconfigure_prefix_directory = Ffile_name_as_directory
|
771
|
4139 (build_ext_string (PATH_PREFIX, Qfile_name));
|
428
|
4140 #else
|
|
4141 Vconfigure_prefix_directory = Qnil;
|
|
4142 #endif
|
|
4143
|
|
4144 DEFVAR_LISP ("configure-info-directory", &Vconfigure_info_directory /*
|
|
4145 For internal use by the build procedure only.
|
|
4146 This is the name of the directory in which the build procedure installed
|
|
4147 Emacs's info files; the default value for Info-default-directory-list
|
|
4148 includes this.
|
|
4149 */ );
|
|
4150 #ifdef PATH_INFO
|
|
4151 Vconfigure_info_directory =
|
771
|
4152 Ffile_name_as_directory (build_ext_string (PATH_INFO, Qfile_name));
|
428
|
4153 #else
|
|
4154 Vconfigure_info_directory = Qnil;
|
|
4155 #endif
|
|
4156
|
|
4157 DEFVAR_LISP ("configure-info-path", &Vconfigure_info_path /*
|
|
4158 The configured initial path for info documentation.
|
|
4159 */ );
|
|
4160 #ifdef PATH_INFOPATH
|
771
|
4161 Vconfigure_info_path = split_external_path (PATH_INFOPATH);
|
428
|
4162 #else
|
|
4163 Vconfigure_info_path = Qnil;
|
|
4164 #endif
|
|
4165 }
|
|
4166
|
|
4167 #if defined(__sgi) && !defined(PDUMP)
|
|
4168 /* This is so tremendously ugly I'd puke. But then, it works.
|
|
4169 * The target is to override the static constructor from the
|
442
|
4170 * libiflPNG.so library which is masquerading as libz, and
|
428
|
4171 * cores on us when re-started from the dumped executable.
|
|
4172 * This will have to go for 21.1 -- OG.
|
|
4173 */
|
446
|
4174 void __sti__iflPNGFile_c___ (void);
|
|
4175 void
|
|
4176 __sti__iflPNGFile_c___ (void)
|
428
|
4177 {
|
|
4178 }
|
|
4179
|
|
4180 #endif
|
771
|
4181
|
|
4182 #undef abort /* Get access to the real version of abort. We put this all
|
|
4183 the way at the end to make sure that all calls to abort()
|
|
4184 anywhere in the above code go through assert_failed(). */
|
|
4185
|
|
4186 void
|
|
4187 really_abort (void)
|
|
4188 {
|
|
4189 abort ();
|
|
4190 }
|