659
|
1 ;;; loadup.el --- load up standardly loaded Lisp files for Emacs.
|
|
2
|
7298
|
3 ;; Copyright (C) 1985, 1986, 1992, 1994 Free Software Foundation, Inc.
|
840
|
4
|
807
|
5 ;; Maintainer: FSF
|
811
|
6 ;; Keywords: internal
|
807
|
7
|
35
|
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
|
807
|
12 ;; the Free Software Foundation; either version 2, or (at your option)
|
35
|
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
|
14169
|
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.
|
35
|
24
|
840
|
25 ;;; Commentary:
|
|
26
|
|
27 ;; This is loaded into a bare Emacs to make a dumpable one.
|
|
28
|
807
|
29 ;;; Code:
|
|
30
|
26002
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
31 ;; add subdirectories to the load-path for files that might
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
32 ;; get autoloaded when bootstrapping
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
33 (if (or (equal (nth 3 command-line-args) "bootstrap")
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
34 (equal (nth 4 command-line-args) "bootstrap"))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
35 (let ((path (car load-path)))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
36 (setq load-path (list path
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
37 (expand-file-name "emacs-lisp" path)
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
38 (expand-file-name "international" path)))))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
39
|
1692
|
40 (message "Using load-path %s" load-path)
|
|
41
|
648
|
42 ;;; We don't want to have any undo records in the dumped Emacs.
|
|
43 (buffer-disable-undo "*scratch*")
|
35
|
44
|
22965
|
45 (load "byte-run")
|
35
|
46 (load "subr")
|
10806
|
47
|
|
48 ;; We specify .el in case someone compiled version.el by mistake.
|
|
49 (load "version.el")
|
|
50
|
17397
|
51 (load "widget")
|
|
52 (load "custom")
|
26002
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
53 (autoload '\` "emacs-lisp/backquote" nil nil 'macro)
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
54 (load "map-ynp")
|
17427
|
55 (load "cus-start")
|
18595
|
56 (load "international/mule")
|
|
57 (load "international/mule-conf.el") ;Don't get confused if someone compiled this by mistake.
|
22965
|
58 (load "format")
|
17783
|
59 (load "bindings")
|
|
60 (setq load-source-file-function 'load-with-code-conversion)
|
35
|
61 (load "simple")
|
|
62 (load "help")
|
|
63 (load "files")
|
17007
|
64 ;; Any Emacs Lisp source file (*.el) loaded here after can contain
|
|
65 ;; multilingual text.
|
18595
|
66 (load "international/mule-cmds")
|
19957
|
67 (load "case-table")
|
18595
|
68 (load "international/characters")
|
22258
|
69
|
23013
|
70 (message "Lists of integers (garbage collection statistics) are normal output")
|
|
71 (message "while building Emacs; they do not indicate a problem.")
|
22258
|
72 (message "%s" (garbage-collect))
|
|
73 (load "loaddefs.el") ;Don't get confused if someone compiled this by mistake.
|
|
74 (message "%s" (garbage-collect))
|
|
75
|
17951
|
76 (let ((set-case-syntax-set-multibyte t))
|
18595
|
77 (load "international/latin-1")
|
|
78 (load "international/latin-2")
|
|
79 (load "international/latin-3")
|
|
80 (load "international/latin-4")
|
26128
|
81 (load "international/latin-5")
|
|
82 (load "international/latin-8")
|
|
83 (load "international/latin-9"))
|
22965
|
84 ;; Load language-specific files.
|
17007
|
85 (load "language/chinese")
|
|
86 (load "language/cyrillic")
|
|
87 (load "language/indian")
|
17990
|
88 (load "language/devanagari") ; This should be loaded after indian.
|
17292
|
89 (load "language/english")
|
17007
|
90 (load "language/ethiopic")
|
|
91 (load "language/european")
|
21208
|
92 (load "language/czech")
|
|
93 (load "language/slovak")
|
21541
|
94 (load "language/romanian")
|
17007
|
95 (load "language/greek")
|
|
96 (load "language/hebrew")
|
|
97 (load "language/japanese")
|
|
98 (load "language/korean")
|
17089
|
99 (load "language/lao")
|
17007
|
100 (load "language/thai")
|
17292
|
101 (load "language/tibetan")
|
17007
|
102 (load "language/vietnamese")
|
|
103 (load "language/misc-lang")
|
22878
|
104 (update-coding-systems-internal)
|
22258
|
105
|
35
|
106 (load "indent")
|
12426
|
107 (load "isearch")
|
35
|
108 (load "window")
|
16174
|
109 (load "frame")
|
26736
|
110 (load "term/tty-colors")
|
18075
|
111 (load "faces")
|
11040
|
112 (if (fboundp 'frame-face-alist)
|
|
113 (progn
|
|
114 (load "facemenu")))
|
|
115 (if (fboundp 'track-mouse)
|
|
116 (progn
|
|
117 (load "mouse")
|
25121
|
118 (and (boundp 'x-toolkit-scroll-bars-p)
|
|
119 (load "scroll-bar"))
|
2806
|
120 (load "select")))
|
22258
|
121
|
|
122 (message "%s" (garbage-collect))
|
13375
|
123 (load "menu-bar")
|
35
|
124 (load "paths.el") ;Don't get confused if someone compiled paths by mistake.
|
|
125 (load "startup")
|
18595
|
126 (load "emacs-lisp/lisp")
|
|
127 (load "textmodes/page")
|
35
|
128 (load "register")
|
18595
|
129 (load "textmodes/paragraphs")
|
|
130 (load "emacs-lisp/lisp-mode")
|
|
131 (load "textmodes/text-mode")
|
|
132 (load "textmodes/fill")
|
22258
|
133 (message "%s" (garbage-collect))
|
|
134
|
35
|
135 (load "replace")
|
|
136 (if (eq system-type 'vax-vms)
|
|
137 (progn
|
|
138 (load "vmsproc")))
|
|
139 (load "abbrev")
|
|
140 (load "buff-menu")
|
|
141 (if (eq system-type 'vax-vms)
|
|
142 (progn
|
|
143 (load "vms-patch")))
|
9783
|
144 (if (eq system-type 'windows-nt)
|
|
145 (progn
|
|
146 (load "ls-lisp")
|
15086
|
147 (load "disp-table") ; needed to setup ibm-pc char set, see internal.el
|
16593
|
148 (load "dos-w32")
|
19356
|
149 (load "w32-fns")))
|
5459
|
150 (if (eq system-type 'ms-dos)
|
|
151 (progn
|
|
152 (load "ls-lisp")
|
16593
|
153 (load "dos-w32")
|
5459
|
154 (load "dos-fns")
|
22071
|
155 (load "dos-vars")
|
24709
|
156 (load "international/ccl") ; for cpNNN coding systems in codepage.el
|
|
157 (load "international/codepage") ; internal.el uses cpNNN coding systems
|
19356
|
158 (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el
|
35
|
159 (if (fboundp 'atan) ; preload some constants and
|
19356
|
160 (progn ; floating pt. functions if we have float support.
|
35
|
161 (load "float-sup")))
|
22258
|
162 (message "%s" (garbage-collect))
|
9442
|
163
|
927
|
164 (load "vc-hooks")
|
13134
|
165 (load "ediff-hook")
|
22258
|
166 (message "%s" (garbage-collect))
|
35
|
167
|
|
168 ;If you want additional libraries to be preloaded and their
|
|
169 ;doc strings kept in the DOC file rather than in core,
|
|
170 ;you may load them with a "site-load.el" file.
|
|
171 ;But you must also cause them to be scanned when the DOC file
|
445
|
172 ;is generated. For VMS, you must edit ../vms/makedoc.com.
|
13316
|
173 ;For other systems, you must edit ../src/Makefile.in.
|
35
|
174 (if (load "site-load" t)
|
|
175 (garbage-collect))
|
|
176
|
12299
|
177 (if (fboundp 'x-popup-menu)
|
|
178 (precompute-menubar-bindings))
|
|
179 ;; Turn on recording of which commands get rebound,
|
|
180 ;; for the sake of the next call to precompute-menubar-bindings.
|
|
181 (setq define-key-rebound-commands nil)
|
|
182
|
5489
|
183 ;; Determine which last version number to use
|
|
184 ;; based on the executables that now exist.
|
6540
|
185 (if (and (or (equal (nth 3 command-line-args) "dump")
|
|
186 (equal (nth 4 command-line-args) "dump"))
|
|
187 (not (eq system-type 'ms-dos)))
|
13342
f68eab5a63d2
(finding existing executable versions): Add a period to the end of BASE.
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
188 (let* ((base (concat "emacs-" emacs-version "."))
|
5489
|
189 (files (file-name-all-completions base default-directory))
|
|
190 (versions (mapcar (function (lambda (name)
|
13366
|
191 (string-to-int (substring name (length base)))))
|
5489
|
192 files)))
|
|
193 (setq emacs-version (format "%s.%d"
|
|
194 emacs-version
|
5509
|
195 (if versions
|
|
196 (1+ (apply 'max versions))
|
|
197 1)))))
|
5489
|
198
|
35
|
199 ;; Note: all compiled Lisp files loaded above this point
|
|
200 ;; must be among the ones parsed by make-docfile
|
|
201 ;; to construct DOC. Any that are not processed
|
|
202 ;; for DOC will not have doc strings in the dumped Emacs.
|
|
203
|
|
204 (message "Finding pointers to doc strings...")
|
6540
|
205 (if (or (equal (nth 3 command-line-args) "dump")
|
|
206 (equal (nth 4 command-line-args) "dump"))
|
35
|
207 (let ((name emacs-version))
|
|
208 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
|
|
209 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
|
|
210 "-"
|
|
211 (substring name (match-end 0)))))
|
9783
|
212 (if (memq system-type '(ms-dos windows-nt))
|
9572
|
213 (setq name (expand-file-name
|
15398
e0d50fe661c0
On MSDOS, don't assume that `make-frame' is only bound under an X
Richard M. Stallman <rms@gnu.org>
diff
changeset
|
214 (if (fboundp 'x-create-frame) "DOC-X" "DOC") "../etc"))
|
5459
|
215 (setq name (concat (expand-file-name "../etc/DOC-") name))
|
|
216 (if (file-exists-p name)
|
|
217 (delete-file name))
|
|
218 (copy-file (expand-file-name "../etc/DOC") name t))
|
1065
|
219 (Snarf-documentation (file-name-nondirectory name)))
|
26002
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
220 (condition-case nil
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
221 (Snarf-documentation "DOC")
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
222 (error nil)))
|
35
|
223 (message "Finding pointers to doc strings...done")
|
|
224
|
22357
|
225 ;;;Note: You can cause additional libraries to be preloaded
|
|
226 ;;;by writing a site-init.el that loads them.
|
|
227 ;;;See also "site-load" above.
|
35
|
228 (load "site-init" t)
|
8184
|
229 (setq current-load-list nil)
|
23286
|
230
|
23575
|
231 ;; Write the value of load-history into fns-VERSION.el,
|
|
232 ;; then clear out load-history.
|
24574
|
233 (if (or (equal (nth 3 command-line-args) "dump")
|
|
234 (equal (nth 4 command-line-args) "dump"))
|
|
235 (let ((buffer-undo-list t))
|
|
236 (princ "(setq load-history\n" (current-buffer))
|
|
237 (princ " (nconc load-history\n" (current-buffer))
|
|
238 (princ " '(" (current-buffer))
|
|
239 (let ((tem load-history))
|
|
240 (while tem
|
|
241 (prin1 (car tem) (current-buffer))
|
|
242 (terpri (current-buffer))
|
|
243 (if (cdr tem)
|
|
244 (princ " " (current-buffer)))
|
|
245 (setq tem (cdr tem))))
|
|
246 (princ ")))\n" (current-buffer))
|
|
247 (write-region (point-min) (point-max)
|
|
248 (expand-file-name
|
|
249 (cond
|
|
250 ((eq system-type 'ms-dos)
|
|
251 "../lib-src/fns.el")
|
|
252 ((eq system-type 'windows-nt)
|
|
253 (format "../../../lib-src/fns-%s.el" emacs-version))
|
|
254 (t
|
|
255 (format "../lib-src/fns-%s.el" emacs-version)))
|
|
256 invocation-directory))
|
|
257 (erase-buffer)
|
|
258 (setq load-history nil))
|
|
259 (setq symbol-file-load-history-loaded t))
|
23575
|
260 (set-buffer-modified-p nil)
|
23286
|
261
|
26002
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
262 ;; reset the load-path. See lread.c:init_lread why.
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
263 (if (or (equal (nth 3 command-line-args) "bootstrap")
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
264 (equal (nth 4 command-line-args) "bootstrap"))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
265 (setcdr load-path nil))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
266
|
35
|
267 (garbage-collect)
|
|
268
|
648
|
269 ;;; At this point, we're ready to resume undo recording for scratch.
|
|
270 (buffer-enable-undo "*scratch*")
|
|
271
|
26002
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
272 (if (or (member (nth 3 command-line-args) '("dump" "bootstrap"))
|
4f46db3c9d7d
* subr.el (with-current-buffer): don't use backquotes to avoid
Stefan Monnier <monnier@iro.umontreal.ca>
diff
changeset
|
273 (member (nth 4 command-line-args) '("dump" "bootstrap")))
|
35
|
274 (if (eq system-type 'vax-vms)
|
|
275 (progn
|
|
276 (message "Dumping data as file temacs.dump")
|
|
277 (dump-emacs "temacs.dump" "temacs")
|
|
278 (kill-emacs))
|
|
279 (let ((name (concat "emacs-" emacs-version)))
|
|
280 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
|
|
281 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
|
|
282 "-"
|
|
283 (substring name (match-end 0)))))
|
5459
|
284 (if (eq system-type 'ms-dos)
|
|
285 (message "Dumping under the name emacs")
|
|
286 (message "Dumping under names emacs and %s" name)))
|
35
|
287 (condition-case ()
|
1703
|
288 (delete-file "emacs")
|
35
|
289 (file-error nil))
|
1703
|
290 ;; We used to dump under the name xemacs, but that occasionally
|
|
291 ;; confused people installing Emacs (they'd install the file
|
|
292 ;; under the name `xemacs'), and it's inconsistent with every
|
22357
|
293 ;; other GNU program's build process.
|
1703
|
294 (dump-emacs "emacs" "temacs")
|
9752
|
295 (message "%d pure bytes used" pure-bytes-used)
|
35
|
296 ;; Recompute NAME now, so that it isn't set when we dump.
|
11398
|
297 (if (not (memq system-type '(ms-dos windows-nt)))
|
5459
|
298 (let ((name (concat "emacs-" emacs-version)))
|
|
299 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
|
|
300 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
|
|
301 "-"
|
|
302 (substring name (match-end 0)))))
|
|
303 (add-name-to-file "emacs" name t)))
|
35
|
304 (kill-emacs)))
|
|
305
|
|
306 ;; Avoid error if user loads some more libraries now.
|
|
307 (setq purify-flag nil)
|
|
308
|
|
309 ;; For machines with CANNOT_DUMP defined in config.h,
|
|
310 ;; this file must be loaded each time Emacs is run.
|
22358
|
311 ;; So run the startup code now. First, remove `-l loadup' from args.
|
35
|
312
|
22358
|
313 (if (and (equal (nth 1 command-line-args) "-l")
|
|
314 (equal (nth 2 command-line-args) "loadup"))
|
|
315 (setcdr command-line-args (nthcdr 3 command-line-args)))
|
|
316
|
|
317 (eval top-level)
|
659
|
318
|
|
319 ;;; loadup.el ends here
|