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