*** empty log message ***
[bpt/emacs.git] / lisp / loadup.el
1 ;;Load up standardly loaded Lisp files for Emacs.
2 ;; This is loaded into a bare Emacs to make a dumpable one.
3 ;; Copyright (C) 1985, 1986, 1992 Free Software Foundation, Inc.
4
5 ;; This file is part of GNU Emacs.
6
7 ;; GNU Emacs is free software; you can redistribute it and/or modify
8 ;; it under the terms of the GNU General Public License as published by
9 ;; the Free Software Foundation; either version 1, or (at your option)
10 ;; any later version.
11
12 ;; GNU Emacs is distributed in the hope that it will be useful,
13 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
14 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 ;; GNU General Public License for more details.
16
17 ;; You should have received a copy of the GNU General Public License
18 ;; along with GNU Emacs; see the file COPYING. If not, write to
19 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
20
21 ;;; We don't want to have any undo records in the dumped Emacs.
22 (buffer-disable-undo "*scratch*")
23
24 (load "subr")
25 (load "map-ynp")
26 (garbage-collect)
27 (load "loaddefs.el") ;Don't get confused if someone compiled loaddefs by mistake.
28 (garbage-collect)
29 (load "simple")
30 (garbage-collect)
31 (load "help")
32 (garbage-collect)
33 (load "files")
34 (garbage-collect)
35 (load "indent")
36 (load "window")
37 (garbage-collect)
38 (if (fboundp 'delete-screen)
39 (load "screen"))
40 (load "paths.el") ;Don't get confused if someone compiled paths by mistake.
41 (garbage-collect)
42 (load "startup")
43 (load "lisp")
44 (garbage-collect)
45 (load "page")
46 (load "register")
47 (garbage-collect)
48 (load "paragraphs")
49 (load "lisp-mode")
50 (garbage-collect)
51 (load "text-mode")
52 (load "fill")
53 (garbage-collect)
54 (load "c-mode")
55 (garbage-collect)
56 (load "isearch")
57 (garbage-collect)
58 (load "replace")
59 (if (eq system-type 'vax-vms)
60 (progn
61 (garbage-collect)
62 (load "vmsproc")))
63 (garbage-collect)
64 (load "abbrev")
65 (garbage-collect)
66 (load "buff-menu")
67 (if (eq system-type 'vax-vms)
68 (progn
69 (garbage-collect)
70 (load "vms-patch")))
71 (if (fboundp 'atan) ; preload some constants and
72 (progn ; floating pt. functions if
73 (garbage-collect) ; we have float support.
74 (load "float-sup")))
75
76 ;If you want additional libraries to be preloaded and their
77 ;doc strings kept in the DOC file rather than in core,
78 ;you may load them with a "site-load.el" file.
79 ;But you must also cause them to be scanned when the DOC file
80 ;is generated. For VMS, you must edit ../vms/makedoc.com.
81 ;For other systems, you must edit ../src/ymakefile.
82 (if (load "site-load" t)
83 (garbage-collect))
84
85 (load "version.el") ;Don't get confused if someone compiled version.el by mistake.
86
87 ;; Note: all compiled Lisp files loaded above this point
88 ;; must be among the ones parsed by make-docfile
89 ;; to construct DOC. Any that are not processed
90 ;; for DOC will not have doc strings in the dumped Emacs.
91
92 (message "Finding pointers to doc strings...")
93 (if (fboundp 'dump-emacs)
94 (let ((name emacs-version))
95 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
96 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
97 "-"
98 (substring name (match-end 0)))))
99 (copy-file (expand-file-name "../etc/DOC")
100 (concat (expand-file-name "../etc/DOC-") name)
101 t)
102 (Snarf-documentation (concat "DOC-" name)))
103 (Snarf-documentation "DOC"))
104 (message "Finding pointers to doc strings...done")
105
106 ;Note: You can cause additional libraries to be preloaded
107 ;by writing a site-init.el that loads them.
108 ;See also "site-load" above.
109 (load "site-init" t)
110 (garbage-collect)
111
112 ;;; At this point, we're ready to resume undo recording for scratch.
113 (buffer-enable-undo "*scratch*")
114
115 (if (or (equal (nth 3 command-line-args) "dump")
116 (equal (nth 4 command-line-args) "dump"))
117 (if (eq system-type 'vax-vms)
118 (progn
119 (message "Dumping data as file temacs.dump")
120 (dump-emacs "temacs.dump" "temacs")
121 (kill-emacs))
122 (let ((name (concat "emacs-" emacs-version)))
123 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
124 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
125 "-"
126 (substring name (match-end 0)))))
127 (message "Dumping under names xemacs and %s" name))
128 (condition-case ()
129 (delete-file "xemacs")
130 (file-error nil))
131 (dump-emacs "xemacs" "temacs")
132 ;; Recompute NAME now, so that it isn't set when we dump.
133 (let ((name (concat "emacs-" emacs-version)))
134 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
135 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
136 "-"
137 (substring name (match-end 0)))))
138 (add-name-to-file "xemacs" name t))
139 (kill-emacs)))
140
141 ;; Avoid error if user loads some more libraries now.
142 (setq purify-flag nil)
143
144 ;; For machines with CANNOT_DUMP defined in config.h,
145 ;; this file must be loaded each time Emacs is run.
146 ;; So run the startup code now.
147
148 (or (fboundp 'dump-emacs)
149 (eval top-level))