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