comparison lisp/prim/loadup.el @ 2:ac2d302a0011 r19-15b2

Import from CVS: tag r19-15b2
author cvs
date Mon, 13 Aug 2007 08:46:35 +0200
parents 376386a54a3c
children b82b59fe008d
comparison
equal deleted inserted replaced
1:c0c6a60d29db 2:ac2d302a0011
1 ;;; loadup.el --- load up standardly loaded Lisp files for XEmacs. 1 ;;; loadup.el --- load up standardly loaded Lisp files for XEmacs.
2 2
3 ;; It is not a good idea to edit this file. Use site-init.el or site-load.el 3 ;; It is not a good idea to edit this file. Use site-init.el or site-load.el
4 ;; instead. 4 ;; instead.
5 ;; 5 ;;
6 ;; Copyright (C) 1985, 1986, 1992, 1993, 1994 Free Software Foundation, Inc. 6 ;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
7 ;; Copyright (C) 1996 Richard Mlynarik. 7 ;; Copyright (C) 1996 Richard Mlynarik.
8 ;; Copyright (C) 1995, 1996 Ben Wing. 8 ;; Copyright (C) 1995, 1996 Ben Wing.
9 9
10 ;; Maintainer: FSF 10 ;; Maintainer: FSF
11 ;; Keywords: internal 11 ;; Keywords: internal
22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 22 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23 ;; General Public License for more details. 23 ;; General Public License for more details.
24 24
25 ;; You should have received a copy of the GNU General Public License 25 ;; You should have received a copy of the GNU General Public License
26 ;; along with XEmacs; see the file COPYING. If not, write to the Free 26 ;; along with XEmacs; see the file COPYING. If not, write to the Free
27 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. 27 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
28 28 ;; 02111-1307, USA.
29 ;;; Synched up with: FSF 19.30. 29
30 ;;; Synched up with: Last synched with FSF 19.30, with divergence since.
30 31
31 ;;; Commentary: 32 ;;; Commentary:
32 33
33 ;; This is loaded into a bare Emacs to make a dumpable one. 34 ;; This is loaded into a bare Emacs to make a dumpable one.
34 35
62 (cons temp-path load-path)))) 63 (cons temp-path load-path))))
63 64
64 (setq load-warn-when-source-newer t ; set to nil at the end 65 (setq load-warn-when-source-newer t ; set to nil at the end
65 load-warn-when-source-only t) 66 load-warn-when-source-only t)
66 67
67 (let ((l #'(lambda (x) 68 ;; garbage collect after loading every file in an attempt to
68 (load x) 69 ;; minimize the size of the dumped image (if we don't do this,
69 ;; garbage collect after loading every file in an attempt to 70 ;; there will be lots of extra space in the data segment filled
70 ;; minimize the size of the dumped image (if we don't do 71 ;; with garbage-collected junk)
71 ;; this, there will be lots of extra space in the data 72 (defmacro load-gc (file)
72 ;; segment filled with garbage-collected junk) 73 (list 'prog1 (list 'load file) '(garbage-collect)))
73 (garbage-collect)))) 74 (load-gc "backquote") ; needed for defsubst etc.
74 (funcall l "backquote") ; needed for defsubst etc. 75 (load-gc "bytecomp-runtime") ; define defsubst
75 (funcall l "bytecomp-runtime") ; define defsubst 76 (load-gc "subr") ; load the most basic Lisp functions
76 (funcall l "subr") ;; now load the most basic Lisp functions 77 (load-gc "replace") ; match-string used in version.el.
77 (funcall l "replace") ;; match-string used in version.el. 78 (load-gc "version.el") ; Ignore compiled-by-mistake version.elc
78 (funcall l "version.el") ;Ignore compiled-by-mistake version.elc 79 (load-gc "cl")
79 (funcall l "cl") 80 (load-gc "cmdloop")
80 (funcall l "cmdloop") 81 (or (fboundp 'recursive-edit) (load-gc "cmdloop1"))
81 (or (fboundp 'recursive-edit) (funcall l "cmdloop1")) 82 (load-gc "keymap")
82 (funcall l "keymap") 83 (load-gc "syntax")
83 (funcall l "syntax") 84 (load-gc "device")
84 (funcall l "device") 85 (load-gc "console")
85 (funcall l "console") 86 (load-gc "obsolete")
86 (funcall l "obsolete") 87 (load-gc "specifier")
87 (funcall l "specifier") 88 (load-gc "faces") ; must be loaded before any make-face call
88 (funcall l "faces") ; must be loaded before any make-face call 89 ;(load-gc "facemenu") #### not yet ported
89 ;(funcall l "facemenu") #### not yet ported 90 (load-gc "glyphs")
90 (funcall l "glyphs") 91 (load-gc "objects")
91 (funcall l "objects") 92 (load-gc "extents")
92 (funcall l "extents") 93 (load-gc "events")
93 (funcall l "events") 94 (load-gc "text-props")
94 (funcall l "text-props") 95 (load-gc "process")
95 (funcall l "process") 96 (load-gc "frame") ; move up here cause some stuff needs it here
96 (funcall l "frame") ; move up here cause some stuff needs it here 97 (load-gc "map-ynp")
97 (funcall l "map-ynp") 98 (load-gc "simple")
98 (funcall l "simple") 99 (load-gc "keydefs") ; Before loaddefs so that keymap vars exist.
99 (funcall l "keydefs") ; Before loaddefs so that keymap vars exist. 100 (load-gc "abbrev")
100 (funcall l "abbrev") 101 (load-gc "derived")
101 (funcall l "derived") 102 (load-gc "minibuf")
102 (funcall l "minibuf") 103 (load-gc "list-mode")
103 (funcall l "list-mode") 104 (load-gc "modeline") ; after simple.el so it can reference functions
104 (funcall l "modeline") ;after simple.el so it can reference functions 105 ; defined there.
105 ;defined there. 106 ;; If SparcWorks support is included some additional packages are
106 ;; If SparcWorks support is included some additional packages are 107 ;; dumped which would normally have autoloads. To avoid
107 ;; dumped which would normally have autoloads. To avoid 108 ;; duplicate doc string warnings, SparcWorks uses a separate
108 ;; duplicate doc string warnings, SparcWorks uses a separate 109 ;; autoloads file with the dumped packages removed.
109 ;; autoloads file with the dumped packages removed. 110 ;;; After fixing, eos/loaddefs-eos and loaddefs appear identical?!!
110 (if (featurep 'sparcworks) 111 ;;; So just make loaddefs-eos go away...
111 (funcall l "eos/loaddefs-eos") 112 ;;;(load-gc (if (featurep 'sparcworks) "eos/loaddefs-eos" "loaddefs"))
112 (funcall l "loaddefs")) 113 (load-gc "loaddefs")
113 (funcall l "misc") 114 (load-gc "misc")
114 (funcall l "profile") 115 (load-gc "profile")
115 (funcall l "help") 116 (load-gc "help")
116 ;; (funcall l "hyper-apropos") Soon... 117 ;; (load-gc "hyper-apropos") Soon...
117 (funcall l "files") 118 (load-gc "files")
118 (funcall l "lib-complete") 119 (load-gc "lib-complete")
119 (funcall l "format") 120 (load-gc "format")
120 (funcall l "indent") 121 (load-gc "indent")
121 (funcall l "isearch-mode") 122 (load-gc "isearch-mode")
122 (funcall l "buffer") 123 (load-gc "buffer")
123 (funcall l "buff-menu") 124 (load-gc "buff-menu")
124 (funcall l "undo-stack") 125 (load-gc "undo-stack")
125 (funcall l "window") 126 (load-gc "window")
126 (funcall l "paths.el") ; don't get confused if paths compiled. 127 (load-gc "paths.el") ; don't get confused if paths compiled.
127 (funcall l "startup") 128 (load-gc "startup")
128 (funcall l "lisp") 129 (load-gc "lisp")
129 (funcall l "page") 130 (load-gc "page")
130 (funcall l "register") 131 (load-gc "register")
131 (funcall l "iso8859-1") ; This must be before any modes 132 (load-gc "iso8859-1") ; This must be before any modes
132 ; (sets standard syntax table.) 133 ; (sets standard syntax table.)
133 (funcall l "paragraphs") 134 (load-gc "paragraphs")
134 (funcall l "lisp-mode") 135 (load-gc "lisp-mode")
135 (funcall l "text-mode") 136 (load-gc "text-mode")
136 (funcall l "fill") 137 (load-gc "fill")
137 (funcall l "cc-mode") 138 (load-gc "cc-mode")
138 (if (eq system-type 'vax-vms) 139 ;; we no longer load buff-menu automatically.
139 (funcall l "vmsproc")) 140 ;; it will get autoloaded if needed.
140 (if (eq system-type 'vax-vms) 141
141 (funcall l "vms-patch")) 142 (cond ; Differences based on system-type
142 (if (eq system-type 'windows-nt) 143 ((eq system-type 'vax-vms)
143 (progn 144 (load-gc "vmsproc")
144 (funcall l "ls-lisp") 145 (load-gc "vms-patch"))
145 (funcall l "winnt"))) 146 ((eq system-type 'windows-nt)
146 (if (eq system-type 'ms-dos) 147 (load-gc "ls-lisp")
147 (progn 148 (load-gc "winnt"))
148 (funcall l "ls-lisp") 149 ((eq system-type 'ms-dos)
149 (funcall l "dos-fns") 150 (load-gc "ls-lisp")
150 (funcall l "disp-table") ; needed to setup ibm-pc char set, 151 (load-gc "dos-fns")
151 ; see internal.el 152 (load-gc "disp-table"))) ; needed to setup ibm-pc char set,
152 )) 153 ; see internal.el
153 (if (featurep 'lisp-float-type) 154 (when (featurep 'lisp-float-type)
154 (funcall l "float-sup")) 155 (load-gc "float-sup"))
155 (funcall l "itimer") ; for vars auto-save-timeout and auto-gc-threshold 156 (load-gc "itimer") ; for vars auto-save-timeout and auto-gc-threshold
156 (if (featurep 'toolbar) 157 (if (featurep 'toolbar)
157 (funcall l "toolbar") 158 (load-gc "toolbar")
158 (progn 159 ;; else still define a few functions.
159 ;; but still define a few functions. 160 (defun toolbar-button-p (obj) "No toolbar support." nil)
160 (defun toolbar-button-p (obj) "No toolbar support." nil) 161 (defun toolbar-specifier-p (obj) "No toolbar support." nil))
161 (defun toolbar-specifier-p (obj) "No toolbar support." nil))) 162 (when (featurep 'scrollbar)
162 (if (featurep 'scrollbar) 163 (load-gc "scrollbar"))
163 (funcall l "scrollbar")) 164 (when (featurep 'menubar)
164 (if (featurep 'menubar) 165 (load-gc "menubar"))
165 (funcall l "menubar")) 166 (when (featurep 'dialog)
166 (if (featurep 'dialog) 167 (load-gc "dialog"))
167 (funcall l "dialog")) 168 (when (featurep 'window-system)
168 (if (featurep 'window-system) 169 (load-gc "gui")
169 (progn 170 (load-gc "mode-motion")
170 (funcall l "gui") 171 (load-gc "mouse"))
171 (funcall l "mode-motion") 172 (when (featurep 'x)
172 (funcall l "mouse"))) 173 ;; preload the X code, for faster startup.
173 (if (featurep 'x) 174 (when (featurep 'menubar)
174 ;; preload the X code, for faster startup. 175 (load-gc "x-menubar")
175 (progn 176 ;; autoload this.
176 (if (featurep 'menubar) 177 ;;(load-gc "x-font-menu")
177 (progn 178 )
178 (funcall l "x-menubar") 179 (load-gc "x-faces")
179 ;; autoload this. 180 (load-gc "x-iso8859-1")
180 ;;(funcall l "x-font-menu") 181 (load-gc "x-mouse")
181 )) 182 (load-gc "x-select")
182 (funcall l "x-faces") 183 (when (featurep 'scrollbar)
183 (funcall l "x-iso8859-1") 184 (load-gc "x-scrollbar"))
184 (funcall l "x-mouse") 185 (load-gc "x-misc")
185 (funcall l "x-select") 186 (load-gc "x-init")
186 (if (featurep 'scrollbar) 187 (when (featurep 'toolbar)
187 (funcall l "x-scrollbar")) 188 (load-gc "x-toolbar"))
188 (funcall l "x-misc") 189 )
189 (funcall l "x-init") 190 (when (featurep 'tty)
190 (if (featurep 'toolbar) 191 ;; preload the TTY init code.
191 (funcall l "x-toolbar")) 192 (load-gc "tty-init"))
192 )) 193 (when (featurep 'tooltalk)
193 (if (featurep 'tty) 194 (load-gc "tooltalk/tooltalk-load"))
194 ;; preload the TTY init code. 195 (load-gc "vc-hooks")
195 (funcall l "tty-init")) 196 (load-gc "ediff-hook")
196 (if (featurep 'tooltalk) 197 (load-gc "fontl-hooks")
197 (funcall l "tooltalk/tooltalk-load")) 198 (load-gc "auto-show")
198 (funcall l "vc-hooks") 199 (when (featurep 'energize)
199 (funcall l "ediff-hook") 200 (load-gc "energize/energize-load.el"))
200 (funcall l "fontl-hooks") 201 (when (featurep 'sparcworks)
201 (funcall l "auto-show") 202 (load-gc "sunpro/sunpro-load.el"))
202 (if (featurep 'energize) 203 (fmakunbound 'load-gc)
203 (funcall l "energize/energize-load.el")) 204 )) ;; end of call-with-condition-handler
204 (if (featurep 'sparcworks)
205 (funcall l "sunpro/sunpro-load.el"))
206 ))) ;; end of call-with-condition-handler
207 205
208 206
209 (setq load-warn-when-source-newer nil ; set to t at top of file 207 (setq load-warn-when-source-newer nil ; set to t at top of file
210 load-warn-when-source-only nil) 208 load-warn-when-source-only nil)
211 209
213 211
214 (if (or (equal (nth 4 command-line-args) "no-site-file") 212 (if (or (equal (nth 4 command-line-args) "no-site-file")
215 (equal (nth 5 command-line-args) "no-site-file")) 213 (equal (nth 5 command-line-args) "no-site-file"))
216 (setq site-start-file nil)) 214 (setq site-start-file nil))
217 215
218 ;;; If you want additional libraries to be preloaded and their 216 ;; If you want additional libraries to be preloaded and their
219 ;;; doc strings kept in the DOC file rather than in core, 217 ;; doc strings kept in the DOC file rather than in core,
220 ;;; you may load them with a "site-load.el" file. 218 ;; you may load them with a "site-load.el" file.
221 ;;; But you must also cause them to be scanned when the DOC file 219 ;; But you must also cause them to be scanned when the DOC file
222 ;;; is generated. For VMS, you must edit ../../vms/makedoc.com. 220 ;; is generated. For VMS, you must edit ../../vms/makedoc.com.
223 ;;; For other systems, you must edit ../../src/Makefile.in.in. 221 ;; For other systems, you must edit ../../src/Makefile.in.in.
224 (if (load "site-load" t) 222 (if (load "site-load" t)
225 (garbage-collect)) 223 (garbage-collect))
226 224
227 ;FSFmacs randomness 225 ;FSFmacs randomness
228 ;(if (fboundp 'x-popup-menu) 226 ;(if (fboundp 'x-popup-menu)
246 ; emacs-version 244 ; emacs-version
247 ; (if versions 245 ; (if versions
248 ; (1+ (apply 'max versions)) 246 ; (1+ (apply 'max versions))
249 ; 1))))) 247 ; 1)))))
250 248
251 ;;; Note: all compiled Lisp files loaded above this point 249 ;; Note: all compiled Lisp files loaded above this point
252 ;;; must be among the ones parsed by make-docfile 250 ;; must be among the ones parsed by make-docfile
253 ;;; to construct DOC. Any that are not processed 251 ;; to construct DOC. Any that are not processed
254 ;;; for DOC will not have doc strings in the dumped XEmacs. 252 ;; for DOC will not have doc strings in the dumped XEmacs.
255 253
256 ;;; Don't bother with these if we're running temacs, i.e. if we're 254 ;; Don't bother with these if we're running temacs, i.e. if we're
257 ;;; just debugging don't waste time finding doc strings. 255 ;; just debugging don't waste time finding doc strings.
258 256
259 (if (or (equal (nth 3 command-line-args) "dump") 257 (if (or (equal (nth 3 command-line-args) "dump")
260 (equal (nth 4 command-line-args) "dump")) 258 (equal (nth 4 command-line-args) "dump"))
261 (progn 259 (progn
262 (message "Finding pointers to doc strings...") 260 (message "Finding pointers to doc strings...")
283 (Snarf-documentation "DOC")) 281 (Snarf-documentation "DOC"))
284 (message "Finding pointers to doc strings...done") 282 (message "Finding pointers to doc strings...done")
285 (Verify-documentation) 283 (Verify-documentation)
286 )) 284 ))
287 285
288 ;;; Note: You can cause additional libraries to be preloaded 286 ; Note: You can cause additional libraries to be preloaded
289 ;;; by writing a site-init.el that loads them. 287 ; by writing a site-init.el that loads them.
290 ;;; See also "site-load" above. 288 ; See also "site-load" above.
291 (if (stringp site-start-file) 289 (if (stringp site-start-file)
292 (load "site-init" t)) 290 (load "site-init" t))
293 (setq current-load-list nil) 291 (setq current-load-list nil)
294 (garbage-collect) 292 (garbage-collect)
295 293
314 (substring name (match-end 0))))) 312 (substring name (match-end 0)))))
315 (if (string-match "-+\\'" name) 313 (if (string-match "-+\\'" name)
316 (setq name (substring name 0 (match-beginning 0)))) 314 (setq name (substring name 0 (match-beginning 0))))
317 (if (eq system-type 'ms-dos) 315 (if (eq system-type 'ms-dos)
318 (message "Dumping under the name xemacs") 316 (message "Dumping under the name xemacs")
319 (message "Dumping under names xemacs and %s" name))) 317 (message "Dumping under names xemacs and %s" name))
320 (condition-case () 318 (condition-case () (delete-file name ) (file-error nil))
321 (delete-file "xemacs") 319 (condition-case () (delete-file "xemacs") (file-error nil))
322 (file-error nil)) 320 )
323 (if (fboundp 'really-free) 321 (if (fboundp 'really-free)
324 (really-free)) 322 (really-free))
325 ;; Note that FSF used to dump under `xemacs'! 323 ;; Note that FSF used to dump under `xemacs'!
326 (dump-emacs "xemacs" "temacs") 324 (dump-emacs "xemacs" "temacs")
327 ;This is done automatically. 325 ;This is done automatically.
358 4 5) 356 4 5)
359 command-line-args)) 357 command-line-args))
360 ;; run-emacs-from-temacs doesn't actually return anyway. 358 ;; run-emacs-from-temacs doesn't actually return anyway.
361 (kill-emacs))) 359 (kill-emacs)))
362 360
363 ;;; Avoid error if user loads some more libraries now. 361 ;; Avoid error if user loads some more libraries now.
364 (setq purify-flag nil) 362 (setq purify-flag nil)
365 363
366 ;;; If you are using 'recompile', then you should have used -l loadup-el.el 364 ;; XEmacs change
367 ;;; so that the .el files always get loaded (the .elc files may be out-of- 365 ;; If you are using 'recompile', then you should have used -l loadup-el.el
368 ;;; date or bad). 366 ;; so that the .el files always get loaded (the .elc files may be out-of-
367 ;; date or bad).
369 (if (or (equal (nth 3 command-line-args) "recompile") 368 (if (or (equal (nth 3 command-line-args) "recompile")
370 (equal (nth 4 command-line-args) "recompile")) 369 (equal (nth 4 command-line-args) "recompile"))
371 (progn 370 (progn
372 (let ((command-line-args-left 371 (let ((command-line-args-left
373 (nthcdr (if (equal (nth 3 command-line-args) "recompile") 372 (nthcdr (if (equal (nth 3 command-line-args) "recompile")
375 command-line-args))) 374 command-line-args)))
376 (batch-byte-recompile-directory) 375 (batch-byte-recompile-directory)
377 (kill-emacs)))) 376 (kill-emacs))))
378 377
379 378
380 ;;; For machines with CANNOT_DUMP defined in config.h,
381 ;;; this file must be loaded each time XEmacs is run.
382 ;;; So run the startup code now.
383
384 ;; For machines with CANNOT_DUMP defined in config.h, 379 ;; For machines with CANNOT_DUMP defined in config.h,
385 ;; this file must be loaded each time Emacs is run. 380 ;; this file must be loaded each time Emacs is run.
386 ;; So run the startup code now. 381 ;; So run the startup code now.
387 382
388 (or (fboundp 'dump-emacs) 383 (or (fboundp 'dump-emacs)