1 ;;; loadup.el --- load up standardly loaded Lisp files for Emacs.
3 ;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
8 ;; This file is part of GNU Emacs.
10 ;; GNU Emacs is free software; you can redistribute it and/or modify
11 ;; it under the terms of the GNU General Public License as published by
12 ;; the Free Software Foundation; either version 2, or (at your option)
15 ;; GNU Emacs is distributed in the hope that it will be useful,
16 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
17 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 ;; GNU General Public License for more details.
20 ;; You should have received a copy of the GNU General Public License
21 ;; along with GNU Emacs; see the file COPYING. If not, write to the
22 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
23 ;; Boston, MA 02111-1307, USA.
27 ;; This is loaded into a bare Emacs to make a dumpable one.
31 ;; add subdirectories to the load-path for files that might
32 ;; get autoloaded when bootstrapping
33 (if (or (equal (nth 3 command-line-args
) "bootstrap")
34 (equal (nth 4 command-line-args
) "bootstrap"))
35 (let ((path (car load-path
)))
36 (setq load-path
(list path
37 (expand-file-name "emacs-lisp" path
)
38 (expand-file-name "international" path
)))))
40 (message "Using load-path %s" load-path
)
42 ;;; We don't want to have any undo records in the dumped Emacs.
43 (buffer-disable-undo "*scratch*")
48 ;; We specify .el in case someone compiled version.el by mistake.
53 (autoload '\
` "emacs-lisp/backquote" nil nil
'macro
)
56 (load "international/mule")
57 (load "international/mule-conf.el") ;Don't get confused if someone compiled this by mistake.
60 (setq load-source-file-function
'load-with-code-conversion
)
64 ;; Any Emacs Lisp source file (*.el) loaded here after can contain
66 (load "international/mule-cmds")
68 (load "international/characters")
70 (message "Lists of integers (garbage collection statistics) are normal output")
71 (message "while building Emacs; they do not indicate a problem.")
72 (message "%s" (garbage-collect))
73 (load "loaddefs.el") ;Don't get confused if someone compiled this by mistake.
74 (message "%s" (garbage-collect))
76 (let ((set-case-syntax-set-multibyte t
))
77 (load "international/latin-1")
78 (load "international/latin-2")
79 (load "international/latin-3")
80 (load "international/latin-4")
81 (load "international/latin-5")
82 (load "international/latin-8")
83 (load "international/latin-9"))
84 ;; Load language-specific files.
85 (load "language/chinese")
86 (load "language/cyrillic")
87 (load "language/indian")
88 (load "language/devanagari") ; This should be loaded after indian.
89 (load "language/english")
90 (load "language/ethiopic")
91 (load "language/european")
92 (load "language/czech")
93 (load "language/slovak")
94 (load "language/romanian")
95 (load "language/greek")
96 (load "language/hebrew")
97 (load "language/japanese")
98 (load "language/korean")
100 (load "language/thai")
101 (load "language/tibetan")
102 (load "language/vietnamese")
103 (load "language/misc-lang")
104 (update-coding-systems-internal)
111 (if (fboundp 'frame-face-alist
)
114 (if (fboundp 'track-mouse
)
117 (and (boundp 'x-toolkit-scroll-bars-p
)
121 (message "%s" (garbage-collect))
123 (load "paths.el") ;Don't get confused if someone compiled paths by mistake.
125 (load "emacs-lisp/lisp")
126 (load "textmodes/page")
128 (load "textmodes/paragraphs")
129 (load "emacs-lisp/lisp-mode")
130 (load "textmodes/text-mode")
131 (load "textmodes/fill")
132 (message "%s" (garbage-collect))
135 (if (eq system-type
'vax-vms
)
140 (if (eq system-type
'vax-vms
)
143 (if (eq system-type
'windows-nt
)
146 (load "disp-table") ; needed to setup ibm-pc char set, see internal.el
149 (if (eq system-type
'ms-dos
)
155 (load "international/ccl") ; for cpNNN coding systems in codepage.el
156 (load "international/codepage") ; internal.el uses cpNNN coding systems
157 (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el
158 (if (fboundp 'atan
) ; preload some constants and
159 (progn ; floating pt. functions if we have float support.
161 (message "%s" (garbage-collect))
165 (message "%s" (garbage-collect))
167 ;If you want additional libraries to be preloaded and their
168 ;doc strings kept in the DOC file rather than in core,
169 ;you may load them with a "site-load.el" file.
170 ;But you must also cause them to be scanned when the DOC file
171 ;is generated. For VMS, you must edit ../vms/makedoc.com.
172 ;For other systems, you must edit ../src/Makefile.in.
173 (if (load "site-load" t
)
176 (if (fboundp 'x-popup-menu
)
177 (precompute-menubar-bindings))
178 ;; Turn on recording of which commands get rebound,
179 ;; for the sake of the next call to precompute-menubar-bindings.
180 (setq define-key-rebound-commands nil
)
182 ;; Determine which last version number to use
183 ;; based on the executables that now exist.
184 (if (and (or (equal (nth 3 command-line-args
) "dump")
185 (equal (nth 4 command-line-args
) "dump"))
186 (not (eq system-type
'ms-dos
)))
187 (let* ((base (concat "emacs-" emacs-version
"."))
188 (files (file-name-all-completions base default-directory
))
189 (versions (mapcar (function (lambda (name)
190 (string-to-int (substring name
(length base
)))))
192 (setq emacs-version
(format "%s.%d"
195 (1+ (apply 'max versions
))
198 ;; Note: all compiled Lisp files loaded above this point
199 ;; must be among the ones parsed by make-docfile
200 ;; to construct DOC. Any that are not processed
201 ;; for DOC will not have doc strings in the dumped Emacs.
203 (message "Finding pointers to doc strings...")
204 (if (or (equal (nth 3 command-line-args
) "dump")
205 (equal (nth 4 command-line-args
) "dump"))
206 (let ((name emacs-version
))
207 (while (string-match "[^-+_.a-zA-Z0-9]+" name
)
208 (setq name
(concat (downcase (substring name
0 (match-beginning 0)))
210 (substring name
(match-end 0)))))
211 (if (memq system-type
'(ms-dos windows-nt
))
212 (setq name
(expand-file-name
213 (if (fboundp 'x-create-frame
) "DOC-X" "DOC") "../etc"))
214 (setq name
(concat (expand-file-name "../etc/DOC-") name
))
215 (if (file-exists-p name
)
217 (copy-file (expand-file-name "../etc/DOC") name t
))
218 (Snarf-documentation (file-name-nondirectory name
)))
220 (Snarf-documentation "DOC")
222 (message "Finding pointers to doc strings...done")
224 ;;;Note: You can cause additional libraries to be preloaded
225 ;;;by writing a site-init.el that loads them.
226 ;;;See also "site-load" above.
228 (setq current-load-list nil
)
230 ;; Write the value of load-history into fns-VERSION.el,
231 ;; then clear out load-history.
232 (if (or (equal (nth 3 command-line-args
) "dump")
233 (equal (nth 4 command-line-args
) "dump"))
234 (let ((buffer-undo-list t
))
235 (princ "(setq load-history\n" (current-buffer))
236 (princ " (nconc load-history\n" (current-buffer))
237 (princ " '(" (current-buffer))
238 (let ((tem load-history
))
240 (prin1 (car tem
) (current-buffer))
241 (terpri (current-buffer))
243 (princ " " (current-buffer)))
244 (setq tem
(cdr tem
))))
245 (princ ")))\n" (current-buffer))
246 (write-region (point-min) (point-max)
249 ((eq system-type
'ms-dos
)
251 ((eq system-type
'windows-nt
)
252 (format "../../../lib-src/fns-%s.el" emacs-version
))
254 (format "../lib-src/fns-%s.el" emacs-version
)))
255 invocation-directory
))
257 (setq load-history nil
))
258 (setq symbol-file-load-history-loaded t
))
259 (set-buffer-modified-p nil
)
261 ;; reset the load-path. See lread.c:init_lread why.
262 (if (or (equal (nth 3 command-line-args
) "bootstrap")
263 (equal (nth 4 command-line-args
) "bootstrap"))
264 (setcdr load-path nil
))
268 ;;; At this point, we're ready to resume undo recording for scratch.
269 (buffer-enable-undo "*scratch*")
271 (if (or (member (nth 3 command-line-args
) '("dump" "bootstrap"))
272 (member (nth 4 command-line-args
) '("dump" "bootstrap")))
273 (if (eq system-type
'vax-vms
)
275 (message "Dumping data as file temacs.dump")
276 (dump-emacs "temacs.dump" "temacs")
278 (let ((name (concat "emacs-" emacs-version
)))
279 (while (string-match "[^-+_.a-zA-Z0-9]+" name
)
280 (setq name
(concat (downcase (substring name
0 (match-beginning 0)))
282 (substring name
(match-end 0)))))
283 (if (eq system-type
'ms-dos
)
284 (message "Dumping under the name emacs")
285 (message "Dumping under names emacs and %s" name
)))
287 (delete-file "emacs")
289 ;; We used to dump under the name xemacs, but that occasionally
290 ;; confused people installing Emacs (they'd install the file
291 ;; under the name `xemacs'), and it's inconsistent with every
292 ;; other GNU program's build process.
293 (dump-emacs "emacs" "temacs")
294 (message "%d pure bytes used" pure-bytes-used
)
295 ;; Recompute NAME now, so that it isn't set when we dump.
296 (if (not (memq system-type
'(ms-dos windows-nt
)))
297 (let ((name (concat "emacs-" emacs-version
)))
298 (while (string-match "[^-+_.a-zA-Z0-9]+" name
)
299 (setq name
(concat (downcase (substring name
0 (match-beginning 0)))
301 (substring name
(match-end 0)))))
302 (add-name-to-file "emacs" name t
)))
305 ;; Avoid error if user loads some more libraries now.
306 (setq purify-flag nil
)
308 ;; For machines with CANNOT_DUMP defined in config.h,
309 ;; this file must be loaded each time Emacs is run.
310 ;; So run the startup code now. First, remove `-l loadup' from args.
312 (if (and (equal (nth 1 command-line-args
) "-l")
313 (equal (nth 2 command-line-args
) "loadup"))
314 (setcdr command-line-args
(nthcdr 3 command-line-args
)))
318 ;;; loadup.el ends here