# HG changeset patch # User Jim Blandy # Date 679397706 0 # Node ID ecc1a00366a32ba22911f4b1939e77abf2d5f0c8 # Parent 3f3710052f22b1da585ad0ab01a7c140fe3c9431 *** empty log message *** diff -r 3f3710052f22 -r ecc1a00366a3 lisp/startup.el --- a/lisp/startup.el Sat Jul 13 07:49:50 1991 +0000 +++ b/lisp/startup.el Sat Jul 13 09:35:06 1991 +0000 @@ -155,14 +155,19 @@ (terpri) (kill-emacs))))) - (let ((args (cdr command-line-args)) - (done nil)) + (let ((done nil) + (args (cdr command-line-args))) + ;; Figure out which user's init file to load, ;; either from the environment or from the options. (setq init-file-user (if noninteractive nil (user-login-name))) ;; If user has not done su, use current $HOME to find .emacs. (and init-file-user (string= init-file-user (user-real-login-name)) (setq init-file-user "")) + + ;; Process the command-line args, and delete the arguments + ;; processed. This is consistent with the way main in emacs.c + ;; does things. (while (and (not done) args) (let ((argi (car args))) (cond @@ -178,7 +183,10 @@ ((string-equal argi "-debug-init") (setq init-file-debug t args (cdr args))) - (t (setq done t)))))) + (t (setq done t))))) + + ;; Re-attach the program name to the front of the arg list. + (setcdr command-line-args args)) ;; Load that user's init file, or the default one, or none. (let ((debug-on-error init-file-debug) @@ -225,7 +233,7 @@ (setq term (substring term 0 hyphend)) (setq term nil))))) - ;; Handle all the other options. + ;; Process the remaining args. (command-line-1 (cdr command-line-args)) ;; If -batch, terminate after processing the command options. @@ -296,14 +304,6 @@ (setq command-line-args-left (cdr command-line-args-left)) (cond ((setq tem (assoc argi command-switch-alist)) (funcall (cdr tem) argi)) - ;; These args were already processed; ignore them. - ((or (string-equal argi "-q") - (string-equal argi "-no-init-file") - (string-equal argi "-debug-init") - (string-equal argi "-batch"))) - ((or (string-equal argi "-u") - (string-equal argi "-user")) - (setq command-line-args-left (cdr command-line-args-left))) ((or (string-equal argi "-f") ;what the manual claims (string-equal argi "-funcall") (string-equal argi "-e")) ; what the source used to say