(set-fringe-indicators-1, fringe-indicators): Delete.
[bpt/emacs.git] / lisp / loadup.el
CommitLineData
55535639 1;;; loadup.el --- load up standardly loaded Lisp files for Emacs
6594deb0 2
5db04750 3;; Copyright (C) 1985, 1986, 1992, 1994, 2001 Free Software Foundation, Inc.
eea8d4ef 4
e5167999 5;; Maintainer: FSF
fd7fa35a 6;; Keywords: internal
e5167999 7
0d20f9a0
JB
8;; This file is part of GNU Emacs.
9
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
e5167999 12;; the Free Software Foundation; either version 2, or (at your option)
0d20f9a0
JB
13;; any later version.
14
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.
19
20;; You should have received a copy of the GNU General Public License
b578f267 21;; along with GNU Emacs; see the file COPYING. If not, write to the
086add15
LK
22;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23;; Boston, MA 02110-1301, USA.
0d20f9a0 24
eea8d4ef
ER
25;;; Commentary:
26
27;; This is loaded into a bare Emacs to make a dumpable one.
28
e5167999
ER
29;;; Code:
30
ce87039d
SM
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")
49fc4500
KR
34 (equal (nth 4 command-line-args) "bootstrap")
35 ;; in case CANNOT_DUMP
36 (equal (nth 0 command-line-args) "../src/bootstrap-emacs"))
ceec5b6d 37 (let ((dir (car load-path)))
397869a4
SM
38 ;; We'll probably overflow the pure space.
39 (setq purify-flag nil)
ceec5b6d
RS
40 (setq load-path (list dir
41 (expand-file-name "emacs-lisp" dir)
42 (expand-file-name "language" dir)
43 (expand-file-name "international" dir)
44 (expand-file-name "textmodes" dir)))))
ce87039d 45
8c74709f 46(message "Using load-path %s" load-path)
8c74709f 47
86db31d5 48;; We don't want to have any undo records in the dumped Emacs.
f6e43712
RS
49(set-buffer "*scratch*")
50(setq buffer-undo-list t)
0d20f9a0 51
693e59d6 52(load "emacs-lisp/byte-run")
86db31d5 53(load "emacs-lisp/backquote")
0d20f9a0 54(load "subr")
15897347
RS
55
56;; We specify .el in case someone compiled version.el by mistake.
57(load "version.el")
58
d038ca1d 59(load "widget")
d038ca1d 60(load "custom")
693e59d6 61(load "emacs-lisp/map-ynp")
b27f23c1 62(load "env")
4d100a01 63(load "cus-start")
5dcd1261 64(load "international/mule")
5dcd1261 65(load "international/mule-conf.el") ;Don't get confused if someone compiled this by mistake.
8f89dc56 66(load "format")
9b73022f
RS
67(load "bindings")
68(setq load-source-file-function 'load-with-code-conversion)
0d20f9a0 69(load "files")
838d57f6 70
3fad47d8 71(load "cus-face")
d6af189a
MB
72(load "faces") ; after here, `defface' may be used.
73
6f76277f
RS
74(message "Lists of integers (garbage collection statistics) are normal output")
75(message "while building Emacs; they do not indicate a problem.")
838d57f6
RS
76(message "%s" (garbage-collect))
77(load "loaddefs.el") ;Don't get confused if someone compiled this by mistake.
78(message "%s" (garbage-collect))
3bce0243 79(load "simple")
838d57f6 80
301d6830 81(load "help")
d6af189a 82
301d6830
GM
83;; Any Emacs Lisp source file (*.el) loaded here after can contain
84;; multilingual text.
85(load "international/mule-cmds")
86(load "case-table")
c546dfcb 87(load "international/utf-8")
0405f493 88(load "international/utf-16")
b0c654c0 89(load "international/characters")
301d6830 90
939f6e3f 91(let ((set-case-syntax-set-multibyte t))
5dcd1261
RS
92 (load "international/latin-1")
93 (load "international/latin-2")
94 (load "international/latin-3")
95 (load "international/latin-4")
902e7be8
DL
96 (load "international/latin-5")
97 (load "international/latin-8")
98 (load "international/latin-9"))
8f89dc56 99;; Load language-specific files.
5e14f0f5 100(load "language/chinese")
5e14f0f5 101(load "language/cyrillic")
5e14f0f5 102(load "language/indian")
f5ef6d1f
KH
103(load "language/devanagari") ; This should be loaded after indian.
104(load "language/malayalam") ; This should be loaded after indian.
105(load "language/tamil") ; This should be loaded after indian.
f04f0eba 106(load "language/kannada") ; This should be loaded after indian.
4366b45e 107(load "language/english")
5e14f0f5 108(load "language/ethiopic")
5e14f0f5 109(load "language/european")
c90c0be0
RS
110(load "language/czech")
111(load "language/slovak")
23e7714e 112(load "language/romanian")
5e14f0f5 113(load "language/greek")
5e14f0f5 114(load "language/hebrew")
5e14f0f5 115(load "language/japanese")
5e14f0f5 116(load "language/korean")
f35c859c 117(load "language/lao")
5e14f0f5 118(load "language/thai")
4366b45e 119(load "language/tibetan")
5e14f0f5 120(load "language/vietnamese")
5e14f0f5 121(load "language/misc-lang")
69c34764
DL
122(load "language/utf-8-lang")
123(load "language/georgian")
86db31d5
SM
124
125(load "international/ucs-tables")
86db31d5 126
4298d95e 127(update-coding-systems-internal)
838d57f6 128
0d20f9a0
JB
129(load "indent")
130(load "window")
fd727f4a 131(load "frame")
f795f633 132(load "term/tty-colors")
63a29a5d 133(load "font-core")
d6af189a 134
7a701b9f
KH
135(if (fboundp 'frame-face-alist)
136 (progn
7a701b9f
KH
137 (load "facemenu")))
138(if (fboundp 'track-mouse)
139 (progn
7a701b9f 140 (load "mouse")
9315353b 141 (and (boundp 'x-toolkit-scroll-bars)
449ab688 142 (load "scroll-bar"))
36974751 143 (load "select")))
693e59d6 144(load "emacs-lisp/timer")
01c86c56 145(load "isearch")
838d57f6
RS
146
147(message "%s" (garbage-collect))
afcd9910 148(load "menu-bar")
0d20f9a0 149(load "paths.el") ;Don't get confused if someone compiled paths by mistake.
0d20f9a0 150(load "startup")
5dcd1261 151(load "emacs-lisp/lisp")
5dcd1261 152(load "textmodes/page")
0d20f9a0 153(load "register")
5dcd1261 154(load "textmodes/paragraphs")
5dcd1261 155(load "emacs-lisp/lisp-mode")
5dcd1261 156(load "textmodes/text-mode")
5dcd1261 157(load "textmodes/fill")
838d57f6
RS
158(message "%s" (garbage-collect))
159
0d20f9a0
JB
160(load "replace")
161(if (eq system-type 'vax-vms)
162 (progn
0d20f9a0 163 (load "vmsproc")))
0d20f9a0 164(load "abbrev")
0d20f9a0
JB
165(load "buff-menu")
166(if (eq system-type 'vax-vms)
167 (progn
0d20f9a0 168 (load "vms-patch")))
b7521474
RS
169(if (eq system-type 'windows-nt)
170 (progn
b7521474 171 (load "ls-lisp")
234ae99a 172 (load "disp-table") ; needed to setup ibm-pc char set, see internal.el
489f9371 173 (load "dos-w32")
9c6a562b 174 (load "w32-vars")
63abf612 175 (load "w32-fns")))
ed10e0ab
RS
176(if (eq system-type 'ms-dos)
177 (progn
178 (load "ls-lisp")
489f9371 179 (load "dos-w32")
ed10e0ab 180 (load "dos-fns")
7298263a 181 (load "dos-vars")
6f676109 182 (load "international/ccl") ; codepage.el uses CCL en/decoder
aea543b4 183 (load "international/codepage") ; internal.el uses cpNNN coding systems
63abf612 184 (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el
591b63b4
AC
185(if (eq system-type 'macos)
186 (progn
187 (load "ls-lisp")))
e04d21aa 188(if (fboundp 'atan) ; preload some constants and
63abf612 189 (progn ; floating pt. functions if we have float support.
693e59d6 190 (load "emacs-lisp/float-sup")))
838d57f6 191(message "%s" (garbage-collect))
e4636528 192
637a8ae9 193(load "vc-hooks")
41b26c15 194(load "jka-cmpr-hook")
a63926db 195(load "ediff-hook")
8a902fd2 196(if (fboundp 'x-show-tip) (load "tooltip"))
838d57f6 197(message "%s" (garbage-collect))
0d20f9a0
JB
198
199;If you want additional libraries to be preloaded and their
200;doc strings kept in the DOC file rather than in core,
201;you may load them with a "site-load.el" file.
202;But you must also cause them to be scanned when the DOC file
87855006 203;is generated. For VMS, you must edit ../vms/makedoc.com.
fd322fae 204;For other systems, you must edit ../src/Makefile.in.
0d20f9a0
JB
205(if (load "site-load" t)
206 (garbage-collect))
207
f5263a5c
RS
208(if (fboundp 'x-popup-menu)
209 (precompute-menubar-bindings))
210;; Turn on recording of which commands get rebound,
211;; for the sake of the next call to precompute-menubar-bindings.
212(setq define-key-rebound-commands nil)
213
de78a7ba
RS
214;; Determine which last version number to use
215;; based on the executables that now exist.
24cffc68
RS
216(if (and (or (equal (nth 3 command-line-args) "dump")
217 (equal (nth 4 command-line-args) "dump"))
218 (not (eq system-type 'ms-dos)))
0c39a403 219 (let* ((base (concat "emacs-" emacs-version "."))
de78a7ba
RS
220 (files (file-name-all-completions base default-directory))
221 (versions (mapcar (function (lambda (name)
9b04b1b7 222 (string-to-int (substring name (length base)))))
de78a7ba 223 files)))
86db31d5
SM
224 ;; `emacs-version' is a constant, so we shouldn't change it with `setq'.
225 (defconst emacs-version
226 (format "%s.%d"
227 emacs-version (if versions (1+ (apply 'max versions)) 1)))))
de78a7ba 228
0d20f9a0
JB
229;; Note: all compiled Lisp files loaded above this point
230;; must be among the ones parsed by make-docfile
231;; to construct DOC. Any that are not processed
232;; for DOC will not have doc strings in the dumped Emacs.
233
234(message "Finding pointers to doc strings...")
24cffc68
RS
235(if (or (equal (nth 3 command-line-args) "dump")
236 (equal (nth 4 command-line-args) "dump"))
0d20f9a0
JB
237 (let ((name emacs-version))
238 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
239 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
240 "-"
241 (substring name (match-end 0)))))
b7521474 242 (if (memq system-type '(ms-dos windows-nt))
87485d6f 243 (setq name (expand-file-name
753a134f 244 (if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc"))
ed10e0ab
RS
245 (setq name (concat (expand-file-name "../etc/DOC-") name))
246 (if (file-exists-p name)
247 (delete-file name))
248 (copy-file (expand-file-name "../etc/DOC") name t))
450a90e2 249 (Snarf-documentation (file-name-nondirectory name)))
ce87039d
SM
250 (condition-case nil
251 (Snarf-documentation "DOC")
252 (error nil)))
0d20f9a0
JB
253(message "Finding pointers to doc strings...done")
254
0f4b266c
KH
255;;;Note: You can cause additional libraries to be preloaded
256;;;by writing a site-init.el that loads them.
257;;;See also "site-load" above.
0d20f9a0 258(load "site-init" t)
95227eb2 259(setq current-load-list nil)
c2509060 260
b7b75652
AS
261;; Write the value of load-history into fns-VERSION.el,
262;; then clear out load-history.
4744f265
SM
263;; (if (or (equal (nth 3 command-line-args) "dump")
264;; (equal (nth 4 command-line-args) "dump"))
265;; (let ((buffer-undo-list t))
266;; (princ "(setq load-history\n" (current-buffer))
267;; (princ " (nconc load-history\n" (current-buffer))
268;; (princ " '(" (current-buffer))
269;; (let ((tem load-history))
270;; (while tem
271;; (prin1 (car tem) (current-buffer))
272;; (terpri (current-buffer))
273;; (if (cdr tem)
274;; (princ " " (current-buffer)))
275;; (setq tem (cdr tem))))
276;; (princ ")))\n" (current-buffer))
277;; (write-region (point-min) (point-max)
278;; (expand-file-name
279;; (cond
280;; ((eq system-type 'ms-dos)
281;; "../lib-src/fns.el")
282;; ((eq system-type 'windows-nt)
283;; (format "../../../lib-src/fns-%s.el" emacs-version))
284;; (t
285;; (format "../lib-src/fns-%s.el" emacs-version)))
286;; invocation-directory))
287;; (erase-buffer)
288;; (setq load-history nil))
289;; (setq symbol-file-load-history-loaded t))
290;; We don't use this fns-*.el file. Instead we keep the data in PURE space.
291;; Make sure that the spine of the list is not in pure space because it can
292;; be destructively mutated in lread.c:build_load_history.
293(setq load-history (mapcar 'purecopy load-history))
294(setq symbol-file-load-history-loaded t)
295
b7b75652 296(set-buffer-modified-p nil)
c2509060 297
ce87039d
SM
298;; reset the load-path. See lread.c:init_lread why.
299(if (or (equal (nth 3 command-line-args) "bootstrap")
300 (equal (nth 4 command-line-args) "bootstrap"))
301 (setcdr load-path nil))
302
0d20f9a0
JB
303(garbage-collect)
304
ffd56f97
JB
305;;; At this point, we're ready to resume undo recording for scratch.
306(buffer-enable-undo "*scratch*")
307
6a4803ec
RS
308(if (null (garbage-collect))
309 (setq pure-space-overflow t))
310
ce87039d
SM
311(if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
312 (member (nth 4 command-line-args) '("dump" "bootstrap")))
0d20f9a0 313 (if (eq system-type 'vax-vms)
e04d21aa 314 (progn
0d20f9a0
JB
315 (message "Dumping data as file temacs.dump")
316 (dump-emacs "temacs.dump" "temacs")
317 (kill-emacs))
318 (let ((name (concat "emacs-" emacs-version)))
319 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
320 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
321 "-"
322 (substring name (match-end 0)))))
0e659f57 323 (if (memq system-type '(ms-dos windows-nt cygwin))
ed10e0ab
RS
324 (message "Dumping under the name emacs")
325 (message "Dumping under names emacs and %s" name)))
0d20f9a0 326 (condition-case ()
59f3e9a2 327 (delete-file "emacs")
0d20f9a0 328 (file-error nil))
59f3e9a2
JB
329 ;; We used to dump under the name xemacs, but that occasionally
330 ;; confused people installing Emacs (they'd install the file
331 ;; under the name `xemacs'), and it's inconsistent with every
0f4b266c 332 ;; other GNU program's build process.
59f3e9a2 333 (dump-emacs "emacs" "temacs")
4d337390 334 (message "%d pure bytes used" pure-bytes-used)
0d20f9a0 335 ;; Recompute NAME now, so that it isn't set when we dump.
74e32821 336 (if (not (memq system-type '(ms-dos windows-nt cygwin)))
ed10e0ab
RS
337 (let ((name (concat "emacs-" emacs-version)))
338 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
339 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
340 "-"
341 (substring name (match-end 0)))))
342 (add-name-to-file "emacs" name t)))
0d20f9a0
JB
343 (kill-emacs)))
344
345;; Avoid error if user loads some more libraries now.
346(setq purify-flag nil)
347
348;; For machines with CANNOT_DUMP defined in config.h,
349;; this file must be loaded each time Emacs is run.
7fa26c0a 350;; So run the startup code now. First, remove `-l loadup' from args.
0d20f9a0 351
7fa26c0a
KH
352(if (and (equal (nth 1 command-line-args) "-l")
353 (equal (nth 2 command-line-args) "loadup"))
354 (setcdr command-line-args (nthcdr 3 command-line-args)))
355
356(eval top-level)
6594deb0 357
86db31d5
SM
358\f
359;;; Local Variables:
360;;; no-byte-compile: t
361;;; no-update-autoloads: t
362;;; End:
ab5796a9
MB
363
364;;; arch-tag: 121e1dd4-36e1-45ac-860e-239f577a6335
6594deb0 365;;; loadup.el ends here