annotate src/emacs.c @ 410:de805c49cfc1 r21-2-35

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