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