diff options
| author | Dan Nicolaescu | 2008-07-20 00:37:45 +0000 |
|---|---|---|
| committer | Dan Nicolaescu | 2008-07-20 00:37:45 +0000 |
| commit | d5e4dda5f6fbc60eb57727d3b93fb0ef6f74868e (patch) | |
| tree | 3afd45afe44004e924a5208fbc6000770135ba74 | |
| parent | f4949090d477c82e2fc38811e87652a97728b525 (diff) | |
| download | emacs-d5e4dda5f6fbc60eb57727d3b93fb0ef6f74868e.tar.gz emacs-d5e4dda5f6fbc60eb57727d3b93fb0ef6f74868e.zip | |
* term/x-win.el (x-handle-switch, x-handle-numeric-switch)
(x-handle-initial-switch, x-handle-iconic, x-handle-xrm-switch)
(x-handle-geometry, x-handle-name-switch, x-display-name)
(x-handle-display, x-handle-args, x-colors): Move ...
* term/common-win.el: ... here. New file.
* term/w32-win.el (x-handle-switch, x-handle-numeric-switch)
(x-handle-initial-switch, x-handle-iconic, x-handle-xrm-switch)
(x-handle-geometry, x-handle-name-switch, x-display-name)
(x-handle-display, x-handle-args, x-colors): Remove.
* loadup.el: Load term/common-win before term/x-win and term/w32-win.
| -rw-r--r-- | lisp/ChangeLog | 14 | ||||
| -rw-r--r-- | lisp/loadup.el | 4 | ||||
| -rw-r--r-- | lisp/term/common-win.el | 294 | ||||
| -rw-r--r-- | lisp/term/w32-win.el | 261 | ||||
| -rw-r--r-- | lisp/term/x-win.el | 263 |
5 files changed, 312 insertions, 524 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index cee9364d337..0febaa03395 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,16 @@ | |||
| 1 | 2008-07-20 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * term/x-win.el (x-handle-switch, x-handle-numeric-switch) | ||
| 4 | (x-handle-initial-switch, x-handle-iconic, x-handle-xrm-switch) | ||
| 5 | (x-handle-geometry, x-handle-name-switch, x-display-name) | ||
| 6 | (x-handle-display, x-handle-args, x-colors): Move ... | ||
| 7 | * term/common-win.el: ... here. New file. | ||
| 8 | * term/w32-win.el (x-handle-switch, x-handle-numeric-switch) | ||
| 9 | (x-handle-initial-switch, x-handle-iconic, x-handle-xrm-switch) | ||
| 10 | (x-handle-geometry, x-handle-name-switch, x-display-name) | ||
| 11 | (x-handle-display, x-handle-args, x-colors): Remove. | ||
| 12 | * loadup.el: Load term/common-win before term/x-win and term/w32-win. | ||
| 13 | |||
| 1 | 2008-07-19 Juri Linkov <juri@jurta.org> | 14 | 2008-07-19 Juri Linkov <juri@jurta.org> |
| 2 | 15 | ||
| 3 | * startup.el (fancy-startup-text): Move the line "To quit | 16 | * startup.el (fancy-startup-text): Move the line "To quit |
| @@ -20,6 +33,7 @@ | |||
| 20 | to docstrings. | 33 | to docstrings. |
| 21 | 34 | ||
| 22 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> | 35 | 2008-07-19 Adrian Robert <Adrian.B.Robert@gmail.com> |
| 36 | |||
| 23 | * term/ns-win.el (ns-ps-print-menu-map): Fix typo pointed out by | 37 | * term/ns-win.el (ns-ps-print-menu-map): Fix typo pointed out by |
| 24 | Vinicius Jose Latorre. | 38 | Vinicius Jose Latorre. |
| 25 | 39 | ||
diff --git a/lisp/loadup.el b/lisp/loadup.el index 30a26e902b3..64433b2058a 100644 --- a/lisp/loadup.el +++ b/lisp/loadup.el | |||
| @@ -182,8 +182,9 @@ | |||
| 182 | (if (featurep 'x) | 182 | (if (featurep 'x) |
| 183 | (progn | 183 | (progn |
| 184 | (load "x-dnd") | 184 | (load "x-dnd") |
| 185 | (load "term/common-win") | ||
| 185 | (load "term/x-win"))) | 186 | (load "term/x-win"))) |
| 186 | 187 | ||
| 187 | (message "%s" (garbage-collect)) | 188 | (message "%s" (garbage-collect)) |
| 188 | 189 | ||
| 189 | (if (eq system-type 'vax-vms) | 190 | (if (eq system-type 'vax-vms) |
| @@ -192,6 +193,7 @@ | |||
| 192 | (if (eq system-type 'windows-nt) | 193 | (if (eq system-type 'windows-nt) |
| 193 | (progn | 194 | (progn |
| 194 | (load "w32-vars") | 195 | (load "w32-vars") |
| 196 | (load "term/common-win") | ||
| 195 | (load "term/w32-win") | 197 | (load "term/w32-win") |
| 196 | (load "ls-lisp") | 198 | (load "ls-lisp") |
| 197 | (load "disp-table") ; needed to setup ibm-pc char set, see internal.el | 199 | (load "disp-table") ; needed to setup ibm-pc char set, see internal.el |
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el new file mode 100644 index 00000000000..ffd2bd52c24 --- /dev/null +++ b/lisp/term/common-win.el | |||
| @@ -0,0 +1,294 @@ | |||
| 1 | ;;; common-win.el --- common part of handling window systems | ||
| 2 | |||
| 3 | ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, | ||
| 4 | ;; 2008 Free Software Foundation, Inc. | ||
| 5 | |||
| 6 | ;; Maintainer: FSF | ||
| 7 | ;; Keywords: terminals | ||
| 8 | |||
| 9 | ;; This file is part of GNU Emacs. | ||
| 10 | |||
| 11 | ;; GNU Emacs is free software: you can redistribute it and/or modify | ||
| 12 | ;; it under the terms of the GNU General Public License as published by | ||
| 13 | ;; the Free Software Foundation, either version 3 of the License, or | ||
| 14 | ;; (at your option) any later version. | ||
| 15 | |||
| 16 | ;; GNU Emacs is distributed in the hope that it will be useful, | ||
| 17 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 18 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 19 | ;; GNU General Public License for more details. | ||
| 20 | |||
| 21 | ;; You should have received a copy of the GNU General Public License | ||
| 22 | ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. | ||
| 23 | |||
| 24 | ;;; Commentary: | ||
| 25 | |||
| 26 | ;;; Code: | ||
| 27 | |||
| 28 | |||
| 29 | (defvar x-invocation-args) | ||
| 30 | |||
| 31 | (defvar x-command-line-resources nil) | ||
| 32 | |||
| 33 | ;; Handler for switches of the form "-switch value" or "-switch". | ||
| 34 | (defun x-handle-switch (switch) | ||
| 35 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 36 | (if aelt | ||
| 37 | (let ((param (nth 3 aelt)) | ||
| 38 | (value (nth 4 aelt))) | ||
| 39 | (if value | ||
| 40 | (setq default-frame-alist | ||
| 41 | (cons (cons param value) | ||
| 42 | default-frame-alist)) | ||
| 43 | (setq default-frame-alist | ||
| 44 | (cons (cons param | ||
| 45 | (car x-invocation-args)) | ||
| 46 | default-frame-alist) | ||
| 47 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 48 | |||
| 49 | ;; Handler for switches of the form "-switch n" | ||
| 50 | (defun x-handle-numeric-switch (switch) | ||
| 51 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 52 | (if aelt | ||
| 53 | (let ((param (nth 3 aelt))) | ||
| 54 | (setq default-frame-alist | ||
| 55 | (cons (cons param | ||
| 56 | (string-to-number (car x-invocation-args))) | ||
| 57 | default-frame-alist) | ||
| 58 | x-invocation-args | ||
| 59 | (cdr x-invocation-args)))))) | ||
| 60 | |||
| 61 | ;; Handle options that apply to initial frame only | ||
| 62 | (defun x-handle-initial-switch (switch) | ||
| 63 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 64 | (if aelt | ||
| 65 | (let ((param (nth 3 aelt)) | ||
| 66 | (value (nth 4 aelt))) | ||
| 67 | (if value | ||
| 68 | (setq initial-frame-alist | ||
| 69 | (cons (cons param value) | ||
| 70 | initial-frame-alist)) | ||
| 71 | (setq initial-frame-alist | ||
| 72 | (cons (cons param | ||
| 73 | (car x-invocation-args)) | ||
| 74 | initial-frame-alist) | ||
| 75 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 76 | |||
| 77 | ;; Make -iconic apply only to the initial frame! | ||
| 78 | (defun x-handle-iconic (switch) | ||
| 79 | (setq initial-frame-alist | ||
| 80 | (cons '(visibility . icon) initial-frame-alist))) | ||
| 81 | |||
| 82 | ;; Handle the -xrm option. | ||
| 83 | (defun x-handle-xrm-switch (switch) | ||
| 84 | (unless (consp x-invocation-args) | ||
| 85 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 86 | (setq x-command-line-resources | ||
| 87 | (if (null x-command-line-resources) | ||
| 88 | (car x-invocation-args) | ||
| 89 | (concat x-command-line-resources "\n" (car x-invocation-args)))) | ||
| 90 | (setq x-invocation-args (cdr x-invocation-args))) | ||
| 91 | |||
| 92 | (declare-function x-parse-geometry "frame.c" (string)) | ||
| 93 | |||
| 94 | ;; Handle the geometry option | ||
| 95 | (defun x-handle-geometry (switch) | ||
| 96 | (let* ((geo (x-parse-geometry (car x-invocation-args))) | ||
| 97 | (left (assq 'left geo)) | ||
| 98 | (top (assq 'top geo)) | ||
| 99 | (height (assq 'height geo)) | ||
| 100 | (width (assq 'width geo))) | ||
| 101 | (if (or height width) | ||
| 102 | (setq default-frame-alist | ||
| 103 | (append default-frame-alist | ||
| 104 | '((user-size . t)) | ||
| 105 | (if height (list height)) | ||
| 106 | (if width (list width))) | ||
| 107 | initial-frame-alist | ||
| 108 | (append initial-frame-alist | ||
| 109 | '((user-size . t)) | ||
| 110 | (if height (list height)) | ||
| 111 | (if width (list width))))) | ||
| 112 | (if (or left top) | ||
| 113 | (setq initial-frame-alist | ||
| 114 | (append initial-frame-alist | ||
| 115 | '((user-position . t)) | ||
| 116 | (if left (list left)) | ||
| 117 | (if top (list top))))) | ||
| 118 | (setq x-invocation-args (cdr x-invocation-args)))) | ||
| 119 | |||
| 120 | (defvar x-resource-name) | ||
| 121 | |||
| 122 | ;; Handle the -name option. Set the variable x-resource-name | ||
| 123 | ;; to the option's operand; set the name of | ||
| 124 | ;; the initial frame, too. | ||
| 125 | (defun x-handle-name-switch (switch) | ||
| 126 | (or (consp x-invocation-args) | ||
| 127 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 128 | (setq x-resource-name (car x-invocation-args) | ||
| 129 | x-invocation-args (cdr x-invocation-args)) | ||
| 130 | (setq initial-frame-alist (cons (cons 'name x-resource-name) | ||
| 131 | initial-frame-alist))) | ||
| 132 | |||
| 133 | (defvar x-display-name nil | ||
| 134 | "The name of the X display on which Emacs was started. | ||
| 135 | |||
| 136 | For the X display name of individual frames, see the `display' | ||
| 137 | frame parameter.") | ||
| 138 | |||
| 139 | (defun x-handle-display (switch) | ||
| 140 | "Handle -display DISPLAY option." | ||
| 141 | (setq x-display-name (car x-invocation-args) | ||
| 142 | x-invocation-args (cdr x-invocation-args)) | ||
| 143 | ;; Make subshell programs see the same DISPLAY value Emacs really uses. | ||
| 144 | ;; Note that this isn't completely correct, since Emacs can use | ||
| 145 | ;; multiple displays. However, there is no way to tell an already | ||
| 146 | ;; running subshell which display the user is currently typing on. | ||
| 147 | (setenv "DISPLAY" x-display-name)) | ||
| 148 | |||
| 149 | (defun x-handle-args (args) | ||
| 150 | "Process the X-related command line options in ARGS. | ||
| 151 | This is done before the user's startup file is loaded. They are copied to | ||
| 152 | `x-invocation-args', from which the X-related things are extracted, first | ||
| 153 | the switch (e.g., \"-fg\") in the following code, and possible values | ||
| 154 | \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | ||
| 155 | This function returns ARGS minus the arguments that have been processed." | ||
| 156 | ;; We use ARGS to accumulate the args that we don't handle here, to return. | ||
| 157 | (setq x-invocation-args args | ||
| 158 | args nil) | ||
| 159 | (while (and x-invocation-args | ||
| 160 | (not (equal (car x-invocation-args) "--"))) | ||
| 161 | (let* ((this-switch (car x-invocation-args)) | ||
| 162 | (orig-this-switch this-switch) | ||
| 163 | completion argval aelt handler) | ||
| 164 | (setq x-invocation-args (cdr x-invocation-args)) | ||
| 165 | ;; Check for long options with attached arguments | ||
| 166 | ;; and separate out the attached option argument into argval. | ||
| 167 | (if (string-match "^--[^=]*=" this-switch) | ||
| 168 | (setq argval (substring this-switch (match-end 0)) | ||
| 169 | this-switch (substring this-switch 0 (1- (match-end 0))))) | ||
| 170 | ;; Complete names of long options. | ||
| 171 | (if (string-match "^--" this-switch) | ||
| 172 | (progn | ||
| 173 | (setq completion (try-completion this-switch command-line-x-option-alist)) | ||
| 174 | (if (eq completion t) | ||
| 175 | ;; Exact match for long option. | ||
| 176 | nil | ||
| 177 | (if (stringp completion) | ||
| 178 | (let ((elt (assoc completion command-line-x-option-alist))) | ||
| 179 | ;; Check for abbreviated long option. | ||
| 180 | (or elt | ||
| 181 | (error "Option `%s' is ambiguous" this-switch)) | ||
| 182 | (setq this-switch completion)))))) | ||
| 183 | (setq aelt (assoc this-switch command-line-x-option-alist)) | ||
| 184 | (if aelt (setq handler (nth 2 aelt))) | ||
| 185 | (if handler | ||
| 186 | (if argval | ||
| 187 | (let ((x-invocation-args | ||
| 188 | (cons argval x-invocation-args))) | ||
| 189 | (funcall handler this-switch)) | ||
| 190 | (funcall handler this-switch)) | ||
| 191 | (setq args (cons orig-this-switch args))))) | ||
| 192 | (nconc (nreverse args) x-invocation-args)) | ||
| 193 | |||
| 194 | |||
| 195 | ;; | ||
| 196 | ;; Available colors | ||
| 197 | ;; | ||
| 198 | ;; The ordering of the colors is chosen for the user's convenience in | ||
| 199 | ;; `list-colors-display', which displays the reverse of this list. | ||
| 200 | ;; Roughly speaking, `list-colors-display' orders by (i) named shades | ||
| 201 | ;; of grey with hue 0.0, sorted by value (ii) named colors with | ||
| 202 | ;; saturation 1.0, sorted by hue, (iii) named non-white colors with | ||
| 203 | ;; saturation less than 1.0, sorted by hue, (iv) other named shades of | ||
| 204 | ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades | ||
| 205 | ;; of grey. | ||
| 206 | |||
| 207 | (defvar x-colors | ||
| 208 | '("gray100" "gray99" "gray98" "gray97" "gray96" "gray95" "gray94" "gray93" "gray92" | ||
| 209 | "gray91" "gray90" "gray89" "gray88" "gray87" "gray86" "gray85" "gray84" "gray83" | ||
| 210 | "gray82" "gray81" "gray80" "gray79" "gray78" "gray77" "gray76" "gray75" "gray74" | ||
| 211 | "gray73" "gray72" "gray71" "gray70" "gray69" "gray68" "gray67" "gray66" "gray65" | ||
| 212 | "gray64" "gray63" "gray62" "gray61" "gray60" "gray59" "gray58" "gray57" "gray56" | ||
| 213 | "gray55" "gray54" "gray53" "gray52" "gray51" "gray50" "gray49" "gray48" "gray47" | ||
| 214 | "gray46" "gray45" "gray44" "gray43" "gray42" "gray41" "gray40" "gray39" "gray38" | ||
| 215 | "gray37" "gray36" "gray35" "gray34" "gray33" "gray32" "gray31" "gray30" "gray29" | ||
| 216 | "gray28" "gray27" "gray26" "gray25" "gray24" "gray23" "gray22" "gray21" "gray20" | ||
| 217 | "gray19" "gray18" "gray17" "gray16" "gray15" "gray14" "gray13" "gray12" "gray11" | ||
| 218 | "gray10" "gray9" "gray8" "gray7" "gray6" "gray5" "gray4" "gray3" "gray2" "gray1" | ||
| 219 | "gray0" "LightPink1" "LightPink2" "LightPink3" "LightPink4" "pink1" "pink2" "pink3" | ||
| 220 | "pink4" "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4" | ||
| 221 | "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" "VioletRed1" | ||
| 222 | "VioletRed2" "VioletRed3" "VioletRed4" "HotPink1" "HotPink2" "HotPink3" "HotPink4" | ||
| 223 | "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" "maroon1" "maroon2" "maroon3" | ||
| 224 | "maroon4" "orchid1" "orchid2" "orchid3" "orchid4" "plum1" "plum2" "plum3" "plum4" | ||
| 225 | "thistle1" "thistle2" "thistle3" "thistle4" "MediumOrchid1" "MediumOrchid2" | ||
| 226 | "MediumOrchid3" "MediumOrchid4" "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" | ||
| 227 | "DarkOrchid4" "purple1" "purple2" "purple3" "purple4" "MediumPurple1" | ||
| 228 | "MediumPurple2" "MediumPurple3" "MediumPurple4" "SlateBlue1" "SlateBlue2" | ||
| 229 | "SlateBlue3" "SlateBlue4" "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4" | ||
| 230 | "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" "SlateGray1" | ||
| 231 | "SlateGray2" "SlateGray3" "SlateGray4" "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" | ||
| 232 | "DodgerBlue4" "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" "SkyBlue1" | ||
| 233 | "SkyBlue2" "SkyBlue3" "SkyBlue4" "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" | ||
| 234 | "LightSkyBlue4" "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" "CadetBlue1" | ||
| 235 | "CadetBlue2" "CadetBlue3" "CadetBlue4" "azure1" "azure2" "azure3" "azure4" | ||
| 236 | "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" "PaleTurquoise1" | ||
| 237 | "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" "DarkSlateGray1" "DarkSlateGray2" | ||
| 238 | "DarkSlateGray3" "DarkSlateGray4" "aquamarine1" "aquamarine2" "aquamarine3" | ||
| 239 | "aquamarine4" "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" "honeydew1" | ||
| 240 | "honeydew2" "honeydew3" "honeydew4" "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" | ||
| 241 | "DarkSeaGreen4" "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4" | ||
| 242 | "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" "OliveDrab1" | ||
| 243 | "OliveDrab2" "OliveDrab3" "OliveDrab4" "ivory1" "ivory2" "ivory3" "ivory4" | ||
| 244 | "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" "khaki1" "khaki2" | ||
| 245 | "khaki3" "khaki4" "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4" | ||
| 246 | "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" "cornsilk1" | ||
| 247 | "cornsilk2" "cornsilk3" "cornsilk4" "goldenrod1" "goldenrod2" "goldenrod3" | ||
| 248 | "goldenrod4" "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4" | ||
| 249 | "wheat1" "wheat2" "wheat3" "wheat4" "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" | ||
| 250 | "NavajoWhite4" "burlywood1" "burlywood2" "burlywood3" "burlywood4" "AntiqueWhite1" | ||
| 251 | "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" "bisque1" "bisque2" "bisque3" | ||
| 252 | "bisque4" "tan1" "tan2" "tan3" "tan4" "PeachPuff1" "PeachPuff2" "PeachPuff3" | ||
| 253 | "PeachPuff4" "seashell1" "seashell2" "seashell3" "seashell4" "chocolate1" | ||
| 254 | "chocolate2" "chocolate3" "chocolate4" "sienna1" "sienna2" "sienna3" "sienna4" | ||
| 255 | "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" "salmon1" "salmon2" | ||
| 256 | "salmon3" "salmon4" "coral1" "coral2" "coral3" "coral4" "tomato1" "tomato2" | ||
| 257 | "tomato3" "tomato4" "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" "snow1" | ||
| 258 | "snow2" "snow3" "snow4" "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4" | ||
| 259 | "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" "firebrick1" "firebrick2" | ||
| 260 | "firebrick3" "firebrick4" "brown1" "brown2" "brown3" "brown4" "magenta1" "magenta2" | ||
| 261 | "magenta3" "magenta4" "blue1" "blue2" "blue3" "blue4" "DeepSkyBlue1" "DeepSkyBlue2" | ||
| 262 | "DeepSkyBlue3" "DeepSkyBlue4" "turquoise1" "turquoise2" "turquoise3" "turquoise4" | ||
| 263 | "cyan1" "cyan2" "cyan3" "cyan4" "SpringGreen1" "SpringGreen2" "SpringGreen3" | ||
| 264 | "SpringGreen4" "green1" "green2" "green3" "green4" "chartreuse1" "chartreuse2" | ||
| 265 | "chartreuse3" "chartreuse4" "yellow1" "yellow2" "yellow3" "yellow4" "gold1" "gold2" | ||
| 266 | "gold3" "gold4" "orange1" "orange2" "orange3" "orange4" "DarkOrange1" "DarkOrange2" | ||
| 267 | "DarkOrange3" "DarkOrange4" "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4" | ||
| 268 | "red1" "red2" "red3" "red4" "lavender blush" "ghost white" "lavender" "alice blue" | ||
| 269 | "azure" "light cyan" "mint cream" "honeydew" "ivory" "light goldenrod yellow" | ||
| 270 | "light yellow" "beige" "floral white" "old lace" "blanched almond" "moccasin" | ||
| 271 | "papaya whip" "bisque" "antique white" "linen" "peach puff" "seashell" "misty rose" | ||
| 272 | "snow" "light pink" "pink" "hot pink" "deep pink" "maroon" "pale violet red" | ||
| 273 | "violet red" "medium violet red" "violet" "plum" "thistle" "orchid" "medium orchid" | ||
| 274 | "dark orchid" "purple" "blue violet" "medium purple" "light slate blue" | ||
| 275 | "medium slate blue" "slate blue" "dark slate blue" "midnight blue" "navy" | ||
| 276 | "dark blue" "light steel blue" "cornflower blue" "dodger blue" "royal blue" | ||
| 277 | "light slate gray" "slate gray" "dark slate gray" "steel blue" "cadet blue" | ||
| 278 | "light sky blue" "sky blue" "light blue" "powder blue" "pale turquoise" "turquoise" | ||
| 279 | "medium turquoise" "dark cyan" "aquamarine" "medium aquamarine" "light sea green" | ||
| 280 | "medium sea green" "sea green" "dark sea green" "pale green" "lime green" | ||
| 281 | "forest green" "light green" "green yellow" "yellow green" "olive drab" | ||
| 282 | "dark olive green" "lemon chiffon" "khaki" "dark khaki" "cornsilk" | ||
| 283 | "pale goldenrod" "light goldenrod" "goldenrod" "dark goldenrod" "wheat" | ||
| 284 | "navajo white" "tan" "burlywood" "sandy brown" "peru" "chocolate" "saddle brown" | ||
| 285 | "sienna" "rosy brown" "dark salmon" "coral" "tomato" "light salmon" "salmon" | ||
| 286 | "light coral" "indian red" "firebrick" "brown" "dark red" "magenta" | ||
| 287 | "dark magenta" "dark violet" "medium blue" "blue" "deep sky blue" | ||
| 288 | "cyan" "medium spring green" "spring green" "green" "lawn green" "chartreuse" | ||
| 289 | "yellow" "gold" "orange" "dark orange" "orange red" "red" "white" "white smoke" | ||
| 290 | "gainsboro" "light grey" "gray" "dark grey" "dim gray" "black" ) | ||
| 291 | "The list of X colors from the `rgb.txt' file. | ||
| 292 | XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | ||
| 293 | |||
| 294 | ;;; common-win.el ends here | ||
diff --git a/lisp/term/w32-win.el b/lisp/term/w32-win.el index 298234f465e..7cc0cd2f62b 100644 --- a/lisp/term/w32-win.el +++ b/lisp/term/w32-win.el | |||
| @@ -146,269 +146,9 @@ the last file dropped is selected." | |||
| 146 | ;; new layout/language selected by the user. | 146 | ;; new layout/language selected by the user. |
| 147 | (global-set-key [language-change] 'ignore) | 147 | (global-set-key [language-change] 'ignore) |
| 148 | 148 | ||
| 149 | (defvar x-invocation-args) | ||
| 150 | |||
| 151 | (defvar x-command-line-resources nil) | ||
| 152 | |||
| 153 | (defun x-handle-switch (switch) | ||
| 154 | "Handle SWITCH of the form \"-switch value\" or \"-switch\"." | ||
| 155 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 156 | (if aelt | ||
| 157 | (let ((param (nth 3 aelt)) | ||
| 158 | (value (nth 4 aelt))) | ||
| 159 | (if value | ||
| 160 | (setq default-frame-alist | ||
| 161 | (cons (cons param value) | ||
| 162 | default-frame-alist)) | ||
| 163 | (setq default-frame-alist | ||
| 164 | (cons (cons param | ||
| 165 | (car x-invocation-args)) | ||
| 166 | default-frame-alist) | ||
| 167 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 168 | |||
| 169 | (defun x-handle-numeric-switch (switch) | ||
| 170 | "Handle SWITCH of the form \"-switch n\"." | ||
| 171 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 172 | (if aelt | ||
| 173 | (let ((param (nth 3 aelt))) | ||
| 174 | (setq default-frame-alist | ||
| 175 | (cons (cons param | ||
| 176 | (string-to-number (car x-invocation-args))) | ||
| 177 | default-frame-alist) | ||
| 178 | x-invocation-args | ||
| 179 | (cdr x-invocation-args)))))) | ||
| 180 | |||
| 181 | ;; Handle options that apply to initial frame only | ||
| 182 | (defun x-handle-initial-switch (switch) | ||
| 183 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 184 | (if aelt | ||
| 185 | (let ((param (nth 3 aelt)) | ||
| 186 | (value (nth 4 aelt))) | ||
| 187 | (if value | ||
| 188 | (setq initial-frame-alist | ||
| 189 | (cons (cons param value) | ||
| 190 | initial-frame-alist)) | ||
| 191 | (setq initial-frame-alist | ||
| 192 | (cons (cons param | ||
| 193 | (car x-invocation-args)) | ||
| 194 | initial-frame-alist) | ||
| 195 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 196 | |||
| 197 | (defun x-handle-iconic (switch) | ||
| 198 | "Make \"-iconic\" SWITCH apply only to the initial frame." | ||
| 199 | (setq default-frame-alist (cons '(icon-type) default-frame-alist))) | ||
| 200 | |||
| 201 | (defun x-handle-xrm-switch (switch) | ||
| 202 | "Handle the \"-xrm\" SWITCH." | ||
| 203 | (unless (consp x-invocation-args) | ||
| 204 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 205 | (setq x-command-line-resources | ||
| 206 | (if (null x-command-line-resources) | ||
| 207 | (car x-invocation-args) | ||
| 208 | (concat x-command-line-resources "\n" (car x-invocation-args)))) | ||
| 209 | (setq x-invocation-args (cdr x-invocation-args))) | ||
| 210 | |||
| 211 | (declare-function x-parse-geometry "frame.c" (string)) | ||
| 212 | |||
| 213 | (defun x-handle-geometry (switch) | ||
| 214 | "Handle the \"-geometry\" SWITCH." | ||
| 215 | (let* ((geo (x-parse-geometry (car x-invocation-args))) | ||
| 216 | (left (assq 'left geo)) | ||
| 217 | (top (assq 'top geo)) | ||
| 218 | (height (assq 'height geo)) | ||
| 219 | (width (assq 'width geo))) | ||
| 220 | (if (or height width) | ||
| 221 | (setq default-frame-alist | ||
| 222 | (append default-frame-alist | ||
| 223 | '((user-size . t)) | ||
| 224 | (if height (list height)) | ||
| 225 | (if width (list width))) | ||
| 226 | initial-frame-alist | ||
| 227 | (append initial-frame-alist | ||
| 228 | '((user-size . t)) | ||
| 229 | (if height (list height)) | ||
| 230 | (if width (list width))))) | ||
| 231 | (if (or left top) | ||
| 232 | (setq initial-frame-alist | ||
| 233 | (append initial-frame-alist | ||
| 234 | '((user-position . t)) | ||
| 235 | (if left (list left)) | ||
| 236 | (if top (list top))))) | ||
| 237 | (setq x-invocation-args (cdr x-invocation-args)))) | ||
| 238 | |||
| 239 | (defvar x-resource-name) | 149 | (defvar x-resource-name) |
| 240 | 150 | ||
| 241 | (defun x-handle-name-switch (switch) | ||
| 242 | "Handle the \"-name\" SWITCH." | ||
| 243 | ;; Handle the -name option. Set the variable x-resource-name | ||
| 244 | ;; to the option's operand; set the name of the initial frame, too. | ||
| 245 | (or (consp x-invocation-args) | ||
| 246 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 247 | (setq x-resource-name (car x-invocation-args) | ||
| 248 | x-invocation-args (cdr x-invocation-args)) | ||
| 249 | (setq initial-frame-alist (cons (cons 'name x-resource-name) | ||
| 250 | initial-frame-alist))) | ||
| 251 | |||
| 252 | (defvar x-display-name nil | ||
| 253 | "The display name specifying server and frame.") | ||
| 254 | |||
| 255 | (defun x-handle-display (switch) | ||
| 256 | "Handle the \"-display\" SWITCH." | ||
| 257 | (setq x-display-name (car x-invocation-args) | ||
| 258 | x-invocation-args (cdr x-invocation-args)) | ||
| 259 | ;; Make subshell programs see the same DISPLAY value Emacs really uses. | ||
| 260 | ;; Note that this isn't completely correct, since Emacs can use | ||
| 261 | ;; multiple displays. However, there is no way to tell an already | ||
| 262 | ;; running subshell which display the user is currently typing on. | ||
| 263 | |||
| 264 | ;; On Windows, this will not have any affect on Windows programs, | ||
| 265 | ;; but might be useful for X programs (running under Cygwin, tramp etc). | ||
| 266 | (setenv "DISPLAY" x-display-name)) | ||
| 267 | |||
| 268 | (defun x-handle-args (args) | ||
| 269 | "Process the X-related command line options in ARGS. | ||
| 270 | This is done before the user's startup file is loaded. They are copied to | ||
| 271 | `x-invocation args' from which the X-related things are extracted, first | ||
| 272 | the switch (e.g., \"-fg\") in the following code, and possible values | ||
| 273 | \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | ||
| 274 | This returns ARGS with the arguments that have been processed removed." | ||
| 275 | ;; We use ARGS to accumulate the args that we don't handle here, to return. | ||
| 276 | (setq x-invocation-args args | ||
| 277 | args nil) | ||
| 278 | (while (and x-invocation-args | ||
| 279 | (not (equal (car x-invocation-args) "--"))) | ||
| 280 | (let* ((this-switch (car x-invocation-args)) | ||
| 281 | (orig-this-switch this-switch) | ||
| 282 | completion argval aelt handler) | ||
| 283 | (setq x-invocation-args (cdr x-invocation-args)) | ||
| 284 | ;; Check for long options with attached arguments | ||
| 285 | ;; and separate out the attached option argument into argval. | ||
| 286 | (if (string-match "^--[^=]*=" this-switch) | ||
| 287 | (setq argval (substring this-switch (match-end 0)) | ||
| 288 | this-switch (substring this-switch 0 (1- (match-end 0))))) | ||
| 289 | ;; Complete names of long options. | ||
| 290 | (if (string-match "^--" this-switch) | ||
| 291 | (progn | ||
| 292 | (setq completion (try-completion this-switch command-line-x-option-alist)) | ||
| 293 | (if (eq completion t) | ||
| 294 | ;; Exact match for long option. | ||
| 295 | nil | ||
| 296 | (if (stringp completion) | ||
| 297 | (let ((elt (assoc completion command-line-x-option-alist))) | ||
| 298 | ;; Check for abbreviated long option. | ||
| 299 | (or elt | ||
| 300 | (error "Option `%s' is ambiguous" this-switch)) | ||
| 301 | (setq this-switch completion)))))) | ||
| 302 | (setq aelt (assoc this-switch command-line-x-option-alist)) | ||
| 303 | (if aelt (setq handler (nth 2 aelt))) | ||
| 304 | (if handler | ||
| 305 | (if argval | ||
| 306 | (let ((x-invocation-args | ||
| 307 | (cons argval x-invocation-args))) | ||
| 308 | (funcall handler this-switch)) | ||
| 309 | (funcall handler this-switch)) | ||
| 310 | (setq args (cons orig-this-switch args))))) | ||
| 311 | (nconc (nreverse args) x-invocation-args)) | ||
| 312 | 151 | ||
| 313 | ;; | ||
| 314 | ;; Available colors | ||
| 315 | ;; | ||
| 316 | ;; The ordering of the colors is chosen for the user's convenience in | ||
| 317 | ;; `list-colors-display', which displays the reverse of this list. | ||
| 318 | ;; Roughly speaking, `list-colors-display' orders by (i) named shades | ||
| 319 | ;; of grey with hue 0.0, sorted by value (ii) named colors with | ||
| 320 | ;; saturation 1.0, sorted by hue, (iii) named non-white colors with | ||
| 321 | ;; saturation less than 1.0, sorted by hue, (iv) other named shades of | ||
| 322 | ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades | ||
| 323 | ;; of grey. | ||
| 324 | |||
| 325 | (defvar x-colors | ||
| 326 | '("gray100" "gray99" "gray98" "gray97" "gray96" "gray95" "gray94" "gray93" "gray92" | ||
| 327 | "gray91" "gray90" "gray89" "gray88" "gray87" "gray86" "gray85" "gray84" "gray83" | ||
| 328 | "gray82" "gray81" "gray80" "gray79" "gray78" "gray77" "gray76" "gray75" "gray74" | ||
| 329 | "gray73" "gray72" "gray71" "gray70" "gray69" "gray68" "gray67" "gray66" "gray65" | ||
| 330 | "gray64" "gray63" "gray62" "gray61" "gray60" "gray59" "gray58" "gray57" "gray56" | ||
| 331 | "gray55" "gray54" "gray53" "gray52" "gray51" "gray50" "gray49" "gray48" "gray47" | ||
| 332 | "gray46" "gray45" "gray44" "gray43" "gray42" "gray41" "gray40" "gray39" "gray38" | ||
| 333 | "gray37" "gray36" "gray35" "gray34" "gray33" "gray32" "gray31" "gray30" "gray29" | ||
| 334 | "gray28" "gray27" "gray26" "gray25" "gray24" "gray23" "gray22" "gray21" "gray20" | ||
| 335 | "gray19" "gray18" "gray17" "gray16" "gray15" "gray14" "gray13" "gray12" "gray11" | ||
| 336 | "gray10" "gray9" "gray8" "gray7" "gray6" "gray5" "gray4" "gray3" "gray2" "gray1" | ||
| 337 | "gray0" "LightPink1" "LightPink2" "LightPink3" "LightPink4" "pink1" "pink2" "pink3" | ||
| 338 | "pink4" "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4" | ||
| 339 | "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" "VioletRed1" | ||
| 340 | "VioletRed2" "VioletRed3" "VioletRed4" "HotPink1" "HotPink2" "HotPink3" "HotPink4" | ||
| 341 | "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" "maroon1" "maroon2" "maroon3" | ||
| 342 | "maroon4" "orchid1" "orchid2" "orchid3" "orchid4" "plum1" "plum2" "plum3" "plum4" | ||
| 343 | "thistle1" "thistle2" "thistle3" "thistle4" "MediumOrchid1" "MediumOrchid2" | ||
| 344 | "MediumOrchid3" "MediumOrchid4" "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" | ||
| 345 | "DarkOrchid4" "purple1" "purple2" "purple3" "purple4" "MediumPurple1" | ||
| 346 | "MediumPurple2" "MediumPurple3" "MediumPurple4" "SlateBlue1" "SlateBlue2" | ||
| 347 | "SlateBlue3" "SlateBlue4" "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4" | ||
| 348 | "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" "SlateGray1" | ||
| 349 | "SlateGray2" "SlateGray3" "SlateGray4" "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" | ||
| 350 | "DodgerBlue4" "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" "SkyBlue1" | ||
| 351 | "SkyBlue2" "SkyBlue3" "SkyBlue4" "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" | ||
| 352 | "LightSkyBlue4" "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" "CadetBlue1" | ||
| 353 | "CadetBlue2" "CadetBlue3" "CadetBlue4" "azure1" "azure2" "azure3" "azure4" | ||
| 354 | "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" "PaleTurquoise1" | ||
| 355 | "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" "DarkSlateGray1" "DarkSlateGray2" | ||
| 356 | "DarkSlateGray3" "DarkSlateGray4" "aquamarine1" "aquamarine2" "aquamarine3" | ||
| 357 | "aquamarine4" "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" "honeydew1" | ||
| 358 | "honeydew2" "honeydew3" "honeydew4" "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" | ||
| 359 | "DarkSeaGreen4" "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4" | ||
| 360 | "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" "OliveDrab1" | ||
| 361 | "OliveDrab2" "OliveDrab3" "OliveDrab4" "ivory1" "ivory2" "ivory3" "ivory4" | ||
| 362 | "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" "khaki1" "khaki2" | ||
| 363 | "khaki3" "khaki4" "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4" | ||
| 364 | "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" "cornsilk1" | ||
| 365 | "cornsilk2" "cornsilk3" "cornsilk4" "goldenrod1" "goldenrod2" "goldenrod3" | ||
| 366 | "goldenrod4" "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4" | ||
| 367 | "wheat1" "wheat2" "wheat3" "wheat4" "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" | ||
| 368 | "NavajoWhite4" "burlywood1" "burlywood2" "burlywood3" "burlywood4" "AntiqueWhite1" | ||
| 369 | "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" "bisque1" "bisque2" "bisque3" | ||
| 370 | "bisque4" "tan1" "tan2" "tan3" "tan4" "PeachPuff1" "PeachPuff2" "PeachPuff3" | ||
| 371 | "PeachPuff4" "seashell1" "seashell2" "seashell3" "seashell4" "chocolate1" | ||
| 372 | "chocolate2" "chocolate3" "chocolate4" "sienna1" "sienna2" "sienna3" "sienna4" | ||
| 373 | "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" "salmon1" "salmon2" | ||
| 374 | "salmon3" "salmon4" "coral1" "coral2" "coral3" "coral4" "tomato1" "tomato2" | ||
| 375 | "tomato3" "tomato4" "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" "snow1" | ||
| 376 | "snow2" "snow3" "snow4" "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4" | ||
| 377 | "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" "firebrick1" "firebrick2" | ||
| 378 | "firebrick3" "firebrick4" "brown1" "brown2" "brown3" "brown4" "magenta1" "magenta2" | ||
| 379 | "magenta3" "magenta4" "blue1" "blue2" "blue3" "blue4" "DeepSkyBlue1" "DeepSkyBlue2" | ||
| 380 | "DeepSkyBlue3" "DeepSkyBlue4" "turquoise1" "turquoise2" "turquoise3" "turquoise4" | ||
| 381 | "cyan1" "cyan2" "cyan3" "cyan4" "SpringGreen1" "SpringGreen2" "SpringGreen3" | ||
| 382 | "SpringGreen4" "green1" "green2" "green3" "green4" "chartreuse1" "chartreuse2" | ||
| 383 | "chartreuse3" "chartreuse4" "yellow1" "yellow2" "yellow3" "yellow4" "gold1" "gold2" | ||
| 384 | "gold3" "gold4" "orange1" "orange2" "orange3" "orange4" "DarkOrange1" "DarkOrange2" | ||
| 385 | "DarkOrange3" "DarkOrange4" "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4" | ||
| 386 | "red1" "red2" "red3" "red4" "lavender blush" "ghost white" "lavender" "alice blue" | ||
| 387 | "azure" "light cyan" "mint cream" "honeydew" "ivory" "light goldenrod yellow" | ||
| 388 | "light yellow" "beige" "floral white" "old lace" "blanched almond" "moccasin" | ||
| 389 | "papaya whip" "bisque" "antique white" "linen" "peach puff" "seashell" "misty rose" | ||
| 390 | "snow" "light pink" "pink" "hot pink" "deep pink" "maroon" "pale violet red" | ||
| 391 | "violet red" "medium violet red" "violet" "plum" "thistle" "orchid" "medium orchid" | ||
| 392 | "dark orchid" "purple" "blue violet" "medium purple" "light slate blue" | ||
| 393 | "medium slate blue" "slate blue" "dark slate blue" "midnight blue" "navy" | ||
| 394 | "dark blue" "light steel blue" "cornflower blue" "dodger blue" "royal blue" | ||
| 395 | "light slate gray" "slate gray" "dark slate gray" "steel blue" "cadet blue" | ||
| 396 | "light sky blue" "sky blue" "light blue" "powder blue" "pale turquoise" "turquoise" | ||
| 397 | "medium turquoise" "dark cyan" "aquamarine" "medium aquamarine" "light sea green" | ||
| 398 | "medium sea green" "sea green" "dark sea green" "pale green" "lime green" | ||
| 399 | "forest green" "light green" "green yellow" "yellow green" "olive drab" | ||
| 400 | "dark olive green" "lemon chiffon" "khaki" "dark khaki" "cornsilk" | ||
| 401 | "pale goldenrod" "light goldenrod" "goldenrod" "dark goldenrod" "wheat" | ||
| 402 | "navajo white" "tan" "burlywood" "sandy brown" "peru" "chocolate" "saddle brown" | ||
| 403 | "sienna" "rosy brown" "dark salmon" "coral" "tomato" "light salmon" "salmon" | ||
| 404 | "light coral" "indian red" "firebrick" "brown" "dark red" "magenta" | ||
| 405 | "dark magenta" "dark violet" "medium blue" "blue" "deep sky blue" | ||
| 406 | "cyan" "medium spring green" "spring green" "green" "lawn green" "chartreuse" | ||
| 407 | "yellow" "gold" "orange" "dark orange" "orange red" "red" "white" "white smoke" | ||
| 408 | "gainsboro" "light grey" "gray" "dark grey" "dim gray" "black" ) | ||
| 409 | "The list of X colors from the `rgb.txt' file. | ||
| 410 | XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | ||
| 411 | |||
| 412 | (defun xw-defined-colors (&optional frame) | 152 | (defun xw-defined-colors (&optional frame) |
| 413 | "Internal function called by `defined-colors', which see." | 153 | "Internal function called by `defined-colors', which see." |
| 414 | (or frame (setq frame (selected-frame))) | 154 | (or frame (setq frame (selected-frame))) |
| @@ -418,7 +158,6 @@ XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | |||
| 418 | (setq defined-colors (cons this-color defined-colors)))) | 158 | (setq defined-colors (cons this-color defined-colors)))) |
| 419 | defined-colors)) | 159 | defined-colors)) |
| 420 | 160 | ||
| 421 | |||
| 422 | ;;;; Function keys | 161 | ;;;; Function keys |
| 423 | 162 | ||
| 424 | ;;; make f10 activate the real menubar rather than the mini-buffer menu | 163 | ;;; make f10 activate the real menubar rather than the mini-buffer menu |
diff --git a/lisp/term/x-win.el b/lisp/term/x-win.el index fed2081d66e..4bcbb3e7031 100644 --- a/lisp/term/x-win.el +++ b/lisp/term/x-win.el | |||
| @@ -87,111 +87,9 @@ | |||
| 87 | (defvar x-session-id) | 87 | (defvar x-session-id) |
| 88 | (defvar x-session-previous-id) | 88 | (defvar x-session-previous-id) |
| 89 | 89 | ||
| 90 | (defvar x-command-line-resources nil) | ||
| 91 | |||
| 92 | ;; Handler for switches of the form "-switch value" or "-switch". | ||
| 93 | (defun x-handle-switch (switch) | ||
| 94 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 95 | (if aelt | ||
| 96 | (let ((param (nth 3 aelt)) | ||
| 97 | (value (nth 4 aelt))) | ||
| 98 | (if value | ||
| 99 | (setq default-frame-alist | ||
| 100 | (cons (cons param value) | ||
| 101 | default-frame-alist)) | ||
| 102 | (setq default-frame-alist | ||
| 103 | (cons (cons param | ||
| 104 | (car x-invocation-args)) | ||
| 105 | default-frame-alist) | ||
| 106 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 107 | |||
| 108 | ;; Handler for switches of the form "-switch n" | ||
| 109 | (defun x-handle-numeric-switch (switch) | ||
| 110 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 111 | (if aelt | ||
| 112 | (let ((param (nth 3 aelt))) | ||
| 113 | (setq default-frame-alist | ||
| 114 | (cons (cons param | ||
| 115 | (string-to-number (car x-invocation-args))) | ||
| 116 | default-frame-alist) | ||
| 117 | x-invocation-args | ||
| 118 | (cdr x-invocation-args)))))) | ||
| 119 | |||
| 120 | ;; Handle options that apply to initial frame only | ||
| 121 | (defun x-handle-initial-switch (switch) | ||
| 122 | (let ((aelt (assoc switch command-line-x-option-alist))) | ||
| 123 | (if aelt | ||
| 124 | (let ((param (nth 3 aelt)) | ||
| 125 | (value (nth 4 aelt))) | ||
| 126 | (if value | ||
| 127 | (setq initial-frame-alist | ||
| 128 | (cons (cons param value) | ||
| 129 | initial-frame-alist)) | ||
| 130 | (setq initial-frame-alist | ||
| 131 | (cons (cons param | ||
| 132 | (car x-invocation-args)) | ||
| 133 | initial-frame-alist) | ||
| 134 | x-invocation-args (cdr x-invocation-args))))))) | ||
| 135 | |||
| 136 | (defun x-handle-no-bitmap-icon (switch) | 90 | (defun x-handle-no-bitmap-icon (switch) |
| 137 | (setq default-frame-alist (cons '(icon-type) default-frame-alist))) | 91 | (setq default-frame-alist (cons '(icon-type) default-frame-alist))) |
| 138 | 92 | ||
| 139 | ;; Make -iconic apply only to the initial frame! | ||
| 140 | (defun x-handle-iconic (switch) | ||
| 141 | (setq initial-frame-alist | ||
| 142 | (cons '(visibility . icon) initial-frame-alist))) | ||
| 143 | |||
| 144 | ;; Handle the -xrm option. | ||
| 145 | (defun x-handle-xrm-switch (switch) | ||
| 146 | (unless (consp x-invocation-args) | ||
| 147 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 148 | (setq x-command-line-resources | ||
| 149 | (if (null x-command-line-resources) | ||
| 150 | (car x-invocation-args) | ||
| 151 | (concat x-command-line-resources "\n" (car x-invocation-args)))) | ||
| 152 | (setq x-invocation-args (cdr x-invocation-args))) | ||
| 153 | |||
| 154 | (declare-function x-parse-geometry "frame.c" (string)) | ||
| 155 | |||
| 156 | ;; Handle the geometry option | ||
| 157 | (defun x-handle-geometry (switch) | ||
| 158 | (let* ((geo (x-parse-geometry (car x-invocation-args))) | ||
| 159 | (left (assq 'left geo)) | ||
| 160 | (top (assq 'top geo)) | ||
| 161 | (height (assq 'height geo)) | ||
| 162 | (width (assq 'width geo))) | ||
| 163 | (if (or height width) | ||
| 164 | (setq default-frame-alist | ||
| 165 | (append default-frame-alist | ||
| 166 | '((user-size . t)) | ||
| 167 | (if height (list height)) | ||
| 168 | (if width (list width))) | ||
| 169 | initial-frame-alist | ||
| 170 | (append initial-frame-alist | ||
| 171 | '((user-size . t)) | ||
| 172 | (if height (list height)) | ||
| 173 | (if width (list width))))) | ||
| 174 | (if (or left top) | ||
| 175 | (setq initial-frame-alist | ||
| 176 | (append initial-frame-alist | ||
| 177 | '((user-position . t)) | ||
| 178 | (if left (list left)) | ||
| 179 | (if top (list top))))) | ||
| 180 | (setq x-invocation-args (cdr x-invocation-args)))) | ||
| 181 | |||
| 182 | (defvar x-resource-name) | ||
| 183 | |||
| 184 | ;; Handle the -name option. Set the variable x-resource-name | ||
| 185 | ;; to the option's operand; set the name of | ||
| 186 | ;; the initial frame, too. | ||
| 187 | (defun x-handle-name-switch (switch) | ||
| 188 | (or (consp x-invocation-args) | ||
| 189 | (error "%s: missing argument to `%s' option" (invocation-name) switch)) | ||
| 190 | (setq x-resource-name (car x-invocation-args) | ||
| 191 | x-invocation-args (cdr x-invocation-args)) | ||
| 192 | (setq initial-frame-alist (cons (cons 'name x-resource-name) | ||
| 193 | initial-frame-alist))) | ||
| 194 | |||
| 195 | ;; Handle the --parent-id option. | 93 | ;; Handle the --parent-id option. |
| 196 | (defun x-handle-parent-id (switch) | 94 | (defun x-handle-parent-id (switch) |
| 197 | (or (consp x-invocation-args) | 95 | (or (consp x-invocation-args) |
| @@ -202,67 +100,6 @@ | |||
| 202 | initial-frame-alist) | 100 | initial-frame-alist) |
| 203 | x-invocation-args (cdr x-invocation-args))) | 101 | x-invocation-args (cdr x-invocation-args))) |
| 204 | 102 | ||
| 205 | (defvar x-display-name nil | ||
| 206 | "The name of the X display on which Emacs was started. | ||
| 207 | |||
| 208 | For the X display name of individual frames, see the `display' | ||
| 209 | frame parameter.") | ||
| 210 | |||
| 211 | (defun x-handle-display (switch) | ||
| 212 | "Handle -display DISPLAY option." | ||
| 213 | (setq x-display-name (car x-invocation-args) | ||
| 214 | x-invocation-args (cdr x-invocation-args)) | ||
| 215 | ;; Make subshell programs see the same DISPLAY value Emacs really uses. | ||
| 216 | ;; Note that this isn't completely correct, since Emacs can use | ||
| 217 | ;; multiple displays. However, there is no way to tell an already | ||
| 218 | ;; running subshell which display the user is currently typing on. | ||
| 219 | (setenv "DISPLAY" x-display-name)) | ||
| 220 | |||
| 221 | (defun x-handle-args (args) | ||
| 222 | "Process the X-related command line options in ARGS. | ||
| 223 | This is done before the user's startup file is loaded. They are copied to | ||
| 224 | `x-invocation-args', from which the X-related things are extracted, first | ||
| 225 | the switch (e.g., \"-fg\") in the following code, and possible values | ||
| 226 | \(e.g., \"black\") in the option handler code (e.g., x-handle-switch). | ||
| 227 | This function returns ARGS minus the arguments that have been processed." | ||
| 228 | ;; We use ARGS to accumulate the args that we don't handle here, to return. | ||
| 229 | (setq x-invocation-args args | ||
| 230 | args nil) | ||
| 231 | (while (and x-invocation-args | ||
| 232 | (not (equal (car x-invocation-args) "--"))) | ||
| 233 | (let* ((this-switch (car x-invocation-args)) | ||
| 234 | (orig-this-switch this-switch) | ||
| 235 | completion argval aelt handler) | ||
| 236 | (setq x-invocation-args (cdr x-invocation-args)) | ||
| 237 | ;; Check for long options with attached arguments | ||
| 238 | ;; and separate out the attached option argument into argval. | ||
| 239 | (if (string-match "^--[^=]*=" this-switch) | ||
| 240 | (setq argval (substring this-switch (match-end 0)) | ||
| 241 | this-switch (substring this-switch 0 (1- (match-end 0))))) | ||
| 242 | ;; Complete names of long options. | ||
| 243 | (if (string-match "^--" this-switch) | ||
| 244 | (progn | ||
| 245 | (setq completion (try-completion this-switch command-line-x-option-alist)) | ||
| 246 | (if (eq completion t) | ||
| 247 | ;; Exact match for long option. | ||
| 248 | nil | ||
| 249 | (if (stringp completion) | ||
| 250 | (let ((elt (assoc completion command-line-x-option-alist))) | ||
| 251 | ;; Check for abbreviated long option. | ||
| 252 | (or elt | ||
| 253 | (error "Option `%s' is ambiguous" this-switch)) | ||
| 254 | (setq this-switch completion)))))) | ||
| 255 | (setq aelt (assoc this-switch command-line-x-option-alist)) | ||
| 256 | (if aelt (setq handler (nth 2 aelt))) | ||
| 257 | (if handler | ||
| 258 | (if argval | ||
| 259 | (let ((x-invocation-args | ||
| 260 | (cons argval x-invocation-args))) | ||
| 261 | (funcall handler this-switch)) | ||
| 262 | (funcall handler this-switch)) | ||
| 263 | (setq args (cons orig-this-switch args))))) | ||
| 264 | (nconc (nreverse args) x-invocation-args)) | ||
| 265 | |||
| 266 | ;; Handle the --smid switch. This is used by the session manager | 103 | ;; Handle the --smid switch. This is used by the session manager |
| 267 | ;; to give us back our session id we had on the previous run. | 104 | ;; to give us back our session id we had on the previous run. |
| 268 | (defun x-handle-smid (switch) | 105 | (defun x-handle-smid (switch) |
| @@ -414,106 +251,8 @@ exists." | |||
| 414 | (defconst x-pointer-watch 150) | 251 | (defconst x-pointer-watch 150) |
| 415 | (defconst x-pointer-xterm 152) | 252 | (defconst x-pointer-xterm 152) |
| 416 | (defconst x-pointer-invisible 255) | 253 | (defconst x-pointer-invisible 255) |
| 417 | |||
| 418 | ;; | ||
| 419 | ;; Available colors | ||
| 420 | ;; | ||
| 421 | ;; The ordering of the colors is chosen for the user's convenience in | ||
| 422 | ;; `list-colors-display', which displays the reverse of this list. | ||
| 423 | ;; Roughly speaking, `list-colors-display' orders by (i) named shades | ||
| 424 | ;; of grey with hue 0.0, sorted by value (ii) named colors with | ||
| 425 | ;; saturation 1.0, sorted by hue, (iii) named non-white colors with | ||
| 426 | ;; saturation less than 1.0, sorted by hue, (iv) other named shades of | ||
| 427 | ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades | ||
| 428 | ;; of grey. | ||
| 429 | |||
| 430 | (defvar x-colors | ||
| 431 | '("gray100" "gray99" "gray98" "gray97" "gray96" "gray95" "gray94" "gray93" "gray92" | ||
| 432 | "gray91" "gray90" "gray89" "gray88" "gray87" "gray86" "gray85" "gray84" "gray83" | ||
| 433 | "gray82" "gray81" "gray80" "gray79" "gray78" "gray77" "gray76" "gray75" "gray74" | ||
| 434 | "gray73" "gray72" "gray71" "gray70" "gray69" "gray68" "gray67" "gray66" "gray65" | ||
| 435 | "gray64" "gray63" "gray62" "gray61" "gray60" "gray59" "gray58" "gray57" "gray56" | ||
| 436 | "gray55" "gray54" "gray53" "gray52" "gray51" "gray50" "gray49" "gray48" "gray47" | ||
| 437 | "gray46" "gray45" "gray44" "gray43" "gray42" "gray41" "gray40" "gray39" "gray38" | ||
| 438 | "gray37" "gray36" "gray35" "gray34" "gray33" "gray32" "gray31" "gray30" "gray29" | ||
| 439 | "gray28" "gray27" "gray26" "gray25" "gray24" "gray23" "gray22" "gray21" "gray20" | ||
| 440 | "gray19" "gray18" "gray17" "gray16" "gray15" "gray14" "gray13" "gray12" "gray11" | ||
| 441 | "gray10" "gray9" "gray8" "gray7" "gray6" "gray5" "gray4" "gray3" "gray2" "gray1" | ||
| 442 | "gray0" "LightPink1" "LightPink2" "LightPink3" "LightPink4" "pink1" "pink2" "pink3" | ||
| 443 | "pink4" "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4" | ||
| 444 | "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" "VioletRed1" | ||
| 445 | "VioletRed2" "VioletRed3" "VioletRed4" "HotPink1" "HotPink2" "HotPink3" "HotPink4" | ||
| 446 | "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" "maroon1" "maroon2" "maroon3" | ||
| 447 | "maroon4" "orchid1" "orchid2" "orchid3" "orchid4" "plum1" "plum2" "plum3" "plum4" | ||
| 448 | "thistle1" "thistle2" "thistle3" "thistle4" "MediumOrchid1" "MediumOrchid2" | ||
| 449 | "MediumOrchid3" "MediumOrchid4" "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" | ||
| 450 | "DarkOrchid4" "purple1" "purple2" "purple3" "purple4" "MediumPurple1" | ||
| 451 | "MediumPurple2" "MediumPurple3" "MediumPurple4" "SlateBlue1" "SlateBlue2" | ||
| 452 | "SlateBlue3" "SlateBlue4" "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4" | ||
| 453 | "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" "SlateGray1" | ||
| 454 | "SlateGray2" "SlateGray3" "SlateGray4" "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" | ||
| 455 | "DodgerBlue4" "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" "SkyBlue1" | ||
| 456 | "SkyBlue2" "SkyBlue3" "SkyBlue4" "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" | ||
| 457 | "LightSkyBlue4" "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" "CadetBlue1" | ||
| 458 | "CadetBlue2" "CadetBlue3" "CadetBlue4" "azure1" "azure2" "azure3" "azure4" | ||
| 459 | "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" "PaleTurquoise1" | ||
| 460 | "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" "DarkSlateGray1" "DarkSlateGray2" | ||
| 461 | "DarkSlateGray3" "DarkSlateGray4" "aquamarine1" "aquamarine2" "aquamarine3" | ||
| 462 | "aquamarine4" "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" "honeydew1" | ||
| 463 | "honeydew2" "honeydew3" "honeydew4" "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" | ||
| 464 | "DarkSeaGreen4" "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4" | ||
| 465 | "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" "OliveDrab1" | ||
| 466 | "OliveDrab2" "OliveDrab3" "OliveDrab4" "ivory1" "ivory2" "ivory3" "ivory4" | ||
| 467 | "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" "khaki1" "khaki2" | ||
| 468 | "khaki3" "khaki4" "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4" | ||
| 469 | "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" "cornsilk1" | ||
| 470 | "cornsilk2" "cornsilk3" "cornsilk4" "goldenrod1" "goldenrod2" "goldenrod3" | ||
| 471 | "goldenrod4" "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4" | ||
| 472 | "wheat1" "wheat2" "wheat3" "wheat4" "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" | ||
| 473 | "NavajoWhite4" "burlywood1" "burlywood2" "burlywood3" "burlywood4" "AntiqueWhite1" | ||
| 474 | "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" "bisque1" "bisque2" "bisque3" | ||
| 475 | "bisque4" "tan1" "tan2" "tan3" "tan4" "PeachPuff1" "PeachPuff2" "PeachPuff3" | ||
| 476 | "PeachPuff4" "seashell1" "seashell2" "seashell3" "seashell4" "chocolate1" | ||
| 477 | "chocolate2" "chocolate3" "chocolate4" "sienna1" "sienna2" "sienna3" "sienna4" | ||
| 478 | "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" "salmon1" "salmon2" | ||
| 479 | "salmon3" "salmon4" "coral1" "coral2" "coral3" "coral4" "tomato1" "tomato2" | ||
| 480 | "tomato3" "tomato4" "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" "snow1" | ||
| 481 | "snow2" "snow3" "snow4" "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4" | ||
| 482 | "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" "firebrick1" "firebrick2" | ||
| 483 | "firebrick3" "firebrick4" "brown1" "brown2" "brown3" "brown4" "magenta1" "magenta2" | ||
| 484 | "magenta3" "magenta4" "blue1" "blue2" "blue3" "blue4" "DeepSkyBlue1" "DeepSkyBlue2" | ||
| 485 | "DeepSkyBlue3" "DeepSkyBlue4" "turquoise1" "turquoise2" "turquoise3" "turquoise4" | ||
| 486 | "cyan1" "cyan2" "cyan3" "cyan4" "SpringGreen1" "SpringGreen2" "SpringGreen3" | ||
| 487 | "SpringGreen4" "green1" "green2" "green3" "green4" "chartreuse1" "chartreuse2" | ||
| 488 | "chartreuse3" "chartreuse4" "yellow1" "yellow2" "yellow3" "yellow4" "gold1" "gold2" | ||
| 489 | "gold3" "gold4" "orange1" "orange2" "orange3" "orange4" "DarkOrange1" "DarkOrange2" | ||
| 490 | "DarkOrange3" "DarkOrange4" "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4" | ||
| 491 | "red1" "red2" "red3" "red4" "lavender blush" "ghost white" "lavender" "alice blue" | ||
| 492 | "azure" "light cyan" "mint cream" "honeydew" "ivory" "light goldenrod yellow" | ||
| 493 | "light yellow" "beige" "floral white" "old lace" "blanched almond" "moccasin" | ||
| 494 | "papaya whip" "bisque" "antique white" "linen" "peach puff" "seashell" "misty rose" | ||
| 495 | "snow" "light pink" "pink" "hot pink" "deep pink" "maroon" "pale violet red" | ||
| 496 | "violet red" "medium violet red" "violet" "plum" "thistle" "orchid" "medium orchid" | ||
| 497 | "dark orchid" "purple" "blue violet" "medium purple" "light slate blue" | ||
| 498 | "medium slate blue" "slate blue" "dark slate blue" "midnight blue" "navy" | ||
| 499 | "dark blue" "light steel blue" "cornflower blue" "dodger blue" "royal blue" | ||
| 500 | "light slate gray" "slate gray" "dark slate gray" "steel blue" "cadet blue" | ||
| 501 | "light sky blue" "sky blue" "light blue" "powder blue" "pale turquoise" "turquoise" | ||
| 502 | "medium turquoise" "dark cyan" "aquamarine" "medium aquamarine" "light sea green" | ||
| 503 | "medium sea green" "sea green" "dark sea green" "pale green" "lime green" | ||
| 504 | "forest green" "light green" "green yellow" "yellow green" "olive drab" | ||
| 505 | "dark olive green" "lemon chiffon" "khaki" "dark khaki" "cornsilk" | ||
| 506 | "pale goldenrod" "light goldenrod" "goldenrod" "dark goldenrod" "wheat" | ||
| 507 | "navajo white" "tan" "burlywood" "sandy brown" "peru" "chocolate" "saddle brown" | ||
| 508 | "sienna" "rosy brown" "dark salmon" "coral" "tomato" "light salmon" "salmon" | ||
| 509 | "light coral" "indian red" "firebrick" "brown" "dark red" "magenta" | ||
| 510 | "dark magenta" "dark violet" "medium blue" "blue" "deep sky blue" | ||
| 511 | "cyan" "medium spring green" "spring green" "green" "lawn green" "chartreuse" | ||
| 512 | "yellow" "gold" "orange" "dark orange" "orange red" "red" "white" "white smoke" | ||
| 513 | "gainsboro" "light grey" "gray" "dark grey" "dim gray" "black" ) | ||
| 514 | "The list of X colors from the `rgb.txt' file. | ||
| 515 | XConsortium: rgb.txt,v 10.41 94/02/20 18:39:36 rws Exp") | ||
| 516 | 254 | ||
| 255 | |||
| 517 | (defun xw-defined-colors (&optional frame) | 256 | (defun xw-defined-colors (&optional frame) |
| 518 | "Internal function called by `defined-colors', which see." | 257 | "Internal function called by `defined-colors', which see." |
| 519 | (or frame (setq frame (selected-frame))) | 258 | (or frame (setq frame (selected-frame))) |