1479 |
(file-count 0) |
(file-count 0) |
1480 |
first-file-buffer |
first-file-buffer |
1481 |
tem |
tem |
1482 |
;; The directories listed in --directory/-L options will *appear* |
;; This approach loses for "-batch -L DIR --eval "(require foo)", |
1483 |
;; at the front of `load-path' in the order they appear on the |
;; if foo is intended to be found in DIR. |
1484 |
;; command-line. We cannot do this by *placing* them at the front |
;; |
1485 |
;; in the order they appear, so we need this variable to hold them, |
;; ;; The directories listed in --directory/-L options will *appear* |
1486 |
;; temporarily. |
;; ;; at the front of `load-path' in the order they appear on the |
1487 |
extra-load-path |
;; ;; command-line. We cannot do this by *placing* them at the front |
1488 |
|
;; ;; in the order they appear, so we need this variable to hold them, |
1489 |
|
;; ;; temporarily. |
1490 |
|
;; extra-load-path |
1491 |
|
;; |
1492 |
|
;; To DTRT we keep track of the splice point and modify `load-path' |
1493 |
|
;; straight away upon any --directory/-L option. |
1494 |
|
splice |
1495 |
just-files ;; t if this follows the magic -- option. |
just-files ;; t if this follows the magic -- option. |
1496 |
;; This includes our standard options' long versions |
;; This includes our standard options' long versions |
1497 |
;; and long versions of what's on command-switch-alist. |
;; and long versions of what's on command-switch-alist. |
1560 |
|
|
1561 |
((member argi '("-eval" "-execute")) |
((member argi '("-eval" "-execute")) |
1562 |
(eval (read (or argval (pop command-line-args-left))))) |
(eval (read (or argval (pop command-line-args-left))))) |
|
;; Set the default directory as specified in -L. |
|
1563 |
|
|
1564 |
((member argi '("-L" "-directory")) |
((member argi '("-L" "-directory")) |
1565 |
(setq tem (or argval (pop command-line-args-left))) |
(setq tem (expand-file-name |
1566 |
;; We will reverse `extra-load-path' and prepend it to |
(command-line-normalize-file-name |
1567 |
;; `load-path' after all the arguments have been processed. |
(or argval (pop command-line-args-left))))) |
1568 |
(push |
(cond (splice (setcdr splice (cons tem (cdr splice))) |
1569 |
(expand-file-name (command-line-normalize-file-name tem)) |
(setq splice (cdr splice))) |
1570 |
extra-load-path)) |
(t (setq load-path (cons tem load-path) |
1571 |
|
splice load-path)))) |
1572 |
|
|
1573 |
((member argi '("-l" "-load")) |
((member argi '("-l" "-load")) |
1574 |
(let* ((file (command-line-normalize-file-name |
(let* ((file (command-line-normalize-file-name |
1649 |
(move-to-column (1- column))) |
(move-to-column (1- column))) |
1650 |
(setq column 0)))))))) |
(setq column 0)))))))) |
1651 |
|
|
|
;; See --directory/-L option above. |
|
|
(when extra-load-path |
|
|
(setq load-path (append (nreverse extra-load-path) load-path))) |
|
|
|
|
1652 |
;; If 3 or more files visited, and not all visible, |
;; If 3 or more files visited, and not all visible, |
1653 |
;; show user what they all are. But leave the last one current. |
;; show user what they all are. But leave the last one current. |
1654 |
(and (> file-count 2) |
(and (> file-count 2) |