diff options
| author | Glenn Morris | 2014-05-30 19:50:09 -0400 |
|---|---|---|
| committer | Glenn Morris | 2014-05-30 19:50:09 -0400 |
| commit | 6423ce2657d453af88a5501f589f4e8fc6ce1946 (patch) | |
| tree | 033818bf74564d472cf40b787ef7b9a48140fd5a | |
| parent | 9155e80d790aa289f0613ebb3e6d6ba647127bc9 (diff) | |
| download | emacs-6423ce2657d453af88a5501f589f4e8fc6ce1946.tar.gz emacs-6423ce2657d453af88a5501f589f4e8fc6ce1946.zip | |
* lisp/loadup.el: Treat `command-line-args' more flexibly.
This makes it easier to add --eval ... etc to the command-line without
messing things up due to changed argument numbers.
| -rw-r--r-- | lisp/ChangeLog | 4 | ||||
| -rw-r--r-- | lisp/loadup.el | 31 |
2 files changed, 16 insertions, 19 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9e1ccb26270..b5e8b1dfa63 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2014-05-30 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * loadup.el: Treat `command-line-args' more flexibly. | ||
| 4 | |||
| 1 | 2014-05-30 Alan Mackenzie <acm@muc.de> | 5 | 2014-05-30 Alan Mackenzie <acm@muc.de> |
| 2 | 6 | ||
| 3 | Guard (looking-at "\\s!") from XEmacs. | 7 | Guard (looking-at "\\s!") from XEmacs. |
diff --git a/lisp/loadup.el b/lisp/loadup.el index c3ed67fb008..89fcaa30b0c 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -1,7 +1,7 @@ | |||
| 1 | ;;; loadup.el --- load up standardly loaded Lisp files for Emacs | 1 | ;;; loadup.el --- load up standardly loaded Lisp files for Emacs |
| 2 | 2 | ||
| 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 2001-2014 Free Software | 3 | ;; Copyright (C) 1985-1986, 1992, 1994, 2001-2014 |
| 4 | ;; Foundation, Inc. | 4 | ;; Free Software Foundation, Inc. |
| 5 | 5 | ||
| 6 | ;; Maintainer: emacs-devel@gnu.org | 6 | ;; Maintainer: emacs-devel@gnu.org |
| 7 | ;; Keywords: internal | 7 | ;; Keywords: internal |
| @@ -46,8 +46,7 @@ | |||
| 46 | ;; Add subdirectories to the load-path for files that might get | 46 | ;; Add subdirectories to the load-path for files that might get |
| 47 | ;; autoloaded when bootstrapping. | 47 | ;; autoloaded when bootstrapping. |
| 48 | ;; This is because PATH_DUMPLOADSEARCH is just "../lisp". | 48 | ;; This is because PATH_DUMPLOADSEARCH is just "../lisp". |
| 49 | (if (or (equal (nth 3 command-line-args) "bootstrap") | 49 | (if (or (equal (member "bootstrap" command-line-args) '("bootstrap")) |
| 50 | (equal (nth 4 command-line-args) "bootstrap") | ||
| 51 | ;; FIXME this is irritatingly fragile. | 50 | ;; FIXME this is irritatingly fragile. |
| 52 | (equal (nth 4 command-line-args) "unidata-gen.el") | 51 | (equal (nth 4 command-line-args) "unidata-gen.el") |
| 53 | (equal (nth 7 command-line-args) "unidata-gen-files") | 52 | (equal (nth 7 command-line-args) "unidata-gen-files") |
| @@ -70,8 +69,9 @@ | |||
| 70 | 69 | ||
| 71 | (message "Using load-path %s" load-path) | 70 | (message "Using load-path %s" load-path) |
| 72 | 71 | ||
| 73 | (if (or (member (nth 3 command-line-args) '("dump" "bootstrap")) | 72 | ;; This is a poor man's `last', since we haven't loaded subr.el yet. |
| 74 | (member (nth 4 command-line-args) '("dump" "bootstrap"))) | 73 | (if (or (equal (member "bootstrap" command-line-args) '("bootstrap")) |
| 74 | (equal (member "dump" command-line-args) '("dump"))) | ||
| 75 | ;; To reduce the size of dumped Emacs, we avoid making huge | 75 | ;; To reduce the size of dumped Emacs, we avoid making huge |
| 76 | ;; char-tables. | 76 | ;; char-tables. |
| 77 | (setq inhibit-load-charset-map t)) | 77 | (setq inhibit-load-charset-map t)) |
| @@ -306,17 +306,13 @@ lost after dumping"))) | |||
| 306 | ;; file primitive. So the only workable solution to support building | 306 | ;; file primitive. So the only workable solution to support building |
| 307 | ;; in non-ASCII directories is to manipulate unibyte strings in the | 307 | ;; in non-ASCII directories is to manipulate unibyte strings in the |
| 308 | ;; current locale's encoding. | 308 | ;; current locale's encoding. |
| 309 | (if (and (or (equal (nth 3 command-line-args) "dump") | 309 | (if (and (member (car (last command-line-args)) '("dump" "bootstrap")) |
| 310 | (equal (nth 4 command-line-args) "dump") | ||
| 311 | (equal (nth 3 command-line-args) "bootstrap") | ||
| 312 | (equal (nth 4 command-line-args) "bootstrap")) | ||
| 313 | (multibyte-string-p default-directory)) | 310 | (multibyte-string-p default-directory)) |
| 314 | (error "default-directory must be unibyte when dumping Emacs!")) | 311 | (error "default-directory must be unibyte when dumping Emacs!")) |
| 315 | 312 | ||
| 316 | ;; Determine which last version number to use | 313 | ;; Determine which last version number to use |
| 317 | ;; based on the executables that now exist. | 314 | ;; based on the executables that now exist. |
| 318 | (if (and (or (equal (nth 3 command-line-args) "dump") | 315 | (if (and (equal (last command-line-args) '("dump")) |
| 319 | (equal (nth 4 command-line-args) "dump")) | ||
| 320 | (not (eq system-type 'ms-dos))) | 316 | (not (eq system-type 'ms-dos))) |
| 321 | (let* ((base (concat "emacs-" emacs-version ".")) | 317 | (let* ((base (concat "emacs-" emacs-version ".")) |
| 322 | (exelen (if (eq system-type 'windows-nt) -4)) | 318 | (exelen (if (eq system-type 'windows-nt) -4)) |
| @@ -335,8 +331,7 @@ lost after dumping"))) | |||
| 335 | 331 | ||
| 336 | 332 | ||
| 337 | (message "Finding pointers to doc strings...") | 333 | (message "Finding pointers to doc strings...") |
| 338 | (if (or (equal (nth 3 command-line-args) "dump") | 334 | (if (equal (last command-line-args) '("dump")) |
| 339 | (equal (nth 4 command-line-args) "dump")) | ||
| 340 | (Snarf-documentation "DOC") | 335 | (Snarf-documentation "DOC") |
| 341 | (condition-case nil | 336 | (condition-case nil |
| 342 | (Snarf-documentation "DOC") | 337 | (Snarf-documentation "DOC") |
| @@ -394,8 +389,7 @@ lost after dumping"))) | |||
| 394 | (if (null (garbage-collect)) | 389 | (if (null (garbage-collect)) |
| 395 | (setq pure-space-overflow t)) | 390 | (setq pure-space-overflow t)) |
| 396 | 391 | ||
| 397 | (if (or (member (nth 3 command-line-args) '("dump" "bootstrap")) | 392 | (if (member (car (last command-line-args)) '("dump" "bootstrap")) |
| 398 | (member (nth 4 command-line-args) '("dump" "bootstrap"))) | ||
| 399 | (progn | 393 | (progn |
| 400 | (message "Dumping under the name emacs") | 394 | (message "Dumping under the name emacs") |
| 401 | (condition-case () | 395 | (condition-case () |
| @@ -411,8 +405,7 @@ lost after dumping"))) | |||
| 411 | (if (not (or (eq system-type 'ms-dos) | 405 | (if (not (or (eq system-type 'ms-dos) |
| 412 | ;; Don't bother adding another name if we're just | 406 | ;; Don't bother adding another name if we're just |
| 413 | ;; building bootstrap-emacs. | 407 | ;; building bootstrap-emacs. |
| 414 | (equal (nth 3 command-line-args) "bootstrap") | 408 | (equal (last command-line-args) '("bootstrap")))) |
| 415 | (equal (nth 4 command-line-args) "bootstrap"))) | ||
| 416 | (let ((name (concat "emacs-" emacs-version)) | 409 | (let ((name (concat "emacs-" emacs-version)) |
| 417 | (exe (if (eq system-type 'windows-nt) ".exe" ""))) | 410 | (exe (if (eq system-type 'windows-nt) ".exe" ""))) |
| 418 | (while (string-match "[^-+_.a-zA-Z0-9]+" name) | 411 | (while (string-match "[^-+_.a-zA-Z0-9]+" name) |
| @@ -433,7 +426,7 @@ lost after dumping"))) | |||
| 433 | ;; this file must be loaded each time Emacs is run. | 426 | ;; this file must be loaded each time Emacs is run. |
| 434 | ;; So run the startup code now. First, remove `-l loadup' from args. | 427 | ;; So run the startup code now. First, remove `-l loadup' from args. |
| 435 | 428 | ||
| 436 | (if (and (equal (nth 1 command-line-args) "-l") | 429 | (if (and (member (nth 1 command-line-args) '("-l" "--load")) |
| 437 | (equal (nth 2 command-line-args) "loadup")) | 430 | (equal (nth 2 command-line-args) "loadup")) |
| 438 | (setcdr command-line-args (nthcdr 3 command-line-args))) | 431 | (setcdr command-line-args (nthcdr 3 command-line-args))) |
| 439 | 432 | ||