aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/startup.el68
1 files changed, 68 insertions, 0 deletions
diff --git a/lisp/startup.el b/lisp/startup.el
index 86ded247979..8b698e5960a 100644
--- a/lisp/startup.el
+++ b/lisp/startup.el
@@ -156,6 +156,63 @@ altering `command-line-args-left' to remove them.")
156 "Default directory to use for command line arguments. 156 "Default directory to use for command line arguments.
157This is normally copied from `default-directory' when Emacs starts.") 157This is normally copied from `default-directory' when Emacs starts.")
158 158
159;;; This is here, rather than in x-win.el, so that we can ignore these
160;;; options when we are not using X.
161(defvar command-line-x-option-alist
162 '(("-bw" 1 x-handle-numeric-switch border-width)
163 ("-d" 1 x-handle-display)
164 ("-display" 1 x-handle-display)
165 ("-name" 1 x-handle-name-rn-switch)
166 ("-rn" 1 x-handle-name-rn-switch)
167 ("-T" 1 x-handle-switch name)
168 ("-r" 0 x-handle-switch reverse t)
169 ("-rv" 0 x-handle-switch reverse t)
170 ("-reverse" 0 x-handle-switch reverse t)
171 ("-reverse-video" 0 x-handle-switch reverse t)
172 ("-fn" 1 x-handle-switch font)
173 ("-font" 1 x-handle-switch font)
174 ("-ib" 1 x-handle-numeric-switch internal-border-width)
175 ("-g" 1 x-handle-switch geometry)
176 ("-geometry" 1 x-handle-switch geometry)
177 ("-fg" 1 x-handle-switch foreground-color)
178 ("-foreground" 1 x-handle-switch foreground-color)
179 ("-bg" 1 x-handle-switch background-color)
180 ("-background" 1 x-handle-switch background-color)
181 ("-ms" 1 x-handle-switch mouse-color)
182 ("-itype" 0 x-handle-switch icon-type t)
183 ("-i" 0 x-handle-switch icon-type t)
184 ("-iconic" 0 x-handle-iconic)
185 ("-xrm" 1 x-handle-xrm-switch)
186 ("-cr" 1 x-handle-switch cursor-color)
187 ("-vb" 0 x-handle-switch vertical-scroll-bars t)
188 ("-hb" 0 x-handle-switch horizontal-scroll-bars t)
189 ("-bd" 1 x-handle-switch)
190 ("--border-width" 1 x-handle-numeric-switch border-width)
191 ("--display" 1 x-handle-display)
192 ("--name" 1 x-handle-name-rn-switch)
193 ("--title" 1 x-handle-name-rn-switch)
194 ("--reverse-video" 0 x-handle-switch reverse t)
195 ("--font" 1 x-handle-switch font)
196 ("--internal-border" 1 x-handle-numeric-switch internal-border-width)
197 ("--geometry" 1 x-handle-switch geometry)
198 ("--foreground-color" 1 x-handle-switch foreground-color)
199 ("--background-color" 1 x-handle-switch background-color)
200 ("--mouse-color" 1 x-handle-switch mouse-color)
201 ("--icon-type" 0 x-handle-switch icon-type t)
202 ("--iconic" 0 x-handle-iconic)
203 ("--xrm" 1 x-handle-xrm-switch)
204 ("--cursor-color" 1 x-handle-switch cursor-color)
205 ("--vertical-scroll-bars" 0 x-handle-switch vertical-scroll-bars t)
206 ("--border-color" 1 x-handle-switch border-width))
207 "Alist of X Windows options.
208Each element has the form
209 (NAME NUMARGS HANDLER FRAME-PARAM VALUE)
210where NAME is the option name string, NUMARGS is the number of arguments
211that the option accepts, HANDLER is a function to call to handle the option.
212FRAME-PARAM (optional) is the frame parameter this option specifies,
213and VALUE is the value which is given to that frame parameter
214\(most options use the argument for this, so VALUE is not present).")
215
159(defvar before-init-hook nil 216(defvar before-init-hook nil
160 "Functions to call after handling urgent options but before init files. 217 "Functions to call after handling urgent options but before init files.
161The frame system uses this to open frames to display messages while 218The frame system uses this to open frames to display messages while
@@ -722,6 +779,13 @@ Type \\[describe-distribution] for information on getting the latest version."))
722 (initial-load-path load-path)) 779 (initial-load-path load-path))
723 (setq command-line-args-left (cdr command-line-args-left)) 780 (setq command-line-args-left (cdr command-line-args-left))
724 781
782 ;; Add the long X options to longopts.
783 (setq tem command-line-x-option-alist)
784 (while tem
785 (if (string-match "^--" (car (car tem)))
786 (setq longopts (cons (list (car (car tem))) longopts)))
787 (setq tem (cdr tem)))
788
725 ;; Convert long options to ordinary options 789 ;; Convert long options to ordinary options
726 ;; and separate out an attached option argument into argval. 790 ;; and separate out an attached option argument into argval.
727 (if (string-match "^--[^=]*=" argi) 791 (if (string-match "^--[^=]*=" argi)
@@ -795,6 +859,10 @@ Type \\[describe-distribution] for information on getting the latest version."))
795 (kill-emacs t)) 859 (kill-emacs t))
796 ((string-match "^\\+[0-9]+\\'" argi) 860 ((string-match "^\\+[0-9]+\\'" argi)
797 (setq line (string-to-int argi))) 861 (setq line (string-to-int argi)))
862 ((setq tem (assoc argi command-line-x-option-alist))
863 ;; Ignore X-windows options and their args if not using X.
864 (setq command-line-args-left
865 (nthcdr (nth 1 tem) command-line-args-left)))
798 (t 866 (t
799 ;; We have almost exhausted our options. See if the 867 ;; We have almost exhausted our options. See if the
800 ;; user has made any other command-line options available 868 ;; user has made any other command-line options available