diff options
| author | Richard M. Stallman | 1995-04-30 07:45:45 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1995-04-30 07:45:45 +0000 |
| commit | aba66e2a44fd33756a59ba0b4806b62a4da43c7c (patch) | |
| tree | cfa335903ff1c4d2047424adfc98dda6a7108abe | |
| parent | dca8521c5a2c0c6a41c7aae5744254cc94599af0 (diff) | |
| download | emacs-aba66e2a44fd33756a59ba0b4806b62a4da43c7c.tar.gz emacs-aba66e2a44fd33756a59ba0b4806b62a4da43c7c.zip | |
(command-line-1): Implement -L/--directory option.
| -rw-r--r-- | lisp/startup.el | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/lisp/startup.el b/lisp/startup.el index 70a9427341b..e059ff0fc0d 100644 --- a/lisp/startup.el +++ b/lisp/startup.el | |||
| @@ -23,7 +23,12 @@ | |||
| 23 | 23 | ||
| 24 | ;;; Commentary: | 24 | ;;; Commentary: |
| 25 | 25 | ||
| 26 | ; These are processed only at the beginning of the argument list. | 26 | ;; This is a list of options processed in this file. |
| 27 | ;; There are also -- forms, but they aren't listed here. | ||
| 28 | ;; There are also options for X windows, not listed here; | ||
| 29 | ;; see term/x-win.el. | ||
| 30 | |||
| 31 | ; These options are processed first, no matter where they appear. | ||
| 27 | ; -batch execute noninteractively (messages go to stdout, | 32 | ; -batch execute noninteractively (messages go to stdout, |
| 28 | ; variable noninteractive set to t) | 33 | ; variable noninteractive set to t) |
| 29 | ; This option must be the first in the arglist. | 34 | ; This option must be the first in the arglist. |
| @@ -51,7 +56,10 @@ | |||
| 51 | ; -l file load file | 56 | ; -l file load file |
| 52 | ; -load file same | 57 | ; -load file same |
| 53 | ; -insert file insert file into buffer | 58 | ; -insert file insert file into buffer |
| 59 | ; -L dir add dir to load-path | ||
| 54 | ; file visit file | 60 | ; file visit file |
| 61 | |||
| 62 | ; This is always processed last, no matter where it appears. | ||
| 55 | ; -kill kill (exit) emacs | 63 | ; -kill kill (exit) emacs |
| 56 | 64 | ||
| 57 | ;;; Code: | 65 | ;;; Code: |
| @@ -601,11 +609,16 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 601 | ;; This includes our standard options' long versions | 609 | ;; This includes our standard options' long versions |
| 602 | ;; and long versions of what's on command-switch-alist. | 610 | ;; and long versions of what's on command-switch-alist. |
| 603 | (longopts | 611 | (longopts |
| 604 | (append '(("--funcall") ("--load") ("--insert") ("--kill")) | 612 | (append '(("--funcall") ("--load") ("--insert") ("--kill") |
| 613 | ("--directory")) | ||
| 605 | (mapcar '(lambda (elt) | 614 | (mapcar '(lambda (elt) |
| 606 | (list (concat "-" (car elt)))) | 615 | (list (concat "-" (car elt)))) |
| 607 | command-switch-alist))) | 616 | command-switch-alist))) |
| 608 | tem argval completion) | 617 | tem argval completion |
| 618 | ;; List of directories specified in -L/--directory, | ||
| 619 | ;; in reverse of the order specified. | ||
| 620 | extra-load-path | ||
| 621 | (initial-load-path load-path)) | ||
| 609 | (setq command-line-args-left (cdr command-line-args-left)) | 622 | (setq command-line-args-left (cdr command-line-args-left)) |
| 610 | 623 | ||
| 611 | ;; Convert long options to ordinary options | 624 | ;; Convert long options to ordinary options |
| @@ -640,6 +653,17 @@ Type \\[describe-distribution] for information on getting the latest version.")) | |||
| 640 | (if (arrayp (symbol-function tem)) | 653 | (if (arrayp (symbol-function tem)) |
| 641 | (command-execute tem) | 654 | (command-execute tem) |
| 642 | (funcall tem))) | 655 | (funcall tem))) |
| 656 | ;; Set the default directory as specified in -L. | ||
| 657 | ((or (string-equal argi "-L") | ||
| 658 | (string-equal argi "-directory")) | ||
| 659 | (if argval | ||
| 660 | (setq tem argval) | ||
| 661 | (setq tem (car command-line-args-left) | ||
| 662 | command-line-args-left (cdr command-line-args-left))) | ||
| 663 | (setq extra-load-path | ||
| 664 | (cons (expand-file-name tem) extra-load-path)) | ||
| 665 | (setq load-path (append (nreverse extra-load-path) | ||
| 666 | initial-load-path))) | ||
| 643 | ((or (string-equal argi "-l") | 667 | ((or (string-equal argi "-l") |
| 644 | (string-equal argi "-load")) | 668 | (string-equal argi "-load")) |
| 645 | (if argval | 669 | (if argval |