BSD 4_4 development
[unix-history] / usr / contrib / lib / emacs / lisp / loadup.el
CommitLineData
481fa7aa
C
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 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
22(load "subr")
23(garbage-collect)
24(load "loaddefs.el") ;Don't get confused if someone compiled loaddefs by mistake.
25(garbage-collect)
26(load "simple")
27(garbage-collect)
28(load "help")
29(garbage-collect)
30(load "files")
31(garbage-collect)
32(load "indent")
33(load "window")
34(load "paths.el") ;Don't get confused if someone compiled paths by mistake.
35(garbage-collect)
36(load "startup")
37(load "lisp")
38(garbage-collect)
39(load "page")
40(load "register")
41(garbage-collect)
42(load "paragraphs")
43(load "lisp-mode")
44(garbage-collect)
45(load "text-mode")
46(load "fill")
47(garbage-collect)
48(load "c-mode")
49(garbage-collect)
50(load "isearch")
51(garbage-collect)
52(load "replace")
53(if (eq system-type 'vax-vms)
54 (progn
55 (garbage-collect)
56 (load "vmsproc")))
57(garbage-collect)
58(load "abbrev")
59(garbage-collect)
60(load "buff-menu")
61(if (eq system-type 'vax-vms)
62 (progn
63 (garbage-collect)
64 (load "vms-patch")))
65
66;If you want additional libraries to be preloaded and their
67;doc strings kept in the DOC file rather than in core,
68;you may load them with a "site-load.el" file.
69;But you must also cause them to be scanned when the DOC file
70;is generated. For VMS, you must edit ../etc/makedoc.com.
71;For other systems, you must edit ../src/ymakefile.
72(if (load "site-load" t)
73 (garbage-collect))
74
75(load "version.el") ;Don't get confused if someone compiled version.el by mistake.
76
77;; Note: all compiled Lisp files loaded above this point
78;; must be among the ones parsed by make-docfile
79;; to construct DOC. Any that are not processed
80;; for DOC will not have doc strings in the dumped Emacs.
81
82(message "Finding pointers to doc strings...")
83(if (fboundp 'dump-emacs)
84 (let ((name emacs-version))
85 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
86 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
87 "-"
88 (substring name (match-end 0)))))
89 (copy-file (expand-file-name "../etc/DOC")
90 (concat (expand-file-name "../etc/DOC-") name)
91 t)
92 (Snarf-documentation (concat "DOC-" name)))
93 (Snarf-documentation "DOC"))
94(message "Finding pointers to doc strings...done")
95
96;Note: You can cause additional libraries to be preloaded
97;by writing a site-init.el that loads them.
98;See also "site-load" above.
99(load "site-init" t)
100(garbage-collect)
101
102(if (or (equal (nth 3 command-line-args) "dump")
103 (equal (nth 4 command-line-args) "dump"))
104 (if (eq system-type 'vax-vms)
105 (progn
106 (message "Dumping data as file temacs.dump")
107 (dump-emacs "temacs.dump" "temacs")
108 (kill-emacs))
109 (if (fboundp 'dump-emacs-data)
110 ;; Handle the IBM RS/6000, and perhaps eventually other machines.
111 (progn
112 ;; This strange nesting is so that the variable `name'
113 ;; is not bound when the data is dumped.
114 (message "Dumping data as file ../etc/EMACS-DATA")
115 (dump-emacs-data "../etc/EMACS-DATA")
116 (kill-emacs))
117 (let ((name (concat "emacs-" emacs-version)))
118 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
119 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
120 "-"
121 (substring name (match-end 0)))))
122 (message "Dumping under names xemacs and %s" name))
123 (condition-case ()
124 (delete-file "xemacs")
125 (file-error nil))
126 (dump-emacs "xemacs" "temacs")
127 ;; Recompute NAME now, so that it isn't set when we dump.
128 (let ((name (concat "emacs-" emacs-version)))
129 (while (string-match "[^-+_.a-zA-Z0-9]+" name)
130 (setq name (concat (downcase (substring name 0 (match-beginning 0)))
131 "-"
132 (substring name (match-end 0)))))
133 (add-name-to-file "xemacs" name t))
134 (kill-emacs))))
135
136;; Avoid error if user loads some more libraries now.
137(setq purify-flag nil)
138
139;; For machines with CANNOT_DUMP defined in config.h,
140;; this file must be loaded each time Emacs is run.
141;; So run the startup code now.
142
143(or (fboundp 'dump-emacs)
144 (eval top-level))