Mercurial > hg > xemacs-beta
annotate lisp/loadup.el @ 5307:c096d8051f89
Have NATNUMP give t for positive bignums; check limits appropriately.
src/ChangeLog addition:
2010-11-20 Aidan Kehoe <kehoea@parhasard.net>
* abbrev.c (Fexpand_abbrev):
* alloc.c:
* alloc.c (Fmake_list):
* alloc.c (Fmake_vector):
* alloc.c (Fmake_bit_vector):
* alloc.c (Fmake_byte_code):
* alloc.c (Fmake_string):
* alloc.c (vars_of_alloc):
* bytecode.c (UNUSED):
* bytecode.c (Fbyte_code):
* chartab.c (decode_char_table_range):
* cmds.c (Fself_insert_command):
* data.c (check_integer_range):
* data.c (Fnatnump):
* data.c (Fnonnegativep):
* data.c (Fstring_to_number):
* elhash.c (hash_table_size_validate):
* elhash.c (decode_hash_table_size):
* eval.c (Fbacktrace_frame):
* event-stream.c (lisp_number_to_milliseconds):
* event-stream.c (Faccept_process_output):
* event-stream.c (Frecent_keys):
* event-stream.c (Fdispatch_event):
* events.c (Fmake_event):
* events.c (Fevent_timestamp):
* events.c (Fevent_timestamp_lessp):
* events.h:
* events.h (struct command_builder):
* file-coding.c (gzip_putprop):
* fns.c:
* fns.c (check_sequence_range):
* fns.c (Frandom):
* fns.c (Fnthcdr):
* fns.c (Flast):
* fns.c (Fnbutlast):
* fns.c (Fbutlast):
* fns.c (Fmember):
* fns.c (Ffill):
* fns.c (Freduce):
* fns.c (replace_string_range_1):
* fns.c (Freplace):
* font-mgr.c (Ffc_pattern_get):
* frame-msw.c (msprinter_set_frame_properties):
* glyphs.c (check_valid_xbm_inline):
* indent.c (Fmove_to_column):
* intl-win32.c (mswindows_multibyte_to_unicode_putprop):
* lisp.h:
* lisp.h (ARRAY_DIMENSION_LIMIT):
* lread.c (decode_mode_1):
* mule-ccl.c (ccl_get_compiled_code):
* number.h:
* process-unix.c (unix_open_multicast_group):
* process.c (Fset_process_window_size):
* profile.c (Fstart_profiling):
* unicode.c (Funicode_to_char):
Change NATNUMP to return 1 for positive bignums; changes uses of
it and of CHECK_NATNUM appropriately, usually by checking for an
integer in an appropriate range.
Add array-dimension-limit and use it in #'make-vector,
#'make-string. Add array-total-size-limit, array-rank-limit while
we're at it, for the sake of any Common Lisp-oriented code that
uses these limits.
Rename check_int_range to check_integer_range, have it take
Lisp_Objects (and thus bignums) instead.
Remove bignum_butlast(), just set int_n to an appropriately large
integer if N is a bignum.
Accept bignums in check_sequence_range(), change the functions
that use check_sequence_range() appropriately.
Move the definition of NATNUMP() to number.h; document why it's a
reasonable name, contradicting an old comment.
tests/ChangeLog addition:
2010-11-20 Aidan Kehoe <kehoea@parhasard.net>
* automated/lisp-tests.el:
* automated/lisp-tests.el (featurep):
* automated/lisp-tests.el (wrong-type-argument):
* automated/mule-tests.el (featurep):
Check for args-out-of-range errors instead of wrong-type-argument
errors in various places when code is handed a large bignum
instead of a fixnum.
Also check for the wrong-type-argument errors when giving the same
code a non-integer value.
| author | Aidan Kehoe <kehoea@parhasard.net> |
|---|---|
| date | Sat, 20 Nov 2010 16:49:11 +0000 |
| parents | 5efbd1253905 |
| children | 308d34e9f07d |
| rev | line source |
|---|---|
| 428 | 1 ;; loadup.el --- load up standardly loaded Lisp files for XEmacs. |
| 2 | |
| 3 ;; Copyright (C) 1985, 1986, 1992, 1994, 1997 Free Software Foundation, Inc. | |
| 4 ;; Copyright (C) 1996 Richard Mlynarik. | |
|
4841
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
5 ;; Copyright (C) 1995, 1996, 2003, 2005 Ben Wing. |
| 428 | 6 |
| 7 ;; Maintainer: XEmacs Development Team | |
| 8 ;; Keywords: internal, dumped | |
| 9 | |
| 10 ;; This file is part of XEmacs. | |
| 11 | |
| 12 ;; XEmacs is free software; you can redistribute it and/or modify it | |
| 13 ;; under the terms of the GNU General Public License as published by | |
| 14 ;; the Free Software Foundation; either version 2, or (at your option) | |
| 15 ;; any later version. | |
| 16 | |
| 17 ;; XEmacs is distributed in the hope that it will be useful, but | |
| 18 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 20 ;; General Public License for more details. | |
| 21 | |
| 22 ;; You should have received a copy of the GNU General Public License | |
| 23 ;; along with XEmacs; see the file COPYING. If not, write to the Free | |
| 24 ;; Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA | |
| 25 ;; 02111-1307, USA. | |
| 26 | |
| 27 ;;; Synched up with: Last synched with FSF 19.30, with wild divergence since. | |
| 28 | |
| 29 ;;; Commentary: | |
| 30 | |
| 1261 | 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. | |
| 428 | 33 |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
34 ;; ***Note the docstrings for the variables in this file. They follow the |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
35 ;; conventions described in lib-src/make-docfile.c, and any new variables or |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
36 ;; functions added to this file should follow those conventions too, since |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
37 ;; this file is always loaded uncompiled, and the byte-compiler never gets a |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
38 ;; chance to format the docstrings in the way make-docfile.c understands. |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
39 |
| 428 | 40 ;; This is loaded into a bare XEmacs to make a dumpable one. |
| 41 | |
| 42 ;;; Code: | |
| 43 | |
| 1261 | 44 ;; Help debug problems. |
| 45 (setq stack-trace-on-error t | |
| 46 load-always-display-messages t) | |
|
4841
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
47 (when (featurep 'debug-xemacs) |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
48 ;; Immediately dump core upon an unhandled error, rather than just quitting |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
49 ;; the program. This can also be achieved by setting an environment variable |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
50 ;; XEMACSDEBUG to contain '(setq debug-on-error t)', e.g. |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
51 ;; export XEMACSDEBUG='(setq debug-on-error t)' |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
52 (setq debug-on-error t)) |
| 1261 | 53 |
| 1330 | 54 ;(princ (format "command-line-args: %s\n" command-line-args)) |
| 55 ;(princ (format "configure-lisp-directory: %S\n" configure-lisp-directory)) | |
| 56 ;(princ (format "configure-data-directory: %S\n" configure-data-directory)) | |
| 57 ;(princ (format "lisp-directory: %S\n" lisp-directory)) | |
| 58 | |
| 428 | 59 (when (fboundp 'error) |
| 60 (error "loadup.el already loaded!")) | |
| 61 | |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
62 (defconst running-xemacs t "\ |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
63 Non-nil when the current emacs is XEmacs.") |
| 3511 | 64 |
| 65 ;; Can't make this constant for now because it causes an error in | |
| 66 ;; update-elc.el. | |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
67 (defvar source-lisp (file-name-directory (expand-file-name (nth 2 command-line-args))) "\ |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
68 Root of tree containing the Lisp source code for the current build. |
| 3511 | 69 Differs from `lisp-directory' if this XEmacs has been installed. ") |
| 70 | |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
71 (defconst build-directory (expand-file-name ".." invocation-directory) "\ |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
72 Root of tree containing object files and executables produced by build. |
| 3511 | 73 Differs from `source-directory' if configured with --srcdir option, a practice |
| 74 recommended for developers.") | |
| 75 | |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
76 (defconst source-directory (expand-file-name ".." source-lisp) "\ |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
77 Root of tree containing source code for the current build. |
| 3511 | 78 Used during loadup and for documenting source of symbols defined in C.") |
| 79 | |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
80 (defvar preloaded-file-list nil "\ |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
81 List of Lisp files preloaded into the XEmacs binary image, |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
82 with the exception of `loadup.el'.") |
| 428 | 83 |
| 442 | 84 ;(start-profiling) |
| 85 | |
| 86 (let ((gc-cons-threshold | |
| 87 ;; setting it low makes loadup incredibly fucking slow. | |
| 88 ;; no need to do it when not dumping. | |
| 89 (if (and purify-flag | |
| 90 (not (memq 'quick-build internal-error-checking))) | |
| 91 30000 3000000))) | |
| 1261 | 92 |
| 93 ;; really-early-error-handler outputs a stack trace so let's not do it | |
| 94 ;; twice. | |
| 95 (let ((stack-trace-on-error nil)) | |
| 428 | 96 |
| 97 ;; This is awfully damn early to be getting an error, right? | |
| 98 (call-with-condition-handler 'really-early-error-handler | |
| 99 #'(lambda () | |
| 1330 | 100 (setq load-path (list source-lisp)) |
| 3511 | 101 (setq module-load-path (list |
| 102 (expand-file-name "modules" build-directory))) | |
| 428 | 103 |
| 104 ;; message not defined yet ... | |
| 105 (external-debugging-output (format "\nUsing load-path %s" load-path)) | |
| 106 (external-debugging-output (format "\nUsing module-load-path %s" | |
| 107 module-load-path)) | |
| 108 | |
| 109 ;; We don't want to have any undo records in the dumped XEmacs. | |
| 110 (buffer-disable-undo (get-buffer "*scratch*")) | |
| 111 | |
| 112 ;; lread.c (or src/Makefile.in.in) has prepended | |
| 113 ;; "${srcdir}/../lisp/" to load-path, which is how this file | |
| 114 ;; has been found. At this point, enough of XEmacs has been | |
| 115 ;; initialized that we can start dumping "standard" lisp. | |
| 116 ;; Dumped lisp from external packages is added when we search | |
| 117 ;; the package path. | |
| 118 ;; #### This code is duplicated in two other places. | |
| 119 (let ((temp-path (expand-file-name "." (car load-path)))) | |
| 120 (setq load-path (nconc (mapcar | |
| 121 #'(lambda (i) (concat i "/")) | |
| 122 (directory-files temp-path t "^[^-.]" | |
| 123 nil 'dirs-only)) | |
| 124 (cons (file-name-as-directory temp-path) | |
| 125 load-path)))) | |
| 126 | |
| 1261 | 127 (setq load-warn-when-source-only t) ; Set to nil at the end |
| 428 | 128 |
| 129 ;; garbage collect after loading every file in an attempt to | |
| 130 ;; minimize the size of the dumped image (if we don't do this, | |
| 131 ;; there will be lots of extra space in the data segment filled | |
| 132 ;; with garbage-collected junk) | |
| 133 (defun pureload (file) | |
| 134 (let ((full-path | |
| 135 (locate-file file load-path | |
| 136 (if load-ignore-elc-files | |
| 137 '(".el" "") '(".elc" ".el" ""))))) | |
| 138 (if full-path | |
| 139 (prog1 | |
| 140 (load full-path) | |
| 442 | 141 ;; but garbage collection really slows down loading. |
| 142 (unless (memq 'quick-build internal-error-checking) | |
| 143 (garbage-collect))) | |
| 428 | 144 (external-debugging-output (format "\nLoad file %s: not found\n" |
| 145 file)) | |
| 146 ;; Uncomment in case of trouble | |
| 2456 | 147 ;;(print (format "late-package-hierarchies: %S" late-package-hierarchies)) |
| 1227 | 148 ;;(print (format "guessed-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-root-p))) |
| 149 ;;(print (format "guessed-data-roots: %S" (paths-find-emacs-roots invocation-directory invocation-name #'paths-emacs-data-root-p))) | |
| 428 | 150 nil))) |
| 151 | |
| 1330 | 152 (load (expand-file-name "dumped-lisp.el" source-lisp)) |
| 428 | 153 |
| 154 (let ((files preloaded-file-list) | |
| 155 file) | |
| 156 (while (setq file (car files)) | |
| 157 (unless (pureload file) | |
| 158 (external-debugging-output "Fatal error during load, aborting") | |
| 159 (kill-emacs 1)) | |
| 160 (setq files (cdr files))) | |
| 161 (when (not (featurep 'toolbar)) | |
| 162 ;; else still define a few functions. | |
| 163 (defun toolbar-button-p (obj) "No toolbar support." nil) | |
| 164 (defun toolbar-specifier-p (obj) "No toolbar support." nil)) | |
| 165 (fmakunbound 'pureload)) | |
| 166 | |
| 167 (packages-load-package-dumped-lisps late-package-load-path) | |
| 168 | |
| 169 )) ;; end of call-with-condition-handler | |
| 1261 | 170 |
| 171 ) ; (let ((stack-trace-on-error nil))) | |
| 428 | 172 |
| 173 ;; Fix up the preloaded file list | |
| 174 (setq preloaded-file-list (mapcar #'file-name-sans-extension | |
| 175 preloaded-file-list)) | |
| 176 | |
| 1261 | 177 (setq load-warn-when-source-only nil) |
| 428 | 178 |
| 179 (setq debugger 'debug) | |
| 180 | |
| 181 (when (member "no-site-file" command-line-args) | |
| 182 (setq site-start-file nil)) | |
| 183 | |
| 184 ;; If you want additional libraries to be preloaded and their | |
| 185 ;; doc strings kept in the DOC file rather than in core, | |
| 186 ;; you may load them with a "site-load.el" file. | |
| 187 ;; But you must also cause them to be scanned when the DOC file | |
| 1261 | 188 ;; is generated. For MS Windows, you must edit ../nt/xemacs.mak. |
| 189 ;; For other systems, you must edit ../src/Makefile.in.in. | |
| 428 | 190 (when (load "site-load" t) |
| 442 | 191 (garbage-collect) |
| 192 ) | |
| 428 | 193 |
| 194 ;;FSFmacs randomness | |
| 195 ;;(if (fboundp 'x-popup-menu) | |
| 196 ;; (precompute-menubar-bindings)) | |
| 197 ;;; Turn on recording of which commands get rebound, | |
| 198 ;;; for the sake of the next call to precompute-menubar-bindings. | |
| 199 ;(setq define-key-rebound-commands nil) | |
| 200 | |
| 201 ;; Note: all compiled Lisp files loaded above this point | |
| 202 ;; must be among the ones parsed by make-docfile | |
| 203 ;; to construct DOC. Any that are not processed | |
| 204 ;; for DOC will not have doc strings in the dumped XEmacs. | |
| 205 | |
| 206 ;; Don't bother with these if we're running temacs, i.e. if we're | |
| 207 ;; just debugging don't waste time finding doc strings. | |
| 208 | |
| 209 ;; purify-flag is nil if called from loadup-el.el. | |
| 210 (when purify-flag | |
| 211 (message "Finding pointers to doc strings...") | |
| 212 (Snarf-documentation "DOC") | |
| 213 (message "Finding pointers to doc strings...done") | |
| 214 (Verify-documentation)) | |
| 215 | |
| 216 ;; Note: You can cause additional libraries to be preloaded | |
| 217 ;; by writing a site-init.el that loads them. | |
| 218 ;; See also "site-load" above. | |
| 219 (when (stringp site-start-file) | |
| 220 (load "site-init" t)) | |
|
4915
bedf3747a6d7
Use DOC for dumped Lisp file names; Xref to source-lisp if readable, symbol-file
Aidan Kehoe <kehoea@parhasard.net>
parents:
4899
diff
changeset
|
221 |
|
bedf3747a6d7
Use DOC for dumped Lisp file names; Xref to source-lisp if readable, symbol-file
Aidan Kehoe <kehoea@parhasard.net>
parents:
4899
diff
changeset
|
222 ;; Add information from this file to the load history. Delete information |
|
5206
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
223 ;; that is available from DOC for those files in preloaded-file-list; in |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
224 ;; practice, this boils down to #'provide and #'require calls, and variables |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
225 ;; without documentation. Yes, this is a bit ugly. |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
226 (setq load-history (cons (nreverse current-load-list) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
227 (delete* |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
228 nil |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
229 (mapc #'(lambda (element) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
230 (remassq 'defun element) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
231 (delete-if |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
232 #'(lambda (elt) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
233 (and |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
234 (symbolp elt) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
235 (get elt 'variable-documentation))) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
236 element)) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
237 load-history) |
|
39d74978fd32
Keep around file info for dumped functions and variables without docstrings.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4915
diff
changeset
|
238 :key #'cdr)) |
|
4539
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
239 ;; Clear current-load-list; this (and adding information to |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
240 ;; load-history) is normally done in lread.c after reading the |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
241 ;; entirety of a file, something which never happens for loadup.el. |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
242 current-load-list nil) |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
243 ;; Make the path to this file look a little nicer: |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
244 (setcar (car load-history) (file-truename (caar load-history))) |
|
061e030e3270
Fix some bugs in load-history construction, built-in symbol file names.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
245 |
| 428 | 246 (garbage-collect) |
| 247 | |
| 248 ;;; At this point, we're ready to resume undo recording for scratch. | |
| 249 (buffer-enable-undo "*scratch*") | |
| 250 | |
| 1261 | 251 ) ;; (let ((gc-cons-threshold [frequent garbage collection when dumping]))) |
| 428 | 252 |
| 442 | 253 ;(stop-profiling) |
| 254 | |
| 428 | 255 ;; Dump into the name `xemacs' (only) |
| 256 (when (member "dump" command-line-args) | |
| 257 (message "Dumping under the name xemacs") | |
| 258 ;; This is handled earlier in the build process. | |
| 259 ;; (condition-case () (delete-file "xemacs") (file-error nil)) | |
| 260 (when (fboundp 'really-free) | |
| 261 (really-free)) | |
| 1261 | 262 ;; Make sure we don't dump with debugging messages turned on. |
| 263 (setq stack-trace-on-error nil | |
|
4841
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
264 load-always-display-messages nil |
|
3465c3161fea
when `debug', abort when lisp error during loadup
Ben Wing <ben@xemacs.org>
parents:
4539
diff
changeset
|
265 debug-on-error nil) |
| 462 | 266 (dump-emacs |
|
5228
5efbd1253905
Remove all support for InfoDock.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5206
diff
changeset
|
267 "xemacs" |
| 462 | 268 "temacs") |
| 428 | 269 (kill-emacs)) |
| 270 | |
| 271 ;; Avoid error if user loads some more libraries now. | |
| 272 (setq purify-flag nil) | |
| 273 | |
| 274 (when (member "run-temacs" command-line-args) | |
| 275 (message "\nBootstrapping from temacs...") | |
| 276 ;; Remove all args up to and including "run-temacs" | |
| 277 (apply #'run-emacs-from-temacs (cdr (member "run-temacs" command-line-args))) | |
| 278 ;; run-emacs-from-temacs doesn't actually return anyway. | |
| 279 (kill-emacs)) | |
| 280 | |
| 281 ;; XEmacs change | |
| 282 ;; If you are using 'recompile', then you should have used -l loadup-el.el | |
| 283 ;; so that the .el files always get loaded (the .elc files may be out-of- | |
| 284 ;; date or bad). | |
| 285 (when (member "recompile" command-line-args) | |
| 286 (setq command-line-args-left (cdr (member "recompile" command-line-args))) | |
| 287 (batch-byte-recompile-directory) | |
| 288 (kill-emacs)) | |
| 289 | |
| 290 ;; For machines with CANNOT_DUMP defined in config.h, | |
| 291 ;; this file must be loaded each time Emacs is run. | |
| 292 ;; So run the startup code now. | |
| 293 | |
| 294 (when (not (fboundp 'dump-emacs)) | |
| 295 ;; Avoid loading loadup.el a second time! | |
| 296 (setq command-line-args (cdr (cdr command-line-args))) | |
| 297 (eval top-level)) | |
| 298 | |
| 299 ;;; loadup.el ends here |
