comparison lisp/startup.el @ 89971:cce1c0ee76ee

Revision: miles@gnu.org--gnu-2004/emacs--unicode--0--patch-36 Merge from emacs--cvs-trunk--0, emacs--gnus--5.10, gnus--rel--5.10 Patches applied: * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-523 Merge from emacs--gnus--5.10, gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-524 - miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-534 Update from CVS * miles@gnu.org--gnu-2004/emacs--gnus--5.10--base-0 tag of miles@gnu.org--gnu-2004/emacs--cvs-trunk--0--patch-464 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-1 Import from CVS branch gnus-5_10-branch * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-2 Merge from lorentey@elte.hu--2004/emacs--multi-tty--0, emacs--cvs-trunk--0 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-3 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/emacs--gnus--5.10--patch-4 Merge from gnus--rel--5.10 * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-18 Update from CVS * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-19 Remove autoconf-generated files from archive * miles@gnu.org--gnu-2004/gnus--rel--5.10--patch-20 Update from CVS
author Miles Bader <miles@gnu.org>
date Thu, 09 Sep 2004 09:36:36 +0000
parents 3219f94257bc 5ce2d0959cd2
children 0796fc36c2bd
comparison
equal deleted inserted replaced
89970:a849e5779b8c 89971:cce1c0ee76ee
1480 ;; We have command args; process them. 1480 ;; We have command args; process them.
1481 (let ((dir command-line-default-directory) 1481 (let ((dir command-line-default-directory)
1482 (file-count 0) 1482 (file-count 0)
1483 first-file-buffer 1483 first-file-buffer
1484 tem 1484 tem
1485 ;; The directories listed in --directory/-L options will *appear* 1485 ;; This approach loses for "-batch -L DIR --eval "(require foo)",
1486 ;; at the front of `load-path' in the order they appear on the 1486 ;; if foo is intended to be found in DIR.
1487 ;; command-line. We cannot do this by *placing* them at the front 1487 ;;
1488 ;; in the order they appear, so we need this variable to hold them, 1488 ;; ;; The directories listed in --directory/-L options will *appear*
1489 ;; temporarily. 1489 ;; ;; at the front of `load-path' in the order they appear on the
1490 extra-load-path 1490 ;; ;; command-line. We cannot do this by *placing* them at the front
1491 ;; ;; in the order they appear, so we need this variable to hold them,
1492 ;; ;; temporarily.
1493 ;; extra-load-path
1494 ;;
1495 ;; To DTRT we keep track of the splice point and modify `load-path'
1496 ;; straight away upon any --directory/-L option.
1497 splice
1491 just-files ;; t if this follows the magic -- option. 1498 just-files ;; t if this follows the magic -- option.
1492 ;; This includes our standard options' long versions 1499 ;; This includes our standard options' long versions
1493 ;; and long versions of what's on command-switch-alist. 1500 ;; and long versions of what's on command-switch-alist.
1494 (longopts 1501 (longopts
1495 (append '(("--funcall") ("--load") ("--insert") ("--kill") 1502 (append '(("--funcall") ("--load") ("--insert") ("--kill")
1554 (command-execute tem) 1561 (command-execute tem)
1555 (funcall tem))) 1562 (funcall tem)))
1556 1563
1557 ((member argi '("-eval" "-execute")) 1564 ((member argi '("-eval" "-execute"))
1558 (eval (read (or argval (pop command-line-args-left))))) 1565 (eval (read (or argval (pop command-line-args-left)))))
1559 ;; Set the default directory as specified in -L.
1560 1566
1561 ((member argi '("-L" "-directory")) 1567 ((member argi '("-L" "-directory"))
1562 (setq tem (or argval (pop command-line-args-left))) 1568 (setq tem (expand-file-name
1563 ;; We will reverse `extra-load-path' and prepend it to 1569 (command-line-normalize-file-name
1564 ;; `load-path' after all the arguments have been processed. 1570 (or argval (pop command-line-args-left)))))
1565 (push 1571 (cond (splice (setcdr splice (cons tem (cdr splice)))
1566 (expand-file-name (command-line-normalize-file-name tem)) 1572 (setq splice (cdr splice)))
1567 extra-load-path)) 1573 (t (setq load-path (cons tem load-path)
1574 splice load-path))))
1568 1575
1569 ((member argi '("-l" "-load")) 1576 ((member argi '("-l" "-load"))
1570 (let* ((file (command-line-normalize-file-name 1577 (let* ((file (command-line-normalize-file-name
1571 (or argval (pop command-line-args-left)))) 1578 (or argval (pop command-line-args-left))))
1572 ;; Take file from default dir if it exists there; 1579 ;; Take file from default dir if it exists there;
1643 (setq line 0) 1650 (setq line 0)
1644 (unless (< column 1) 1651 (unless (< column 1)
1645 (move-to-column (1- column))) 1652 (move-to-column (1- column)))
1646 (setq column 0)))))))) 1653 (setq column 0))))))))
1647 1654
1648 ;; See --directory/-L option above.
1649 (when extra-load-path
1650 (setq load-path (append (nreverse extra-load-path) load-path)))
1651
1652 ;; If 3 or more files visited, and not all visible, 1655 ;; If 3 or more files visited, and not all visible,
1653 ;; show user what they all are. But leave the last one current. 1656 ;; show user what they all are. But leave the last one current.
1654 (and (> file-count 2) 1657 (and (> file-count 2)
1655 (not noninteractive) 1658 (not noninteractive)
1656 (not inhibit-startup-buffer-menu) 1659 (not inhibit-startup-buffer-menu)