Mercurial > hg > xemacs-beta
annotate lisp/update-elc.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 | 0d43872986b6 |
| children | ed5d4f081fa9 308d34e9f07d |
| rev | line source |
|---|---|
| 1303 | 1 ;;; update-elc.el --- Bytecompile out-of-date dumped files, pre-dumping |
| 428 | 2 |
| 3 ;; Copyright (C) 1997 Free Software Foundation, Inc. | |
| 442 | 4 ;; Copyright (C) 1996 Sun Microsystems, Inc. |
| 1261 | 5 ;; Copyright (C) 2001, 2003 Ben Wing. |
| 428 | 6 |
| 528 | 7 ;; Author: Ben Wing <ben@xemacs.org> |
| 8 ;; Based On: Original by Steven L Baur <steve@xemacs.org> | |
| 428 | 9 ;; Maintainer: XEmacs Development Team |
| 10 ;; Keywords: internal | |
| 11 | |
| 12 ;; This file is part of XEmacs. | |
| 13 | |
| 14 ;; XEmacs is free software; you can redistribute it and/or modify it | |
| 15 ;; under the terms of the GNU General Public License as published by | |
| 16 ;; the Free Software Foundation; either version 2, or (at your option) | |
| 17 ;; any later version. | |
| 18 | |
| 19 ;; XEmacs is distributed in the hope that it will be useful, but | |
| 20 ;; WITHOUT ANY WARRANTY; without even the implied warranty of | |
| 21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
| 22 ;; General Public License for more details. | |
| 23 | |
| 24 ;; You should have received a copy of the GNU General Public License | |
| 25 ;; along with XEmacs; see the file COPYING. If not, write to the | |
| 26 ;; Free Software Foundation, 59 Temple Place - Suite 330, | |
| 27 ;; Boston, MA 02111-1307, USA. | |
| 28 | |
| 29 ;;; Synched up with: Not in FSF. | |
| 30 | |
| 31 ;;; Commentary: | |
| 32 | |
| 33 ;; Byte compile the .EL files necessary to dump out xemacs. | |
| 1261 | 34 ;; Also update the auto-autoloads.el files. |
| 35 | |
| 428 | 36 ;; Use this file like this: |
| 37 | |
| 38 ;; temacs -batch -l ../lisp/update-elc.el $lisp | |
| 39 | |
| 40 ;; where $lisp comes from the Makefile. .elc files listed in $lisp will | |
| 41 ;; cause the corresponding .el file to be compiled. .el files listed in | |
| 42 ;; $lisp will be ignored. | |
| 43 | |
| 44 ;; (the idea here is that you can bootstrap if your .ELC files | |
| 45 ;; are missing or badly out-of-date) | |
| 46 | |
| 442 | 47 ;; See also update-elc-2.el |
| 428 | 48 |
| 49 ;;; Code: | |
| 50 | |
| 1261 | 51 ;; Help debug problems. |
| 52 (setq stack-trace-on-error t | |
| 53 load-always-display-messages t) | |
| 54 | |
| 428 | 55 (defvar processed nil) |
| 56 (defvar update-elc-files-to-compile nil) | |
| 528 | 57 (defvar need-to-rebuild-autoloads nil) |
| 58 (defvar need-to-rebuild-mule-autoloads nil) | |
| 59 (defvar need-to-recompile-autoloads nil) | |
| 60 (defvar need-to-recompile-mule-autoloads nil) | |
| 1330 | 61 (defvar exe-target nil) |
| 62 (defvar dump-target nil) | |
| 63 (defvar dump-target-out-of-date-wrt-dump-files nil) | |
| 64 ;(defvar dump-target-out-of-date-wrt-exe-target nil) | |
| 428 | 65 |
| 66 ;(setq update-elc-files-to-compile | |
| 67 ; (delq nil | |
| 68 ; (mapcar (function | |
| 69 ; (lambda (x) | |
| 70 ; (if (string-match "\.elc$" x) | |
| 71 ; (let ((src (substring x 0 -1))) | |
| 72 ; (if (file-newer-than-file-p src x) | |
| 73 ; (progn | |
| 74 ; (and (file-exists-p x) | |
| 75 ; (null (file-writable-p x)) | |
| 76 ; (set-file-modes x (logior (file-modes x) 128))) | |
| 77 ; src)))))) | |
| 78 ; ;; -batch gets filtered out. | |
| 79 ; (nthcdr 3 command-line-args)))) | |
| 80 | |
| 1330 | 81 |
| 3511 | 82 (defvar build-directory (expand-file-name ".." invocation-directory)) |
| 83 | |
| 1330 | 84 (defvar source-lisp (file-name-directory (expand-file-name |
| 3511 | 85 (nth 2 command-line-args)))) |
| 86 | |
| 1330 | 87 (defvar source-lisp-mule (expand-file-name "mule" source-lisp)) |
| 3511 | 88 (defvar source-directory (expand-file-name ".." source-lisp)) |
| 1330 | 89 (defvar aa-lisp (expand-file-name "auto-autoloads.el" source-lisp)) |
| 90 (defvar aac-lisp (expand-file-name "auto-autoloads.elc" source-lisp)) | |
| 91 (defvar aa-lisp-mule (expand-file-name "auto-autoloads.el" source-lisp-mule)) | |
| 92 (defvar aac-lisp-mule (expand-file-name "auto-autoloads.elc" source-lisp-mule)) | |
| 93 | |
| 94 (setq load-path (list source-lisp)) | |
| 428 | 95 |
| 96 (load "find-paths.el") | |
| 97 (load "packages.el") | |
| 98 (load "setup-paths.el") | |
| 1261 | 99 |
| 100 ;; Lisp files loaded in order to byte compile anything. If any are out of | |
| 101 ;; date, we need to load them as .el's, byte compile them, and reload as | |
| 102 ;; .elc's. | |
| 103 (defvar lisp-files-needed-for-byte-compilation | |
| 104 '("bytecomp" | |
| 105 "byte-optimize")) | |
| 106 | |
| 1263 | 107 ;; Lisp files not in `lisp-files-needed-for-byte-compilation' that need |
| 108 ;; early byte compilation. These are files loaded by update-elc.el in | |
| 109 ;; order to do the compilation of all the rest of the files. | |
| 1261 | 110 (defvar lisp-files-needing-early-byte-compilation |
| 2548 | 111 '("easy-mmode" |
| 1261 | 112 "autoload" |
| 113 "shadow" | |
| 114 "cl-macs")) | |
| 115 | |
| 116 (defvar unbytecompiled-lisp-files | |
| 117 '("paths.el" | |
| 118 "dumped-lisp.el" | |
| 119 "dumped-pkg-lisp.el" | |
| 4246 | 120 "raw-process.el") |
| 2367 | 121 "Lisp files that should not be byte compiled. |
| 122 Files in `additional-dump-dependencies' do not need to be listed here.") | |
| 123 | |
| 124 (defvar additional-dump-dependencies | |
|
4690
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
125 (nconc '("loadup.el" |
|
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
126 "loadup-el.el" |
|
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
127 "update-elc.el") |
|
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
128 (if (featurep 'mule) |
|
257b468bf2ca
Move the #'query-coding-region implementation to C.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4246
diff
changeset
|
129 '("mule/make-coding-system"))) |
| 2367 | 130 "Lisp files that are not dumped but which the dump depends on. |
| 131 If any of these files are changed, we need to redump.") | |
| 428 | 132 |
| 1298 | 133 (defvar lisp-files-ignored-when-checking-for-autoload-updating |
| 134 '("custom-load.el" | |
| 135 "auto-autoloads.el") | |
| 136 "Lisp files that should not trigger auto-autoloads rebuilding.") | |
| 137 | |
| 528 | 138 (defun update-elc-chop-extension (file) |
| 139 (if (string-match "\\.elc?$" file) | |
|
5089
99f8ebc082d9
Make #'substring an alias of #'subseq; give the latter the byte code.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4995
diff
changeset
|
140 (subseq file 0 (match-beginning 0)) |
| 528 | 141 file)) |
| 428 | 142 |
| 528 | 143 ;; we used to call packages-list-autoloads here, but it's false generality. |
| 144 ;; we need to handle each autoload file differently and there are only | |
| 145 ;; two of them. | |
| 428 | 146 |
| 1261 | 147 (let (preloaded-file-list site-load-packages files-to-process) |
| 528 | 148 |
| 1330 | 149 (load (expand-file-name "dumped-lisp.el" source-lisp)) |
| 442 | 150 |
| 1330 | 151 ;; two setups here: |
| 152 ;; (1) temacs.exe is undumped, dumped into xemacs.exe. Happens with | |
| 153 ;; unexec, but also with pdump under MS Windows native, since | |
| 154 ;; the dumped data is stored as a resource in the xemacs.exe | |
| 155 ;; executable. | |
| 156 ;; (2) xemacs.exe is dumped or undumped. Running `xemacs -nd' gets | |
| 157 ;; you the equivalent of `temacs'. Dumping creates a file | |
| 158 ;; `xemacs.dmp'. | |
| 1261 | 159 |
| 1330 | 160 (cond ((eq system-type 'windows-nt) |
| 161 (setq exe-target "src/temacs.exe" | |
| 162 dump-target "src/xemacs.exe")) | |
| 163 ;; #### need better ways of getting config params | |
| 164 ((not (memq 'pdump (emacs-run-status))) | |
| 165 (setq exe-target "src/temacs" | |
| 166 dump-target "src/xemacs")) | |
| 167 (t | |
| 168 (setq exe-target "src/xemacs" | |
| 169 dump-target "src/xemacs.dmp"))) | |
| 1261 | 170 |
| 3511 | 171 (setq exe-target (expand-file-name exe-target build-directory)) |
| 172 (setq dump-target (expand-file-name dump-target build-directory)) | |
| 1330 | 173 |
| 174 ;; Not currently used. | |
| 175 ; (setq dump-target-out-of-date-wrt-exe-target | |
| 176 ; (cond ((not dump-target) t) | |
| 177 ; (temacs-exe (file-newer-than-file-p temacs-exe dump-target)) | |
| 178 ; ((not data-file) t) | |
| 179 ; (t (file-newer-than-file-p dump-target data-file)))) | |
| 180 ; (setq dump-target-exists (or (and temacs-exe dump-target) | |
| 181 ; (and data-file dump-target)))) | |
| 1261 | 182 |
| 428 | 183 ;; Path setup |
| 184 (let ((package-preloaded-file-list | |
| 185 (packages-collect-package-dumped-lisps late-package-load-path))) | |
| 186 | |
| 187 (setq preloaded-file-list | |
| 188 (append package-preloaded-file-list | |
| 189 preloaded-file-list | |
| 190 packages-hardcoded-lisp))) | |
| 191 | |
| 3511 | 192 (load (expand-file-name "site-packages" source-directory) t t) |
| 428 | 193 (setq preloaded-file-list |
| 194 (append packages-hardcoded-lisp | |
| 195 preloaded-file-list | |
| 196 site-load-packages)) | |
| 1261 | 197 ;; bytecomp, byte-optimize, autoload, etc. are mentioned specially |
| 198 ;; in the lisp-files-need* variables. | |
| 199 (setq files-to-process (append lisp-files-needed-for-byte-compilation | |
| 200 lisp-files-needing-early-byte-compilation | |
| 2367 | 201 additional-dump-dependencies |
| 1261 | 202 preloaded-file-list)) |
| 528 | 203 (while files-to-process |
| 204 (let* ((arg (car files-to-process)) | |
| 2367 | 205 (arg-is-dump-dependency |
| 206 (or (member arg preloaded-file-list) | |
| 207 (member arg additional-dump-dependencies))) | |
| 528 | 208 (arg-sans-extension (update-elc-chop-extension arg)) |
| 209 (full-arg (locate-library arg-sans-extension)) | |
| 210 (full-arg-sans-extension | |
| 211 (if (null full-arg) | |
| 212 (progn | |
| 213 (print (format "Error: Library file %s not found" arg)) | |
| 1261 | 214 (backtrace) |
| 528 | 215 ;; Uncomment in case of trouble |
| 2456 | 216 ;;(print (format "late-package-hierarchies: %S" late-package-hierarchies)) |
| 528 | 217 ;;(print (format "guessed-roots: %S" |
| 218 ;; (paths-find-emacs-roots | |
| 219 ;; invocation-directory invocation-name))) | |
| 220 (kill-emacs)) | |
| 221 (update-elc-chop-extension full-arg))) | |
| 222 (full-arg-el (concat full-arg-sans-extension ".el")) | |
| 223 (full-arg-elc (concat full-arg-sans-extension ".elc")) | |
| 1261 | 224 (full-arg-dir (file-name-directory full-arg-el))) |
| 528 | 225 |
| 2367 | 226 ; (print full-arg-el) |
| 442 | 227 |
| 228 ;; now check if .el or .elc is newer than the dumped exe. | |
| 229 ;; if so, need to redump. | |
| 2367 | 230 (when (and dump-target arg-is-dump-dependency |
| 1298 | 231 ;; no need to check for existence of either of the files |
| 232 ;; because of the definition of file-newer-than-file-p. | |
| 1330 | 233 (or (file-newer-than-file-p full-arg-el dump-target) |
| 234 (file-newer-than-file-p full-arg-elc dump-target))) | |
| 235 (setq dump-target-out-of-date-wrt-dump-files t)) | |
| 528 | 236 |
| 237 (if (and (not (member (file-name-nondirectory arg) | |
| 1261 | 238 unbytecompiled-lisp-files)) |
| 2367 | 239 (not (member (file-name-nondirectory arg) |
| 240 additional-dump-dependencies)) | |
| 528 | 241 (not (member full-arg-el processed)) |
| 1298 | 242 ;; no need to check for existence of either of the files |
| 243 ;; because of the definition of file-newer-than-file-p. | |
| 244 (file-newer-than-file-p full-arg-el full-arg-elc)) | |
| 528 | 245 (setq processed (cons full-arg-el processed))) |
| 246 | |
| 247 (setq files-to-process (cdr files-to-process)))) | |
| 442 | 248 |
| 1261 | 249 ;; Check if we need to rebuild the auto-autoloads.el files -- that is, |
| 250 ;; if ANY .el files have changed. | |
| 1330 | 251 (let ((dirs-to-check (list source-lisp source-lisp-mule))) |
| 1261 | 252 (while dirs-to-check |
| 253 (let* ((dir (car dirs-to-check)) | |
| 254 (full-dir (expand-file-name dir)) | |
| 255 (all-files-in-dir (directory-files full-dir t "\\.el$" nil t)) | |
| 256 (autoload-file | |
| 257 (expand-file-name "auto-autoloads.el" full-dir)) | |
| 1330 | 258 (autoload-is-mule (equal dir source-lisp-mule))) |
| 1261 | 259 (while all-files-in-dir |
| 260 (let* ((full-arg (car all-files-in-dir))) | |
| 1298 | 261 ;; custom-load.el always gets regenerated so don't let that |
| 262 ;; trigger us. | |
| 263 (when (and (not | |
| 264 (member | |
| 265 (file-name-nondirectory full-arg) | |
| 266 lisp-files-ignored-when-checking-for-autoload-updating | |
| 267 )) | |
| 268 (file-newer-than-file-p full-arg autoload-file)) | |
| 1261 | 269 (if autoload-is-mule |
| 270 (setq need-to-rebuild-mule-autoloads t) | |
| 271 (setq need-to-rebuild-autoloads t)))) | |
| 272 (setq all-files-in-dir (cdr all-files-in-dir)))) | |
| 273 (setq dirs-to-check (cdr dirs-to-check)))) | |
| 274 | |
| 1330 | 275 (if dump-target-out-of-date-wrt-dump-files |
| 442 | 276 (condition-case nil |
| 1330 | 277 (write-region-internal |
| 3511 | 278 "foo" nil (expand-file-name "src/NEEDTODUMP" build-directory)) |
| 442 | 279 (file-error nil))) |
| 280 | |
| 281 ) | |
| 428 | 282 |
| 528 | 283 (when (or need-to-rebuild-autoloads |
| 1298 | 284 ;; no real need for the following check either, because if the file |
| 285 ;; doesn't exist, need-to-rebuild-autoloads gets set above. but | |
| 286 ;; it's only one call, so it won't slow things down much and it keeps | |
| 287 ;; the logic cleaner. | |
| 1330 | 288 (not (file-exists-p aa-lisp)) |
| 1298 | 289 ;; no need to check for file-exists of .elc due to definition |
| 290 ;; of file-newer-than-file-p | |
| 1330 | 291 (file-newer-than-file-p aa-lisp aac-lisp)) |
| 528 | 292 (setq need-to-recompile-autoloads t)) |
| 293 | |
| 294 (when (or need-to-rebuild-mule-autoloads | |
| 1298 | 295 ;; not necessary but ... see comment above. |
| 1330 | 296 (not (file-exists-p aa-lisp-mule)) |
| 1298 | 297 ;; no need to check for file-exists of .elc due to definition |
| 298 ;; of file-newer-than-file-p | |
| 1330 | 299 (file-newer-than-file-p aa-lisp-mule aac-lisp-mule)) |
| 528 | 300 (setq need-to-recompile-mule-autoloads t)) |
| 301 | |
| 302 (when (not (featurep 'mule)) | |
| 303 ;; sorry charlie. | |
| 304 (setq need-to-rebuild-mule-autoloads nil | |
| 305 need-to-recompile-mule-autoloads nil)) | |
| 306 | |
| 428 | 307 (setq update-elc-files-to-compile (append update-elc-files-to-compile |
| 622 | 308 (nreverse processed))) |
| 428 | 309 |
| 1261 | 310 ;(print update-elc-files-to-compile) |
| 428 | 311 |
| 1261 | 312 (let ((do-autoload-commands |
| 313 (append | |
| 314 (if (or need-to-rebuild-autoloads | |
| 315 need-to-rebuild-mule-autoloads) | |
| 1330 | 316 (list "-l" "autoload")) |
| 1261 | 317 (if need-to-rebuild-autoloads |
| 2548 | 318 (list "-f" "batch-update-directory-autoloads" |
| 1330 | 319 "auto" source-lisp)) |
| 1261 | 320 (if need-to-rebuild-mule-autoloads |
| 2548 | 321 (list "-f" "batch-update-directory-autoloads" |
| 1330 | 322 "mule" source-lisp-mule)) |
| 1261 | 323 (if need-to-recompile-autoloads |
| 1330 | 324 (list "-f" "batch-byte-compile-one-file" |
| 325 aa-lisp)) | |
| 1261 | 326 (if need-to-recompile-mule-autoloads |
| 1330 | 327 (list "-f" "batch-byte-compile-one-file" |
| 328 aa-lisp-mule))))) | |
| 1298 | 329 (condition-case nil |
| 3511 | 330 (delete-file (expand-file-name "src/REBUILD_AUTOLOADS" build-directory)) |
| 1298 | 331 (file-error nil)) |
| 1261 | 332 (cond ((and (not update-elc-files-to-compile) |
| 333 (not need-to-rebuild-autoloads) | |
| 334 (not need-to-rebuild-mule-autoloads) | |
| 335 (not need-to-recompile-autoloads) | |
| 336 (not need-to-recompile-mule-autoloads)) | |
| 1315 | 337 ;; (1) Nothing to do at all. |
| 338 ) | |
| 1298 | 339 ((not update-elc-files-to-compile) |
| 1261 | 340 ;; (2) We have no files to byte-compile, but we do need to |
| 1298 | 341 ;; regenerate and compile the auto-autoloads file, so signal |
| 342 ;; update-elc-2 to do it. This is much faster than loading | |
| 343 ;; all the .el's and doing it here. (We only need to rebuild | |
| 344 ;; the autoloads here when we have files to compile, since | |
| 345 ;; they may depend on the updated autoloads.) | |
| 346 (condition-case nil | |
| 1330 | 347 (write-region-internal |
| 3511 | 348 "foo" nil (expand-file-name "src/REBUILD_AUTOLOADS" build-directory)) |
| 1298 | 349 (file-error nil)) |
| 1315 | 350 ) |
| 1261 | 351 (t |
| 352 (let ((bc-bootstrap | |
| 353 (mapcar #'(lambda (arg) | |
| 354 (concat (update-elc-chop-extension | |
| 355 (locate-library arg)) ".el")) | |
| 356 lisp-files-needed-for-byte-compilation)) | |
| 357 (bootstrap-other | |
| 358 (mapcar #'(lambda (arg) | |
| 359 (concat (update-elc-chop-extension | |
| 360 (locate-library arg)) ".el")) | |
| 361 lisp-files-needing-early-byte-compilation))) | |
| 362 (setq inhibit-autoloads t) | |
| 528 | 363 ;; if bytecomp or byte-optimize need recompiling, then load |
| 364 ;; the .el version of them first, recompile them, and reload | |
| 365 ;; the .elc versions to recompile everything else (so we won't | |
| 366 ;; be waiting until the cows come home). we need to set | |
| 367 ;; load-ignore-elc-files because byte-optimize gets autoloaded | |
| 368 ;; from bytecomp. | |
| 1261 | 369 (let ((recompile-bc-bootstrap |
|
5264
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
370 (mapcan |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
371 #'(lambda (arg) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
372 (when (member arg update-elc-files-to-compile) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
373 (append '("-f" "batch-byte-compile-one-file") |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
374 (list arg)))) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
375 bc-bootstrap)) |
| 1261 | 376 (recompile-bootstrap-other |
|
5264
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
377 (mapcan |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
378 #'(lambda (arg) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
379 (when (member arg update-elc-files-to-compile) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
380 (append '("-f" "batch-byte-compile-one-file") |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
381 (list arg)))) |
|
0d43872986b6
Change (apply 'nconc (mapcar ...)) to (mapcan ...); warn about first form.
Aidan Kehoe <kehoea@parhasard.net>
parents:
5089
diff
changeset
|
382 bootstrap-other))) |
|
4995
8431b52e43b1
Move the various map* functions to C; add #'map-into.
Aidan Kehoe <kehoea@parhasard.net>
parents:
4690
diff
changeset
|
383 (mapc |
| 1261 | 384 #'(lambda (arg) |
| 385 (setq update-elc-files-to-compile | |
| 386 (delete arg update-elc-files-to-compile))) | |
| 387 (append bc-bootstrap bootstrap-other)) | |
| 388 (setq command-line-args | |
| 389 (append | |
| 390 '("-l" "loadup-el.el" "run-temacs" | |
| 391 "-batch" "-no-packages" "-no-autoloads" | |
| 392 "-eval" "(setq stack-trace-on-error t)" | |
| 393 "-eval" "(setq load-always-display-messages t)") | |
| 394 (when recompile-bc-bootstrap | |
| 395 (append | |
| 396 '("-eval" "(setq load-ignore-elc-files t)" | |
| 397 "-l" "bytecomp") | |
| 398 recompile-bc-bootstrap | |
| 399 '("-eval" "(setq load-ignore-elc-files nil)"))) | |
| 400 '("-l" "bytecomp") | |
| 401 ;; likewise, recompile autoload.el etc. if out-of-date. | |
| 402 recompile-bootstrap-other | |
| 403 ;; then generate autoloads for lisp and maybe lisp/mule. | |
| 404 do-autoload-commands | |
| 405 ;; now load the autoloads and compile alles anderes. | |
| 406 '("-eval" "(setq inhibit-autoloads nil)" | |
| 407 "-f" "startup-load-autoloads" | |
| 408 "-f" "batch-byte-compile") | |
| 409 update-elc-files-to-compile | |
| 410 )))) | |
| 411 | |
| 412 ;;(print command-line-args) | |
| 413 (load "loadup-el.el")))) | |
| 428 | 414 |
| 1303 | 415 (kill-emacs) |
| 428 | 416 |
| 417 ;;; update-elc.el ends here |
