comparison lisp/loadup.el @ 1261:465bd3c7d932

[xemacs-hg @ 2003-02-06 06:35:47 by ben] various bug fixes mule/cyril-util.el: Fix compile warning. loadup.el, make-docfile.el, update-elc-2.el, update-elc.el: Set stack-trace-on-error, load-always-display-messages so we get better debug results. update-elc-2.el: Fix typo in name of lisp/mule, leading to compile failure. simple.el: Omit M-S-home/end from motion keys. update-elc.el: Overhaul: -- allow list of "early-compile" files to be specified, not hardcoded -- fix autoload checking to include all .el files, not just dumped ones -- be smarter about regenerating autoloads, so we don't need to use loadup-el if not necessary -- use standard methods for loading/not loading auto-autoloads.el (maybe fixes "Already loaded" error?) -- rename misleading NOBYTECOMPILE flag file. window-xemacs.el: Fix bug in default param. window-xemacs.el: Fix compile warnings. lwlib-Xm.c: Fix compile warning. lispref/mule.texi: Lots of Mule rewriting. internals/internals.texi: Major fixup. Correct for new names of Bytebpos, Ichar, etc. and lots of Mule rewriting. config.inc.samp: Various fixups. Makefile.in.in: NOBYTECOMPILE -> BYTECOMPILE_CHANGE. esd.c: Warning fixes. fns.c: Eliminate bogus require-prints-loading-message; use already existent load-always-display-messages instead. Make sure `load' knows we are coming from `require'. lread.c: Turn on `load-warn-when-source-newer' by default. Change loading message to indicate when we are `require'ing. Eliminate purify_flag hacks to display more messages; instead, loadup and friends specify this explicitly with `load-always-display-messages'. Add spaces when batch to clearly indicate recursive loading. Fassoc() does not GC so no need to gcpro. gui-x.c, gui-x.h, menubar-x.c: Fix up crashes when selecting menubar items due to lack of GCPROing of callbacks in lwlib structures. eval.c, lisp.h, print.c: Don't canonicalize to selected-frame when noninteractive, or backtraces get all screwed up as some values are printed through the stream console and some aren't. Export canonicalize_printcharfun() and use in Fbacktrace().
author ben
date Thu, 06 Feb 2003 06:36:17 +0000
parents 5636ae1c0234
children 70921960b980
comparison
equal deleted inserted replaced
1260:278c9cd3435e 1261:465bd3c7d932
1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs. 1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs.
2 2
3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc.
4 ;; Copyright (C) 1996 Richard Mlynarik. 4 ;; Copyright (C) 1996 Richard Mlynarik.
5 ;; Copyright (C) 1995, 1996 Ben Wing. 5 ;; Copyright (C) 1995, 1996, 2003 Ben Wing.
6 6
7 ;; Maintainer: XEmacs Development Team 7 ;; Maintainer: XEmacs Development Team
8 ;; Keywords: internal, dumped 8 ;; Keywords: internal, dumped
9 9
10 ;; This file is part of XEmacs. 10 ;; This file is part of XEmacs.
26 26
27 ;;; Synched up with: Last synched with FSF 19.30, with wild divergence since. 27 ;;; Synched up with: Last synched with FSF 19.30, with wild divergence since.
28 28
29 ;;; Commentary: 29 ;;; Commentary:
30 30
31 ;; Please do not edit this file. Use site-init.el or site-load.el instead. 31 ;; If you are wanting to add files to be dumped into your local version of
32 ;; XEmacs, DO NOT add them here. Use site-init.el or site-load.el instead.
32 33
33 ;; This is loaded into a bare XEmacs to make a dumpable one. 34 ;; This is loaded into a bare XEmacs to make a dumpable one.
34 35
35 ;;; Code: 36 ;;; Code:
37
38 ;; Help debug problems.
39 (setq stack-trace-on-error t
40 load-always-display-messages t)
36 41
37 (when (fboundp 'error) 42 (when (fboundp 'error)
38 (error "loadup.el already loaded!")) 43 (error "loadup.el already loaded!"))
39 44
40 (defvar running-xemacs t 45 (defvar running-xemacs t
51 ;; setting it low makes loadup incredibly fucking slow. 56 ;; setting it low makes loadup incredibly fucking slow.
52 ;; no need to do it when not dumping. 57 ;; no need to do it when not dumping.
53 (if (and purify-flag 58 (if (and purify-flag
54 (not (memq 'quick-build internal-error-checking))) 59 (not (memq 'quick-build internal-error-checking)))
55 30000 3000000))) 60 30000 3000000)))
61
62 ;; really-early-error-handler outputs a stack trace so let's not do it
63 ;; twice.
64 (let ((stack-trace-on-error nil))
56 65
57 ;; This is awfully damn early to be getting an error, right? 66 ;; This is awfully damn early to be getting an error, right?
58 (call-with-condition-handler 'really-early-error-handler 67 (call-with-condition-handler 'really-early-error-handler
59 #'(lambda () 68 #'(lambda ()
60 69
83 92
84 ;; We don't want to have any undo records in the dumped XEmacs. 93 ;; We don't want to have any undo records in the dumped XEmacs.
85 (buffer-disable-undo (get-buffer "*scratch*")) 94 (buffer-disable-undo (get-buffer "*scratch*"))
86 95
87 ;; Load our first bootstrap support 96 ;; Load our first bootstrap support
88 (load "very-early-lisp" nil t) 97 (load "very-early-lisp.el")
89 98
90 ;; lread.c (or src/Makefile.in.in) has prepended 99 ;; lread.c (or src/Makefile.in.in) has prepended
91 ;; "${srcdir}/../lisp/" to load-path, which is how this file 100 ;; "${srcdir}/../lisp/" to load-path, which is how this file
92 ;; has been found. At this point, enough of XEmacs has been 101 ;; has been found. At this point, enough of XEmacs has been
93 ;; initialized that we can start dumping "standard" lisp. 102 ;; initialized that we can start dumping "standard" lisp.
100 (directory-files temp-path t "^[^-.]" 109 (directory-files temp-path t "^[^-.]"
101 nil 'dirs-only)) 110 nil 'dirs-only))
102 (cons (file-name-as-directory temp-path) 111 (cons (file-name-as-directory temp-path)
103 load-path)))) 112 load-path))))
104 113
105 (setq load-warn-when-source-newer t ; Used to be set to nil at the end 114 (setq load-warn-when-source-only t) ; Set to nil at the end
106 load-warn-when-source-only t) ; Set to nil at the end
107 115
108 ;; garbage collect after loading every file in an attempt to 116 ;; garbage collect after loading every file in an attempt to
109 ;; minimize the size of the dumped image (if we don't do this, 117 ;; minimize the size of the dumped image (if we don't do this,
110 ;; there will be lots of extra space in the data segment filled 118 ;; there will be lots of extra space in the data segment filled
111 ;; with garbage-collected junk) 119 ;; with garbage-collected junk)
144 (fmakunbound 'pureload)) 152 (fmakunbound 'pureload))
145 153
146 (packages-load-package-dumped-lisps late-package-load-path) 154 (packages-load-package-dumped-lisps late-package-load-path)
147 155
148 )) ;; end of call-with-condition-handler 156 )) ;; end of call-with-condition-handler
157
158 ) ; (let ((stack-trace-on-error nil)))
149 159
150 ;; Fix up the preloaded file list 160 ;; Fix up the preloaded file list
151 (setq preloaded-file-list (mapcar #'file-name-sans-extension 161 (setq preloaded-file-list (mapcar #'file-name-sans-extension
152 preloaded-file-list)) 162 preloaded-file-list))
153 163
154 (setq load-warn-when-source-newer t ; set to t at top of file 164 (setq load-warn-when-source-only nil)
155 load-warn-when-source-only nil)
156 165
157 (setq debugger 'debug) 166 (setq debugger 'debug)
158 167
159 (when (member "no-site-file" command-line-args) 168 (when (member "no-site-file" command-line-args)
160 (setq site-start-file nil)) 169 (setq site-start-file nil))
161 170
162 ;; If you want additional libraries to be preloaded and their 171 ;; If you want additional libraries to be preloaded and their
163 ;; doc strings kept in the DOC file rather than in core, 172 ;; doc strings kept in the DOC file rather than in core,
164 ;; you may load them with a "site-load.el" file. 173 ;; you may load them with a "site-load.el" file.
165 ;; But you must also cause them to be scanned when the DOC file 174 ;; But you must also cause them to be scanned when the DOC file
166 ;; is generated. For VMS, you must edit ../../vms/makedoc.com. 175 ;; is generated. For MS Windows, you must edit ../nt/xemacs.mak.
167 ;; For other systems, you must edit ../../src/Makefile.in.in. 176 ;; For other systems, you must edit ../src/Makefile.in.in.
168 (when (load "site-load" t) 177 (when (load "site-load" t)
169 (garbage-collect) 178 (garbage-collect)
170 ) 179 )
171 180
172 ;;FSFmacs randomness 181 ;;FSFmacs randomness
200 (garbage-collect) 209 (garbage-collect)
201 210
202 ;;; At this point, we're ready to resume undo recording for scratch. 211 ;;; At this point, we're ready to resume undo recording for scratch.
203 (buffer-enable-undo "*scratch*") 212 (buffer-enable-undo "*scratch*")
204 213
205 ) ;; frequent garbage collection 214 ) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping])))
206 215
207 ;(stop-profiling) 216 ;(stop-profiling)
208 217
209 ;; yuck! need to insert the function def here, and rewrite the dolist 218 ;; yuck! need to insert the function def here, and rewrite the dolist
210 ;; loop below. 219 ;; loop below.
274 (message "Dumping under the name xemacs") 283 (message "Dumping under the name xemacs")
275 ;; This is handled earlier in the build process. 284 ;; This is handled earlier in the build process.
276 ;; (condition-case () (delete-file "xemacs") (file-error nil)) 285 ;; (condition-case () (delete-file "xemacs") (file-error nil))
277 (when (fboundp 'really-free) 286 (when (fboundp 'really-free)
278 (really-free)) 287 (really-free))
288 ;; Make sure we don't dump with debugging messages turned on.
289 (setq stack-trace-on-error nil
290 load-always-display-messages nil)
279 (dump-emacs 291 (dump-emacs
280 (cond 292 (cond
281 ((featurep 'infodock) "infodock") 293 ((featurep 'infodock) "infodock")
282 ;; #### BILL!!! 294 ;; #### BILL!!!
283 ;; If we want to dump under a name other than `xemacs', do that here! 295 ;; If we want to dump under a name other than `xemacs', do that here!