0
|
1 ;;; loadup.el --- load up standardly loaded Lisp files for XEmacs.
|
|
2
|
|
3 ;; It is not a good idea to edit this file. Use site-init.el or site-load.el
|
|
4 ;; instead.
|
|
5 ;;
|
2
|
6 ;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
|
0
|
7 ;; Copyright (C) 1996 Richard Mlynarik.
|
|
8 ;; Copyright (C) 1995, 1996 Ben Wing.
|
|
9
|
|
10 ;; Keywords: internal
|
|
11
|
|
12 ;; This file is part of XEmacs.
|
|
13
|
|
14 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
15 ;; under the terms of the GNU General Public License as published by
|
|
16 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
17 ;; any later version.
|
|
18
|
|
19 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
22 ;; General Public License for more details.
|
|
23
|
|
24 ;; You should have received a copy of the GNU General Public License
|
|
25 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
2
|
26 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
|
|
27 ;; 02111-1307, USA.
|
0
|
28
|
70
|
29 ;;; Synched up with: Last synched with FSF 19.30, with wild divergence since.
|
0
|
30
|
|
31 ;;; Commentary:
|
|
32
|
|
33 ;; This is loaded into a bare Emacs to make a dumpable one.
|
|
34
|
|
35 ;;; Code:
|
|
36
|
|
37 (if (fboundp 'error)
|
|
38 (error "loadup.el already loaded!"))
|
|
39
|
|
40 (define-function 'defalias 'define-function)
|
124
|
41 (defvar running-xemacs t
|
|
42 "non-nil when the current emacsen is XEmacs.")
|
0
|
43
|
|
44 (call-with-condition-handler
|
|
45 ;; This is awfully damn early to be getting an error, right?
|
|
46 'really-early-error-handler
|
|
47 #'(lambda ()
|
70
|
48 ;; message not defined yet ...
|
0
|
49 (external-debugging-output (format "\nUsing load-path %s" load-path))
|
|
50
|
|
51 ;; We don't want to have any undo records in the dumped XEmacs.
|
|
52 (buffer-disable-undo (get-buffer "*scratch*"))
|
|
53
|
|
54 ;; lread.c (or src/Makefile.in.in) has prepended "${srcdir}/../lisp/prim"
|
|
55 ;; to load-path, which is how this file has been found. At this point,
|
|
56 ;; enough of emacs has been initialized that we can call directory-files
|
|
57 ;; and get the rest of the dirs (so that we can dump stuff from modes/
|
|
58 ;; and packages/.)
|
|
59 ;;
|
|
60 (let ((temp-path (expand-file-name ".." (car load-path))))
|
|
61 (setq source-directory temp-path)
|
|
62 (setq load-path (nconc (directory-files temp-path t "^[^-.]"
|
|
63 nil 'dirs-only)
|
|
64 (cons temp-path load-path))))
|
|
65
|
|
66 (setq load-warn-when-source-newer t ; set to nil at the end
|
70
|
67 load-warn-when-source-only t)
|
50
|
68
|
2
|
69 ;; garbage collect after loading every file in an attempt to
|
|
70 ;; minimize the size of the dumped image (if we don't do this,
|
|
71 ;; there will be lots of extra space in the data segment filled
|
|
72 ;; with garbage-collected junk)
|
|
73 (defmacro load-gc (file)
|
|
74 (list 'prog1 (list 'load file) '(garbage-collect)))
|
|
75 (load-gc "backquote") ; needed for defsubst etc.
|
|
76 (load-gc "bytecomp-runtime") ; define defsubst
|
|
77 (load-gc "subr") ; load the most basic Lisp functions
|
|
78 (load-gc "replace") ; match-string used in version.el.
|
|
79 (load-gc "version.el") ; Ignore compiled-by-mistake version.elc
|
|
80 (load-gc "cl")
|
120
|
81 (load-gc "widget")
|
|
82 (load-gc "custom") ; Before the world so everything can be customized
|
124
|
83 (load-gc "cus-start") ; for customization of builtin variables
|
2
|
84 (load-gc "cmdloop")
|
|
85 (or (fboundp 'recursive-edit) (load-gc "cmdloop1"))
|
|
86 (load-gc "keymap")
|
|
87 (load-gc "syntax")
|
|
88 (load-gc "device")
|
|
89 (load-gc "console")
|
|
90 (load-gc "obsolete")
|
|
91 (load-gc "specifier")
|
|
92 (load-gc "faces") ; must be loaded before any make-face call
|
70
|
93 ;;(load-gc "facemenu") #### not yet ported
|
2
|
94 (load-gc "glyphs")
|
|
95 (load-gc "objects")
|
|
96 (load-gc "extents")
|
|
97 (load-gc "events")
|
|
98 (load-gc "text-props")
|
|
99 (load-gc "process")
|
|
100 (load-gc "frame") ; move up here cause some stuff needs it here
|
|
101 (load-gc "map-ynp")
|
|
102 (load-gc "simple")
|
|
103 (load-gc "keydefs") ; Before loaddefs so that keymap vars exist.
|
|
104 (load-gc "abbrev")
|
|
105 (load-gc "derived")
|
|
106 (load-gc "minibuf")
|
|
107 (load-gc "list-mode")
|
70
|
108 (load-gc "modeline") ; needs simple.el to be loaded first
|
2
|
109 ;; If SparcWorks support is included some additional packages are
|
|
110 ;; dumped which would normally have autoloads. To avoid
|
|
111 ;; duplicate doc string warnings, SparcWorks uses a separate
|
|
112 ;; autoloads file with the dumped packages removed.
|
70
|
113 ;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!!
|
|
114 ;; So just make loaddefs-eos go away...
|
|
115 ;;(load-gc (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs"))
|
100
|
116 (load-gc "loaddefs") ; <=== autoloads get put here
|
2
|
117 (load-gc "misc")
|
|
118 (load-gc "profile")
|
70
|
119 (load-gc "help")
|
2
|
120 ;; (load-gc "hyper-apropos") Soon...
|
70
|
121 (when (not (featurep 'mule))
|
|
122 (load-gc "files-nomule"))
|
2
|
123 (load-gc "files")
|
|
124 (load-gc "lib-complete")
|
|
125 (load-gc "format")
|
|
126 (load-gc "indent")
|
|
127 (load-gc "isearch-mode")
|
|
128 (load-gc "buffer")
|
70
|
129 (load-gc "buff-menu")
|
2
|
130 (load-gc "undo-stack")
|
|
131 (load-gc "window")
|
|
132 (load-gc "paths.el") ; don't get confused if paths compiled.
|
|
133 (load-gc "startup")
|
|
134 (load-gc "lisp")
|
|
135 (load-gc "page")
|
|
136 (load-gc "register")
|
|
137 (load-gc "iso8859-1") ; This must be before any modes
|
0
|
138 ; (sets standard syntax table.)
|
2
|
139 (load-gc "paragraphs")
|
|
140 (load-gc "lisp-mode")
|
|
141 (load-gc "text-mode")
|
|
142 (load-gc "fill")
|
74
|
143 ;; (load-gc "cc-mode") ; as FSF goes so go we ..
|
|
144 ;; (load-gc "scroll-in-place") ; We're not ready for this :-(
|
2
|
145 ;; we no longer load buff-menu automatically.
|
|
146 ;; it will get autoloaded if needed.
|
|
147
|
|
148 (cond ; Differences based on system-type
|
|
149 ((eq system-type 'vax-vms)
|
|
150 (load-gc "vmsproc")
|
|
151 (load-gc "vms-patch"))
|
|
152 ((eq system-type 'windows-nt)
|
114
|
153 ;; (load-gc "ls-lisp")
|
2
|
154 (load-gc "winnt"))
|
|
155 ((eq system-type 'ms-dos)
|
114
|
156 ;; (load-gc "ls-lisp")
|
2
|
157 (load-gc "dos-fns")
|
|
158 (load-gc "disp-table"))) ; needed to setup ibm-pc char set,
|
|
159 ; see internal.el
|
|
160 (when (featurep 'lisp-float-type)
|
|
161 (load-gc "float-sup"))
|
|
162 (load-gc "itimer") ; for vars auto-save-timeout and auto-gc-threshold
|
100
|
163 (load-gc "itimer-autosave")
|
2
|
164 (if (featurep 'toolbar)
|
70
|
165 (load-gc "toolbar")
|
2
|
166 ;; else still define a few functions.
|
|
167 (defun toolbar-button-p (obj) "No toolbar support." nil)
|
|
168 (defun toolbar-specifier-p (obj) "No toolbar support." nil))
|
|
169 (when (featurep 'scrollbar)
|
|
170 (load-gc "scrollbar"))
|
|
171 (when (featurep 'menubar)
|
|
172 (load-gc "menubar"))
|
|
173 (when (featurep 'dialog)
|
|
174 (load-gc "dialog"))
|
70
|
175 (when (featurep 'mule)
|
|
176 (load-gc "mule-load.el"))
|
2
|
177 (when (featurep 'window-system)
|
|
178 (load-gc "gui")
|
|
179 (load-gc "mode-motion")
|
|
180 (load-gc "mouse"))
|
|
181 (when (featurep 'x)
|
|
182 ;; preload the X code, for faster startup.
|
|
183 (when (featurep 'menubar)
|
70
|
184 (load-gc "x-menubar")
|
|
185 ;; autoload this.
|
|
186 ;;(load-gc "x-font-menu")
|
|
187 )
|
2
|
188 (load-gc "x-faces")
|
|
189 (load-gc "x-iso8859-1")
|
|
190 (load-gc "x-mouse")
|
|
191 (load-gc "x-select")
|
|
192 (when (featurep 'scrollbar)
|
70
|
193 (load-gc "x-scrollbar"))
|
2
|
194 (load-gc "x-misc")
|
|
195 (load-gc "x-init")
|
|
196 (when (featurep 'toolbar)
|
70
|
197 (load-gc "x-toolbar"))
|
2
|
198 )
|
|
199 (when (featurep 'tty)
|
|
200 ;; preload the TTY init code.
|
|
201 (load-gc "tty-init"))
|
|
202 (when (featurep 'tooltalk)
|
|
203 (load-gc "tooltalk/tooltalk-load"))
|
|
204 (load-gc "vc-hooks")
|
|
205 (load-gc "ediff-hook")
|
|
206 (load-gc "fontl-hooks")
|
|
207 (load-gc "auto-show")
|
|
208 (when (featurep 'energize)
|
|
209 (load-gc "energize/energize-load.el"))
|
|
210 (when (featurep 'sparcworks)
|
|
211 (load-gc "sunpro/sunpro-load.el"))
|
110
|
212 (load-gc "custom-load")
|
2
|
213 (fmakunbound 'load-gc)
|
|
214 )) ;; end of call-with-condition-handler
|
0
|
215
|
|
216
|
4
|
217 (setq load-warn-when-source-newer t ; set to t at top of file
|
0
|
218 load-warn-when-source-only nil)
|
|
219
|
|
220 (setq debugger 'debug)
|
|
221
|
70
|
222 (when (member "no-site-file" command-line-args)
|
|
223 (setq site-start-file nil))
|
0
|
224
|
2
|
225 ;; If you want additional libraries to be preloaded and their
|
|
226 ;; doc strings kept in the DOC file rather than in core,
|
|
227 ;; you may load them with a "site-load.el" file.
|
|
228 ;; But you must also cause them to be scanned when the DOC file
|
|
229 ;; is generated. For VMS, you must edit ../../vms/makedoc.com.
|
|
230 ;; For other systems, you must edit ../../src/Makefile.in.in.
|
0
|
231 (if (load "site-load" t)
|
|
232 (garbage-collect))
|
|
233
|
70
|
234 ;;FSFmacs randomness
|
|
235 ;;(if (fboundp 'x-popup-menu)
|
|
236 ;; (precompute-menubar-bindings))
|
0
|
237 ;;; Turn on recording of which commands get rebound,
|
|
238 ;;; for the sake of the next call to precompute-menubar-bindings.
|
|
239 ;(setq define-key-rebound-commands nil)
|
|
240
|
|
241
|
2
|
242 ;; Note: all compiled Lisp files loaded above this point
|
|
243 ;; must be among the ones parsed by make-docfile
|
|
244 ;; to construct DOC. Any that are not processed
|
|
245 ;; for DOC will not have doc strings in the dumped XEmacs.
|
0
|
246
|
2
|
247 ;; Don't bother with these if we're running temacs, i.e. if we're
|
|
248 ;; just debugging don't waste time finding doc strings.
|
0
|
249
|
70
|
250 ;; purify-flag is nil if called from loadup-el.el.
|
|
251 (when purify-flag
|
|
252 (message "Finding pointers to doc strings...")
|
|
253 (Snarf-documentation "DOC")
|
|
254 (message "Finding pointers to doc strings...done")
|
|
255 (Verify-documentation))
|
0
|
256
|
70
|
257 ;; Note: You can cause additional libraries to be preloaded
|
|
258 ;; by writing a site-init.el that loads them.
|
|
259 ;; See also "site-load" above.
|
0
|
260 (if (stringp site-start-file)
|
|
261 (load "site-init" t))
|
|
262 (setq current-load-list nil)
|
|
263 (garbage-collect)
|
|
264
|
|
265 ;;; At this point, we're ready to resume undo recording for scratch.
|
|
266 (buffer-enable-undo "*scratch*")
|
|
267
|
70
|
268 ;; Dump into the name `xemacs' (only)
|
|
269 (when (member "dump" command-line-args)
|
|
270 (message "Dumping under the name xemacs")
|
|
271 (condition-case () (delete-file "xemacs") (file-error nil))
|
|
272 (when (fboundp 'really-free)
|
|
273 (really-free))
|
|
274 (dump-emacs "xemacs" "temacs")
|
|
275 (kill-emacs))
|
0
|
276
|
70
|
277 (when (member "run-temacs" command-line-args)
|
|
278 (message "\nBootstrapping from temacs...")
|
|
279 (setq purify-flag nil)
|
|
280 ;; Remove all args up to and including "run-temacs"
|
|
281 (apply #'run-emacs-from-temacs (cdr (member "run-temacs" command-line-args)))
|
|
282 ;; run-emacs-from-temacs doesn't actually return anyway.
|
|
283 (kill-emacs))
|
0
|
284
|
2
|
285 ;; Avoid error if user loads some more libraries now.
|
0
|
286 (setq purify-flag nil)
|
|
287
|
2
|
288 ;; XEmacs change
|
|
289 ;; If you are using 'recompile', then you should have used -l loadup-el.el
|
|
290 ;; so that the .el files always get loaded (the .elc files may be out-of-
|
|
291 ;; date or bad).
|
70
|
292 (when (member "recompile" command-line-args)
|
|
293 (let ((command-line-args-left (cdr (member "recompile" command-line-args))))
|
|
294 (batch-byte-recompile-directory)
|
|
295 (kill-emacs)))
|
0
|
296
|
|
297 ;; For machines with CANNOT_DUMP defined in config.h,
|
|
298 ;; this file must be loaded each time Emacs is run.
|
|
299 ;; So run the startup code now.
|
|
300
|
70
|
301 (when (not (fboundp 'dump-emacs))
|
|
302 ;; Avoid loading loadup.el a second time!
|
|
303 (setq command-line-args (cdr (cdr command-line-args)))
|
|
304 (eval top-level))
|
0
|
305
|
|
306 ;;; loadup.el ends here
|