annotate lisp/loadup.el @ 801:2b676dc88c66

[xemacs-hg @ 2002-04-01 03:58:02 by ben] bug fixes (e.g. ballooning on X windows) Makefile.in.in: Try to make the Makefile notice if its source Makefile.in.in is changed, and regenerate and run itself. Use a bigger default SHEAP_ADJUSTMENT on Cygwin; otherwise you can't compile under Mule if a Lisp file has changed. (can't run temacs) TODO.ben-mule-21-5: update. mule/mule-cmds.el: Hash the result of mswindows-get-language-environment-from-locale, since it's very expensive (and causes huge ballooning of memory under X Windows, since it's called from x-get-resource). cl-extra.el, code-files.el, files.el, simple.el, subr.el, x-faces.el: Create new string-equal-ignore-case, based on built-in compare-strings -- compare strings ignoring case without the need to generate garbage by calling downcase. Use it in equalp and elsewhere. alloc.c, bytecode.c, chartab.c, data.c, elhash.c, emacs.c, eval.c, event-Xt.c, event-unixoid.c, extents.c, file-coding.c, fileio.c, fns.c, glyphs.c, gutter.c, lisp-union.h, lisp.h, mule-charset.c, nt.c, process-unix.c, process.c, specifier.c, symbols.c, sysdep.c, sysdep.h, text.c, toolbar.c: Try to implement GC triggering based on percentage of total memory usage. Not currently activated (percentage set to 0) because not quite working. Add `memory-usage' primitive to return XEmacs' idea of its memory usage. Add primitive compare-strings, compatible with FSF 21.1 -- can compare any part of two strings, optionally ignoring case. Improve qxe() functions in text.c for text comparison. Use RETURN_NOT_REACHED to try to avoid warnings about unreachable code. Add volatile_make_int() to fix warning in unix_send_process().
author ben
date Mon, 01 Apr 2002 03:59:04 +0000
parents 0784d089fdc9
children 5636ae1c0234
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
2
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
4 ;; Copyright (C) 1996 Richard Mlynarik.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
5 ;; Copyright (C) 1995, 1996 Ben Wing.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
6
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
7 ;; Maintainer: XEmacs Development Team
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
8 ;; Keywords: internal, dumped
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
9
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
10 ;; This file is part of XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
11
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
12 ;; XEmacs is free software; you can redistribute it and/or modify it
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
13 ;; under the terms of the GNU General Public License as published by
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
14 ;; the Free Software Foundation; either version 2, or (at your option)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
15 ;; any later version.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
16
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
17 ;; XEmacs is distributed in the hope that it will be useful, but
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
20 ;; General Public License for more details.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
21
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
22 ;; You should have received a copy of the GNU General Public License
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
23 ;; along with XEmacs; see the file COPYING. If not, write to the Free
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
25 ;; 02111-1307, USA.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
26
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
27 ;;; Synched up with: Last synched with FSF 19.30, with wild divergence since.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
28
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
29 ;;; Commentary:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
30
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
31 ;; Please do not edit this file. Use site-init.el or site-load.el instead.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
32
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
33 ;; This is loaded into a bare XEmacs to make a dumpable one.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
34
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
35 ;;; Code:
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
36
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
37 (when (fboundp 'error)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
38 (error "loadup.el already loaded!"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
39
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
40 (defvar running-xemacs t
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
41 "Non-nil when the current emacs is XEmacs.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
42 (defvar preloaded-file-list nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
43 "List of files preloaded into the XEmacs binary image.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
44
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
45 (defvar Installation-string nil
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
46 "Description of XEmacs installation.")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
47
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
48 ;(start-profiling)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
49
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
50 (let ((gc-cons-threshold
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
51 ;; setting it low makes loadup incredibly fucking slow.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
52 ;; no need to do it when not dumping.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
53 (if (and purify-flag
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
54 (not (memq 'quick-build internal-error-checking)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
55 30000 3000000)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
56
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
57 ;; This is awfully damn early to be getting an error, right?
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
58 (call-with-condition-handler 'really-early-error-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
59 #'(lambda ()
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
60
440
8de8e3f6228a Import from CVS: tag r21-2-28
cvs
parents: 428
diff changeset
61 ;; Initialize Installation-string. We do it before loading
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
62 ;; anything so that dumped code can make use of its value.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
63 (setq Installation-string
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
64 (save-current-buffer
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
65 (set-buffer (get-buffer-create (generate-new-buffer-name
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
66 " *temp*")))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
67 ;; insert-file-contents-internal bogusly calls
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
68 ;; format-decode without checking if it's defined.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
69 (fset 'format-decode #'(lambda (f l &optional v) l))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
70 (insert-file-contents-internal "../Installation")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
71 (fmakunbound 'format-decode)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
72 (prog1 (buffer-substring)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
73 (kill-buffer (current-buffer)))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
74
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
75 (let ((build-root (expand-file-name ".." invocation-directory)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
76 (setq load-path (list (expand-file-name "lisp" build-root)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
77 (setq module-load-path (list (expand-file-name "modules" build-root))))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
78
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
79 ;; message not defined yet ...
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
80 (external-debugging-output (format "\nUsing load-path %s" load-path))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
81 (external-debugging-output (format "\nUsing module-load-path %s"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
82 module-load-path))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
83
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
84 ;; We don't want to have any undo records in the dumped XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
85 (buffer-disable-undo (get-buffer "*scratch*"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
86
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
87 ;; Load our first bootstrap support
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
88 (load "very-early-lisp" nil t)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
89
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
90 ;; lread.c (or src/Makefile.in.in) has prepended
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
91 ;; "${srcdir}/../lisp/" to load-path, which is how this file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
92 ;; has been found. At this point, enough of XEmacs has been
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
93 ;; initialized that we can start dumping "standard" lisp.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
94 ;; Dumped lisp from external packages is added when we search
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
95 ;; the package path.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
96 ;; #### This code is duplicated in two other places.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
97 (let ((temp-path (expand-file-name "." (car load-path))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
98 (setq load-path (nconc (mapcar
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
99 #'(lambda (i) (concat i "/"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
100 (directory-files temp-path t "^[^-.]"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
101 nil 'dirs-only))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
102 (cons (file-name-as-directory temp-path)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
103 load-path))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
104
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
105 (setq load-warn-when-source-newer t ; Used to be set to nil at the end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
106 load-warn-when-source-only t) ; Set to nil at the end
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
107
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
108 ;; garbage collect after loading every file in an attempt to
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
109 ;; minimize the size of the dumped image (if we don't do this,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
110 ;; there will be lots of extra space in the data segment filled
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
111 ;; with garbage-collected junk)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
112 (defun pureload (file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
113 (let ((full-path
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
114 (locate-file file load-path
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
115 (if load-ignore-elc-files
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
116 '(".el" "") '(".elc" ".el" "")))))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
117 (if full-path
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
118 (prog1
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
119 (load full-path)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
120 ;; but garbage collection really slows down loading.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
121 (unless (memq 'quick-build internal-error-checking)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
122 (garbage-collect)))
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
123 (external-debugging-output (format "\nLoad file %s: not found\n"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
124 file))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
125 ;; Uncomment in case of trouble
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
126 ;;(print (format "late-packages: %S" late-packages))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
127 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
128 nil)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
129
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
130 (load (expand-file-name "../lisp/dumped-lisp.el"))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
131
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
132 (let ((files preloaded-file-list)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
133 file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
134 (while (setq file (car files))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
135 (unless (pureload file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
136 (external-debugging-output "Fatal error during load, aborting")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
137 (kill-emacs 1))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
138 (setq files (cdr files)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
139 (when (not (featurep 'toolbar))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
140 ;; else still define a few functions.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
141 (defun toolbar-button-p (obj) "No toolbar support." nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
142 (defun toolbar-specifier-p (obj) "No toolbar support." nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
143 (fmakunbound 'pureload))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
144
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
145 (packages-load-package-dumped-lisps late-package-load-path)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
146
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
147 )) ;; end of call-with-condition-handler
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
148
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
149 ;; Fix up the preloaded file list
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
150 (setq preloaded-file-list (mapcar #'file-name-sans-extension
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
151 preloaded-file-list))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
152
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
153 (setq load-warn-when-source-newer t ; set to t at top of file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
154 load-warn-when-source-only nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
155
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
156 (setq debugger 'debug)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
157
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
158 (when (member "no-site-file" command-line-args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
159 (setq site-start-file nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
160
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
161 ;; If you want additional libraries to be preloaded and their
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
162 ;; doc strings kept in the DOC file rather than in core,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
163 ;; you may load them with a "site-load.el" file.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
164 ;; But you must also cause them to be scanned when the DOC file
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
165 ;; is generated. For VMS, you must edit ../../vms/makedoc.com.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
166 ;; For other systems, you must edit ../../src/Makefile.in.in.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
167 (when (load "site-load" t)
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
168 (garbage-collect)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
169 )
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
170
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
171 ;;FSFmacs randomness
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
172 ;;(if (fboundp 'x-popup-menu)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
173 ;; (precompute-menubar-bindings))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
174 ;;; Turn on recording of which commands get rebound,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
175 ;;; for the sake of the next call to precompute-menubar-bindings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
176 ;(setq define-key-rebound-commands nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
177
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
178 ;; Note: all compiled Lisp files loaded above this point
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
179 ;; must be among the ones parsed by make-docfile
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
180 ;; to construct DOC. Any that are not processed
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
181 ;; for DOC will not have doc strings in the dumped XEmacs.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
182
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
183 ;; Don't bother with these if we're running temacs, i.e. if we're
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
184 ;; just debugging don't waste time finding doc strings.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
185
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
186 ;; purify-flag is nil if called from loadup-el.el.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
187 (when purify-flag
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
188 (message "Finding pointers to doc strings...")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
189 (Snarf-documentation "DOC")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
190 (message "Finding pointers to doc strings...done")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
191 (Verify-documentation))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
192
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
193 ;; Note: You can cause additional libraries to be preloaded
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
194 ;; by writing a site-init.el that loads them.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
195 ;; See also "site-load" above.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
196 (when (stringp site-start-file)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
197 (load "site-init" t))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
198 (setq current-load-list nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
199 (garbage-collect)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
200
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
201 ;;; At this point, we're ready to resume undo recording for scratch.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
202 (buffer-enable-undo "*scratch*")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
203
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
204 ) ;; frequent garbage collection
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
205
442
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
206 ;(stop-profiling)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
207
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
208 ;; yuck! need to insert the function def here, and rewrite the dolist
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
209 ;; loop below.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
210
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
211 ;(defun loadup-profile-results (&optional info stream)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
212 ; "Print profiling info INFO to STREAM in a pretty format.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
213 ;If INFO is omitted, the current profiling info is retrieved using
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
214 ; `get-profiling-info'.
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
215 ;If STREAM is omitted, either a *Profiling Results* buffer or standard
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
216 ; output are used, depending on whether the function was called
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
217 ; interactively or not."
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
218 ; (interactive)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
219 ; (setq info (if info
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
220 ; (copy-alist info)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
221 ; (get-profiling-info)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
222 ; (when (and (not stream)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
223 ; (interactive-p))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
224 ; (pop-to-buffer (get-buffer-create "*Profiling Results*"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
225 ; (erase-buffer))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
226 ; (let ((standard-output (or stream (if (interactive-p)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
227 ; (current-buffer)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
228 ; standard-output)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
229 ; ;; Calculate the longest function
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
230 ; (maxfunlen (apply #'max
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
231 ; (length "Function Name")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
232 ; (mapcar
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
233 ; (lambda (el)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
234 ; ;; Functions longer than 50 characters (usually
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
235 ; ;; anonymous functions) don't qualify
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
236 ; (let ((l (length (format "%s" (car el)))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
237 ; (if (< l 50)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
238 ; l 0)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
239 ; info))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
240 ; (princ (format "%-*s Ticks %%/Total Call Count\n"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
241 ; maxfunlen "Function Name"))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
242 ; (princ (make-string maxfunlen ?=))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
243 ; (princ " ===== ======= ==========\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
244 ; (let ((sum (float (apply #'+ (mapcar #'cdr info)))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
245 ; (let (entry
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
246 ; (entry-list (nreverse (sort info #'cdr-less-than-cdr))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
247 ; (while entry-list
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
248 ; (setq entry (car entry-list))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
249 ; (princ (format "%-*s %-5d %-6.3f %s\n"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
250 ; maxfunlen (car entry) (cdr entry)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
251 ; (* 100 (/ (cdr entry) sum))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
252 ; (or (gethash (car entry) call-count-profile-table)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
253 ; "")))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
254 ; (setq entry-list (cdr entry-list))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
255 ; (princ (make-string maxfunlen ?-))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
256 ; (princ "---------------------------------\n")
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
257 ; (princ (format "%-*s %-5d %-6.2f\n" maxfunlen "Total" sum 100.0))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
258 ; (princ (format "\n\nOne tick = %g ms\n"
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
259 ; (/ default-profiling-interval 1000.0)))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
260 ; (and (boundp 'internal-error-checking)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
261 ; internal-error-checking
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
262 ; (princ "
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
263 ;WARNING: Error checking is turned on in this XEmacs. This might make
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
264 ; the measurements very unreliable.\n"))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
265 ; (when (and (not stream)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
266 ; (interactive-p))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
267 ; (goto-char (point-min))))
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
268
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
269 ;(loadup-profile-results nil 'external-debugging-output)
abe6d1db359e Import from CVS: tag r21-2-36
cvs
parents: 440
diff changeset
270
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
271 ;; Dump into the name `xemacs' (only)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
272 (when (member "dump" command-line-args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
273 (message "Dumping under the name xemacs")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
274 ;; This is handled earlier in the build process.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
275 ;; (condition-case () (delete-file "xemacs") (file-error nil))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
276 (when (fboundp 'really-free)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
277 (really-free))
462
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
278 (dump-emacs
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
279 (cond
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
280 ((featurep 'infodock) "infodock")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
281 ;; #### BILL!!!
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
282 ;; If we want to dump under a name other than `xemacs', do that here!
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
283 ;; ((featurep 'gtk) "xemacs-gtk")
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
284 (t "xemacs"))
0784d089fdc9 Import from CVS: tag r21-2-46
cvs
parents: 442
diff changeset
285 "temacs")
428
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
286 (kill-emacs))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
287
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
288 ;; Avoid error if user loads some more libraries now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
289 (setq purify-flag nil)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
290
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
291 (when (member "run-temacs" command-line-args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
292 (message "\nBootstrapping from temacs...")
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
293 ;; Remove all args up to and including "run-temacs"
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
294 (apply #'run-emacs-from-temacs (cdr (member "run-temacs" command-line-args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
295 ;; run-emacs-from-temacs doesn't actually return anyway.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
296 (kill-emacs))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
297
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
298 ;; XEmacs change
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
299 ;; If you are using 'recompile', then you should have used -l loadup-el.el
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
300 ;; so that the .el files always get loaded (the .elc files may be out-of-
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
301 ;; date or bad).
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
302 (when (member "recompile" command-line-args)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
303 (setq command-line-args-left (cdr (member "recompile" command-line-args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
304 (batch-byte-recompile-directory)
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
305 (kill-emacs))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
306
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
307 ;; For machines with CANNOT_DUMP defined in config.h,
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
308 ;; this file must be loaded each time Emacs is run.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
309 ;; So run the startup code now.
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
310
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
311 (when (not (fboundp 'dump-emacs))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
312 ;; Avoid loading loadup.el a second time!
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
313 (setq command-line-args (cdr (cdr command-line-args)))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
314 (eval top-level))
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
315
3ecd8885ac67 Import from CVS: tag r21-2-22
cvs
parents:
diff changeset
316 ;;; loadup.el ends here