From: Chong Yidong Date: Sat, 16 Jan 2010 19:28:59 +0000 (-0500) Subject: Command line arg processing fix (Bug#5392) X-Git-Tag: emacs-pretest-23.1.92~35^2~27 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4fe22cdf59bec57eb4c4ca0264009d6b2e956707;p=emacs.git Command line arg processing fix (Bug#5392) * src/emacs.c (standard_args): Adjust arg priorities to reflect how they are processed in startup.el. * lisp/startup.el (command-line): Remove unused --icon-type arg. Handle --display arg, passing it to command-line-1 (Bug#5392). --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index ea7435c559d..f62626272b2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2010-01-16 Chong Yidong + + * startup.el (command-line): Remove unused --icon-type arg. + Handle --display arg, passing it to command-line-1 (Bug#5392). + 2010-01-16 Mario Lang * cedet/ede/cpp-root.el (ede-cpp-root-project): diff --git a/lisp/startup.el b/lisp/startup.el index 9de08852ae2..857ad97e448 100644 --- a/lisp/startup.el +++ b/lisp/startup.el @@ -758,7 +758,8 @@ opening the first frame (e.g. open a connection to an X server).") (pop args))) (let ((done nil) - (args (cdr command-line-args))) + (args (cdr command-line-args)) + display-arg) ;; Figure out which user's init file to load, ;; either from the environment or from the options. @@ -794,6 +795,11 @@ opening the first frame (e.g. open a connection to an X server).") (setq argval nil argi orig-argi))))) (cond + ;; The --display arg is handled partly in C, partly in Lisp. + ;; When it shows up here, we just put it back to be handled + ;; by `command-line-1'. + ((member argi '("-d" "-display")) + (setq display-arg (list argi (pop args)))) ((member argi '("-Q" "-quick")) (setq init-file-user nil site-run-file nil @@ -813,8 +819,6 @@ opening the first frame (e.g. open a connection to an X server).") (setq init-file-debug t)) ((equal argi "-iconic") (push '(visibility . icon) initial-frame-alist)) - ((member argi '("-icon-type" "-i" "-itype")) - (push '(icon-type . t) default-frame-alist)) ((member argi '("-nbc" "-no-blinking-cursor")) (setq no-blinking-cursor t)) ;; Push the popped arg back on the list of arguments. @@ -825,6 +829,9 @@ opening the first frame (e.g. open a connection to an X server).") (and argval (error "Option `%s' doesn't allow an argument" argi)))) + ;; Re-attach the --display arg. + (and display-arg (setq args (append display-arg args))) + ;; Re-attach the program name to the front of the arg list. (and command-line-args (setcdr command-line-args args))) diff --git a/src/ChangeLog b/src/ChangeLog index 94a1f9604f5..c18cd27fa0a 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-01-16 Chong Yidong + + * emacs.c (standard_args): Adjust arg priorities to reflect how + they are processed in startup.el. + 2010-01-16 Andreas Schwab * Makefile.in (lisp, shortlisp): Update. diff --git a/src/emacs.c b/src/emacs.c index 2f73e8b837a..71ffa998bfe 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1869,7 +1869,7 @@ const struct standard_args standard_args[] = /* -d must come last before the options handled in startup.el. */ { "-d", "--display", 60, 1 }, { "-display", 0, 60, 1 }, - /* Now for the options handled in startup.el. */ + /* Now for the options handled in `command-line' (startup.el). */ { "-Q", "--quick", 55, 0 }, { "-quick", 0, 55, 0 }, { "-q", "--no-init-file", 50, 0 }, @@ -1878,10 +1878,12 @@ const struct standard_args standard_args[] = { "-u", "--user", 30, 1 }, { "-user", 0, 30, 1 }, { "-debug-init", "--debug-init", 20, 0 }, - { "-nbi", "--no-bitmap-icon", 15, 0 }, { "-iconic", "--iconic", 15, 0 }, { "-D", "--basic-display", 12, 0}, { "-basic-display", 0, 12, 0}, + { "-nbc", "--no-blinking-cursor", 12, 0 }, + /* Now for the options handled in `command-line-1' (startup.el). */ + { "-nbi", "--no-bitmap-icon", 10, 0 }, { "-bg", "--background-color", 10, 1 }, { "-background", 0, 10, 1 }, { "-fg", "--foreground-color", 10, 1 }, @@ -1891,7 +1893,6 @@ const struct standard_args standard_args[] = { "-ib", "--internal-border", 10, 1 }, { "-ms", "--mouse-color", 10, 1 }, { "-cr", "--cursor-color", 10, 1 }, - { "-nbc", "--no-blinking-cursor", 10, 0 }, { "-fn", "--font", 10, 1 }, { "-font", 0, 10, 1 }, { "-fs", "--fullscreen", 10, 0 },