aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChong Yidong2010-01-16 14:28:59 -0500
committerChong Yidong2010-01-16 14:28:59 -0500
commit4fe22cdf59bec57eb4c4ca0264009d6b2e956707 (patch)
treebb2202054c22de0cc98432931d25d3bdb49369a8
parentf5700c5e7e4f0b5b4d3a1d187328e9e8078ef22d (diff)
downloademacs-4fe22cdf59bec57eb4c4ca0264009d6b2e956707.tar.gz
emacs-4fe22cdf59bec57eb4c4ca0264009d6b2e956707.zip
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).
-rw-r--r--lisp/ChangeLog5
-rw-r--r--lisp/startup.el13
-rw-r--r--src/ChangeLog5
-rw-r--r--src/emacs.c7
4 files changed, 24 insertions, 6 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index ea7435c559d..f62626272b2 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,8 @@
12010-01-16 Chong Yidong <cyd@stupidchicken.com>
2
3 * startup.el (command-line): Remove unused --icon-type arg.
4 Handle --display arg, passing it to command-line-1 (Bug#5392).
5
12010-01-16 Mario Lang <mlang@delysid.org> 62010-01-16 Mario Lang <mlang@delysid.org>
2 7
3 * cedet/ede/cpp-root.el (ede-cpp-root-project): 8 * 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).")
758 (pop args))) 758 (pop args)))
759 759
760 (let ((done nil) 760 (let ((done nil)
761 (args (cdr command-line-args))) 761 (args (cdr command-line-args))
762 display-arg)
762 763
763 ;; Figure out which user's init file to load, 764 ;; Figure out which user's init file to load,
764 ;; either from the environment or from the options. 765 ;; 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).")
794 (setq argval nil 795 (setq argval nil
795 argi orig-argi))))) 796 argi orig-argi)))))
796 (cond 797 (cond
798 ;; The --display arg is handled partly in C, partly in Lisp.
799 ;; When it shows up here, we just put it back to be handled
800 ;; by `command-line-1'.
801 ((member argi '("-d" "-display"))
802 (setq display-arg (list argi (pop args))))
797 ((member argi '("-Q" "-quick")) 803 ((member argi '("-Q" "-quick"))
798 (setq init-file-user nil 804 (setq init-file-user nil
799 site-run-file nil 805 site-run-file nil
@@ -813,8 +819,6 @@ opening the first frame (e.g. open a connection to an X server).")
813 (setq init-file-debug t)) 819 (setq init-file-debug t))
814 ((equal argi "-iconic") 820 ((equal argi "-iconic")
815 (push '(visibility . icon) initial-frame-alist)) 821 (push '(visibility . icon) initial-frame-alist))
816 ((member argi '("-icon-type" "-i" "-itype"))
817 (push '(icon-type . t) default-frame-alist))
818 ((member argi '("-nbc" "-no-blinking-cursor")) 822 ((member argi '("-nbc" "-no-blinking-cursor"))
819 (setq no-blinking-cursor t)) 823 (setq no-blinking-cursor t))
820 ;; Push the popped arg back on the list of arguments. 824 ;; 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).")
825 (and argval 829 (and argval
826 (error "Option `%s' doesn't allow an argument" argi)))) 830 (error "Option `%s' doesn't allow an argument" argi))))
827 831
832 ;; Re-attach the --display arg.
833 (and display-arg (setq args (append display-arg args)))
834
828 ;; Re-attach the program name to the front of the arg list. 835 ;; Re-attach the program name to the front of the arg list.
829 (and command-line-args 836 (and command-line-args
830 (setcdr command-line-args args))) 837 (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 @@
12010-01-16 Chong Yidong <cyd@stupidchicken.com>
2
3 * emacs.c (standard_args): Adjust arg priorities to reflect how
4 they are processed in startup.el.
5
12010-01-16 Andreas Schwab <schwab@linux-m68k.org> 62010-01-16 Andreas Schwab <schwab@linux-m68k.org>
2 7
3 * Makefile.in (lisp, shortlisp): Update. 8 * 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[] =
1869 /* -d must come last before the options handled in startup.el. */ 1869 /* -d must come last before the options handled in startup.el. */
1870 { "-d", "--display", 60, 1 }, 1870 { "-d", "--display", 60, 1 },
1871 { "-display", 0, 60, 1 }, 1871 { "-display", 0, 60, 1 },
1872 /* Now for the options handled in startup.el. */ 1872 /* Now for the options handled in `command-line' (startup.el). */
1873 { "-Q", "--quick", 55, 0 }, 1873 { "-Q", "--quick", 55, 0 },
1874 { "-quick", 0, 55, 0 }, 1874 { "-quick", 0, 55, 0 },
1875 { "-q", "--no-init-file", 50, 0 }, 1875 { "-q", "--no-init-file", 50, 0 },
@@ -1878,10 +1878,12 @@ const struct standard_args standard_args[] =
1878 { "-u", "--user", 30, 1 }, 1878 { "-u", "--user", 30, 1 },
1879 { "-user", 0, 30, 1 }, 1879 { "-user", 0, 30, 1 },
1880 { "-debug-init", "--debug-init", 20, 0 }, 1880 { "-debug-init", "--debug-init", 20, 0 },
1881 { "-nbi", "--no-bitmap-icon", 15, 0 },
1882 { "-iconic", "--iconic", 15, 0 }, 1881 { "-iconic", "--iconic", 15, 0 },
1883 { "-D", "--basic-display", 12, 0}, 1882 { "-D", "--basic-display", 12, 0},
1884 { "-basic-display", 0, 12, 0}, 1883 { "-basic-display", 0, 12, 0},
1884 { "-nbc", "--no-blinking-cursor", 12, 0 },
1885 /* Now for the options handled in `command-line-1' (startup.el). */
1886 { "-nbi", "--no-bitmap-icon", 10, 0 },
1885 { "-bg", "--background-color", 10, 1 }, 1887 { "-bg", "--background-color", 10, 1 },
1886 { "-background", 0, 10, 1 }, 1888 { "-background", 0, 10, 1 },
1887 { "-fg", "--foreground-color", 10, 1 }, 1889 { "-fg", "--foreground-color", 10, 1 },
@@ -1891,7 +1893,6 @@ const struct standard_args standard_args[] =
1891 { "-ib", "--internal-border", 10, 1 }, 1893 { "-ib", "--internal-border", 10, 1 },
1892 { "-ms", "--mouse-color", 10, 1 }, 1894 { "-ms", "--mouse-color", 10, 1 },
1893 { "-cr", "--cursor-color", 10, 1 }, 1895 { "-cr", "--cursor-color", 10, 1 },
1894 { "-nbc", "--no-blinking-cursor", 10, 0 },
1895 { "-fn", "--font", 10, 1 }, 1896 { "-fn", "--font", 10, 1 },
1896 { "-font", 0, 10, 1 }, 1897 { "-font", 0, 10, 1 },
1897 { "-fs", "--fullscreen", 10, 0 }, 1898 { "-fs", "--fullscreen", 10, 0 },