annotate lisp/term/common-win.el @ 111185:050a28bd1797

Remove ns-handle-* functions that duplicate x-handle-*. * lisp/term/ns-win.el (ns-version-string): Remove unused declaration. (ns-invocation-args): Change to x-invocation-args. (ns-handle-switch, ns-handle-numeric-switch, ns-handle-iconic) (ns-handle-name-switch, ns-ignore-2-arg): Remove. (ns-handle-nxopen, ns-handle-nxopentemp, ns-ignore-1-arg): Use x-invocation-args instead of ns-invocation-args. (ns-initialize-window-system, handle-args-function-alist): Use x-handle-args instead of ns-handle-args. * lisp/term/common-win.el (x-handle-args): Also handle nextstep arguments. * lisp/startup.el (command-line-ns-option-alist): Replace ns-handle-name-switch, ns-handle-switch, ns-handle-numeric-switch, ns-handle-iconic with the x- equivalents.
author Glenn Morris <rgm@gnu.org>
date Mon, 25 Oct 2010 20:58:19 -0700
parents 72ef880ed198
children ed5bac97776a
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
1 ;;; common-win.el --- common part of handling window systems
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
2
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
3 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
5
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
6 ;; Maintainer: FSF
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
7 ;; Keywords: terminals
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
8
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
10
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
11 ;; GNU Emacs is free software: you can redistribute it and/or modify
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
13 ;; the Free Software Foundation, either version 3 of the License, or
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
14 ;; (at your option) any later version.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
15
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
19 ;; GNU General Public License for more details.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
20
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
22 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
23
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
24 ;;; Commentary:
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
25
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
26 ;;; Code:
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
27
111134
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
28 (defcustom x-select-enable-clipboard t
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
29 "Non-nil means cutting and pasting uses the clipboard.
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
30 This is in addition to, but in preference to, the primary selection.
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
31
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
32 Note that MS-Windows does not support selection types other than the
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
33 clipboard. (The primary selection that is set by Emacs is not
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
34 accessible to other programs on MS-Windows.)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
35
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
36 This variable is not used by the Nextstep port."
111134
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
37 :type 'boolean
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
38 :group 'killing
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
39 ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not.
a3c68a313b81 Reduce duplicate definitions of x-select-enable-clipboard from 3 to 2.
Glenn Morris <rgm@gnu.org>
parents: 108979
diff changeset
40 :version "24.1")
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
41
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
42 (defvar x-last-selected-text) ; w32-fns.el
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
43 (declare-function w32-set-clipboard-data "w32select.c"
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
44 (string &optional ignored))
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
45 (defvar ns-last-selected-text) ; ns-win.el
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
46 (declare-function ns-set-pasteboard "ns-win" (string))
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
47
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
48 (defun x-select-text (text)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
49 "Select TEXT, a string, according to the window system.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
50
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
51 On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
52 clipboard. If `x-select-enable-primary' is non-nil, put TEXT in
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
53 the primary selection.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
54
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
55 On MS-Windows, make TEXT the current selection. If
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
56 `x-select-enable-clipboard' is non-nil, copy the text to the
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
57 clipboard as well.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
58
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
59 On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
60 is not used)."
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
61 (cond ((eq system-type 'windows-nt)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
62 (if x-select-enable-clipboard
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
63 (w32-set-clipboard-data text))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
64 (setq x-last-selected-text text))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
65 ((featurep 'ns)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
66 ;; Don't send the pasteboard too much text.
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
67 ;; It becomes slow, and if really big it causes errors.
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
68 (ns-set-pasteboard text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
69 (setq ns-last-selected-text text))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
70 (t
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
71 ;; With multi-tty, this function may be called from a tty frame.
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
72 (when (eq (framep (selected-frame)) 'x)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
73 (when x-select-enable-primary
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
74 (x-set-selection 'PRIMARY text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
75 (setq x-last-selected-text-primary text))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
76 (when x-select-enable-clipboard
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
77 (x-set-selection 'CLIPBOARD text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
78 (setq x-last-selected-text-clipboard text))))))
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
79
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
80 ;;;; Function keys
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
81
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
82 (defvar x-alternatives-map
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
83 (let ((map (make-sparse-keymap)))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
84 ;; Map certain keypad keys into ASCII characters that people usually expect.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
85 (define-key map [M-backspace] [?\M-\d])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
86 (define-key map [M-delete] [?\M-\d])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
87 (define-key map [M-tab] [?\M-\t])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
88 (define-key map [M-linefeed] [?\M-\n])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
89 (define-key map [M-clear] [?\M-\C-l])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
90 (define-key map [M-return] [?\M-\C-m])
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
91 (define-key map [M-escape] [?\M-\e])
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
92 (unless (featurep 'ns)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
93 (define-key map [iso-lefttab] [backtab])
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
94 (define-key map [S-iso-lefttab] [backtab]))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
95 (and (or (eq system-type 'windows-nt)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
96 (featurep 'ns))
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
97 (define-key map [S-tab] [backtab]))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
98 map)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
99 "Keymap of possible alternative meanings for some keys.")
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
100
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
101 (defun x-setup-function-keys (frame)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
102 "Set up `function-key-map' on the graphical frame FRAME."
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
103 ;; Don't do this twice on the same display, or it would break
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
104 ;; normal-erase-is-backspace-mode.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
105 (unless (terminal-parameter frame 'x-setup-function-keys)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
106 ;; Map certain keypad keys into ASCII characters that people usually expect.
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
107 (with-selected-frame frame
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
108 (let ((map (copy-keymap x-alternatives-map)))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
109 (set-keymap-parent map (keymap-parent local-function-key-map))
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
110 (set-keymap-parent local-function-key-map map))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
111 (when (featurep 'ns)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
112 (setq interprogram-cut-function 'x-select-text
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
113 interprogram-paste-function 'x-selection-value
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
114 system-key-alist
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
115 (list
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
116 (cons (logior (lsh 0 16) 1) 'ns-power-off)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
117 (cons (logior (lsh 0 16) 2) 'ns-open-file)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
118 (cons (logior (lsh 0 16) 3) 'ns-open-temp-file)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
119 (cons (logior (lsh 0 16) 4) 'ns-drag-file)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
120 (cons (logior (lsh 0 16) 5) 'ns-drag-color)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
121 (cons (logior (lsh 0 16) 6) 'ns-drag-text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
122 (cons (logior (lsh 0 16) 7) 'ns-change-font)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
123 (cons (logior (lsh 0 16) 8) 'ns-open-file-line)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
124 ;;; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
125 ;;; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
126 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
127 (cons (logior (lsh 0 16) 12) 'ns-new-frame)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
128 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
129 (cons (logior (lsh 0 16) 14) 'ns-show-prefs)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
130 (cons (logior (lsh 1 16) 32) 'f1)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
131 (cons (logior (lsh 1 16) 33) 'f2)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
132 (cons (logior (lsh 1 16) 34) 'f3)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
133 (cons (logior (lsh 1 16) 35) 'f4)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
134 (cons (logior (lsh 1 16) 36) 'f5)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
135 (cons (logior (lsh 1 16) 37) 'f6)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
136 (cons (logior (lsh 1 16) 38) 'f7)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
137 (cons (logior (lsh 1 16) 39) 'f8)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
138 (cons (logior (lsh 1 16) 40) 'f9)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
139 (cons (logior (lsh 1 16) 41) 'f10)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
140 (cons (logior (lsh 1 16) 42) 'f11)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
141 (cons (logior (lsh 1 16) 43) 'f12)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
142 (cons (logior (lsh 1 16) 44) 'kp-insert)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
143 (cons (logior (lsh 1 16) 45) 'kp-delete)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
144 (cons (logior (lsh 1 16) 46) 'kp-home)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
145 (cons (logior (lsh 1 16) 47) 'kp-end)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
146 (cons (logior (lsh 1 16) 48) 'kp-prior)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
147 (cons (logior (lsh 1 16) 49) 'kp-next)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
148 (cons (logior (lsh 1 16) 50) 'print-screen)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
149 (cons (logior (lsh 1 16) 51) 'scroll-lock)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
150 (cons (logior (lsh 1 16) 52) 'pause)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
151 (cons (logior (lsh 1 16) 53) 'system)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
152 (cons (logior (lsh 1 16) 54) 'break)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
153 ;; Erm, this looks like a FIXME...
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
154 (cons (logior (lsh 1 16) 56)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
155 'please-tell-carl-what-this-key-is-called-56)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
156 (cons (logior (lsh 1 16) 61)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
157 'please-tell-carl-what-this-key-is-called-61)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
158 (cons (logior (lsh 1 16) 62)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
159 'please-tell-carl-what-this-key-is-called-62)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
160 (cons (logior (lsh 1 16) 63)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
161 'please-tell-carl-what-this-key-is-called-63)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
162 (cons (logior (lsh 1 16) 64)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
163 'please-tell-carl-what-this-key-is-called-64)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
164 (cons (logior (lsh 1 16) 69)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
165 'please-tell-carl-what-this-key-is-called-69)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
166 (cons (logior (lsh 1 16) 70)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
167 'please-tell-carl-what-this-key-is-called-70)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
168 (cons (logior (lsh 1 16) 71)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
169 'please-tell-carl-what-this-key-is-called-71)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
170 (cons (logior (lsh 1 16) 72)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
171 'please-tell-carl-what-this-key-is-called-72)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
172 (cons (logior (lsh 1 16) 73)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
173 'please-tell-carl-what-this-key-is-called-73)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
174 (cons (logior (lsh 2 16) 3) 'kp-enter)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
175 (cons (logior (lsh 2 16) 9) 'kp-tab)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
176 (cons (logior (lsh 2 16) 28) 'kp-quit)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
177 (cons (logior (lsh 2 16) 35) 'kp-hash)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
178 (cons (logior (lsh 2 16) 42) 'kp-multiply)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
179 (cons (logior (lsh 2 16) 43) 'kp-add)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
180 (cons (logior (lsh 2 16) 44) 'kp-separator)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
181 (cons (logior (lsh 2 16) 45) 'kp-subtract)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
182 (cons (logior (lsh 2 16) 46) 'kp-decimal)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
183 (cons (logior (lsh 2 16) 47) 'kp-divide)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
184 (cons (logior (lsh 2 16) 48) 'kp-0)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
185 (cons (logior (lsh 2 16) 49) 'kp-1)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
186 (cons (logior (lsh 2 16) 50) 'kp-2)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
187 (cons (logior (lsh 2 16) 51) 'kp-3)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
188 (cons (logior (lsh 2 16) 52) 'kp-4)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
189 (cons (logior (lsh 2 16) 53) 'kp-5)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
190 (cons (logior (lsh 2 16) 54) 'kp-6)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
191 (cons (logior (lsh 2 16) 55) 'kp-7)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
192 (cons (logior (lsh 2 16) 56) 'kp-8)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
193 (cons (logior (lsh 2 16) 57) 'kp-9)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
194 (cons (logior (lsh 2 16) 60) 'kp-less)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
195 (cons (logior (lsh 2 16) 61) 'kp-equal)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
196 (cons (logior (lsh 2 16) 62) 'kp-more)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
197 (cons (logior (lsh 2 16) 64) 'kp-at)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
198 (cons (logior (lsh 2 16) 92) 'kp-backslash)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
199 (cons (logior (lsh 2 16) 96) 'kp-backtick)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
200 (cons (logior (lsh 2 16) 124) 'kp-bar)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
201 (cons (logior (lsh 2 16) 126) 'kp-tilde)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
202 (cons (logior (lsh 2 16) 157) 'kp-mu)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
203 (cons (logior (lsh 2 16) 165) 'kp-yen)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
204 (cons (logior (lsh 2 16) 167) 'kp-paragraph)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
205 (cons (logior (lsh 2 16) 172) 'left)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
206 (cons (logior (lsh 2 16) 173) 'up)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
207 (cons (logior (lsh 2 16) 174) 'right)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
208 (cons (logior (lsh 2 16) 175) 'down)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
209 (cons (logior (lsh 2 16) 176) 'kp-ring)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
210 (cons (logior (lsh 2 16) 201) 'kp-square)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
211 (cons (logior (lsh 2 16) 204) 'kp-cube)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
212 (cons (logior (lsh 3 16) 8) 'backspace)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
213 (cons (logior (lsh 3 16) 9) 'tab)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
214 (cons (logior (lsh 3 16) 10) 'linefeed)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
215 (cons (logior (lsh 3 16) 11) 'clear)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
216 (cons (logior (lsh 3 16) 13) 'return)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
217 (cons (logior (lsh 3 16) 18) 'pause)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
218 (cons (logior (lsh 3 16) 25) 'S-tab)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
219 (cons (logior (lsh 3 16) 27) 'escape)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
220 (cons (logior (lsh 3 16) 127) 'delete)))))
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
221 (set-terminal-parameter frame 'x-setup-function-keys t)))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
222
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
223 (defvar x-invocation-args)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
224
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
225 (defvar x-command-line-resources nil)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
226
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
227 ;; Handler for switches of the form "-switch value" or "-switch".
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
228 (defun x-handle-switch (switch &optional numeric)
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
229 (let ((aelt (assoc switch command-line-x-option-alist)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
230 (if aelt
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
231 (setq default-frame-alist
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
232 (cons (cons (nth 3 aelt)
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
233 (if numeric
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
234 (string-to-number (pop x-invocation-args))
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
235 (or (nth 4 aelt) (pop x-invocation-args))))
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
236 default-frame-alist)))))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
237
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
238 ;; Handler for switches of the form "-switch n"
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
239 (defun x-handle-numeric-switch (switch)
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
240 (x-handle-switch switch t))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
241
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
242 ;; Handle options that apply to initial frame only
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
243 (defun x-handle-initial-switch (switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
244 (let ((aelt (assoc switch command-line-x-option-alist)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
245 (if aelt
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
246 (setq initial-frame-alist
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
247 (cons (cons (nth 3 aelt)
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
248 (or (nth 4 aelt) (pop x-invocation-args)))
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
249 initial-frame-alist)))))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
250
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
251 ;; Make -iconic apply only to the initial frame!
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
252 (defun x-handle-iconic (switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
253 (setq initial-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
254 (cons '(visibility . icon) initial-frame-alist)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
255
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
256 ;; Handle the -xrm option.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
257 (defun x-handle-xrm-switch (switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
258 (unless (consp x-invocation-args)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
259 (error "%s: missing argument to `%s' option" (invocation-name) switch))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
260 (setq x-command-line-resources
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
261 (if (null x-command-line-resources)
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
262 (pop x-invocation-args)
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
263 (concat x-command-line-resources "\n" (pop x-invocation-args)))))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
264
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
265 (declare-function x-parse-geometry "frame.c" (string))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
266
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
267 ;; Handle the geometry option
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
268 (defun x-handle-geometry (switch)
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
269 (let* ((geo (x-parse-geometry (pop x-invocation-args)))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
270 (left (assq 'left geo))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
271 (top (assq 'top geo))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
272 (height (assq 'height geo))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
273 (width (assq 'width geo)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
274 (if (or height width)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
275 (setq default-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
276 (append default-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
277 '((user-size . t))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
278 (if height (list height))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
279 (if width (list width)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
280 initial-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
281 (append initial-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
282 '((user-size . t))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
283 (if height (list height))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
284 (if width (list width)))))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
285 (if (or left top)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
286 (setq initial-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
287 (append initial-frame-alist
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
288 '((user-position . t))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
289 (if left (list left))
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
290 (if top (list top)))))))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
291
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
292 (defvar x-resource-name)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
293
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
294 ;; Handle the -name option. Set the variable x-resource-name
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
295 ;; to the option's operand; set the name of
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
296 ;; the initial frame, too.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
297 (defun x-handle-name-switch (switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
298 (or (consp x-invocation-args)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
299 (error "%s: missing argument to `%s' option" (invocation-name) switch))
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
300 (setq x-resource-name (pop x-invocation-args)
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
301 initial-frame-alist (cons (cons 'name x-resource-name)
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
302 initial-frame-alist)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
303
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
304 (defvar x-display-name nil
104066
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
305 "The name of the window display on which Emacs was started.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
306 On X, the display name of individual X frames is recorded in the
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
307 `display' frame parameter.")
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
308
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
309 (defun x-handle-display (switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
310 "Handle -display DISPLAY option."
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
311 (setq x-display-name (pop x-invocation-args))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
312 ;; Make subshell programs see the same DISPLAY value Emacs really uses.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
313 ;; Note that this isn't completely correct, since Emacs can use
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
314 ;; multiple displays. However, there is no way to tell an already
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
315 ;; running subshell which display the user is currently typing on.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
316 (setenv "DISPLAY" x-display-name))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
317
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
318 (defun x-handle-args (args)
111185
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
319 "Process the X (or Nextstep) related command line options in ARGS.
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
320 This is done before the user's startup file is loaded.
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
321 Copies the options in ARGS to `x-invocation-args'. It then extracts
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
322 the X (or Nextstep) options according to the handlers defined in
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
323 `command-line-x-option-alist' (or `command-line-ns-option-alist').
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
324 For example, `x-handle-switch' handles a switch like \"-fg\" and its
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
325 value \"black\". This function returns ARGS minus the arguments that
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
326 have been processed."
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
327 ;; We use ARGS to accumulate the args that we don't handle here, to return.
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
328 (setq x-invocation-args args ; FIXME let-bind?
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
329 args nil)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
330 (while (and x-invocation-args
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
331 (not (equal (car x-invocation-args) "--")))
111175
f900266d10a0 Simplifications for lisp/term/common-win.el
Glenn Morris <rgm@gnu.org>
parents: 111166
diff changeset
332 (let* ((this-switch (pop x-invocation-args))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
333 (orig-this-switch this-switch)
111185
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
334 (option-alist (if (featurep 'ns)
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
335 command-line-ns-option-alist
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
336 command-line-x-option-alist))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
337 completion argval aelt handler)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
338 ;; Check for long options with attached arguments
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
339 ;; and separate out the attached option argument into argval.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
340 (if (string-match "^--[^=]*=" this-switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
341 (setq argval (substring this-switch (match-end 0))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
342 this-switch (substring this-switch 0 (1- (match-end 0)))))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
343 ;; Complete names of long options.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
344 (if (string-match "^--" this-switch)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
345 (progn
111185
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
346 (setq completion (try-completion this-switch option-alist))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
347 (if (eq completion t)
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
348 ;; Exact match for long option.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
349 nil
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
350 (if (stringp completion)
111185
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
351 (let ((elt (assoc completion option-alist)))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
352 ;; Check for abbreviated long option.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
353 (or elt
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
354 (error "Option `%s' is ambiguous" this-switch))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
355 (setq this-switch completion))))))
111185
050a28bd1797 Remove ns-handle-* functions that duplicate x-handle-*.
Glenn Morris <rgm@gnu.org>
parents: 111183
diff changeset
356 (setq aelt (assoc this-switch option-alist))
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
357 (if aelt (setq handler (nth 2 aelt)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
358 (if handler
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
359 (if argval
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
360 (let ((x-invocation-args
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
361 (cons argval x-invocation-args)))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
362 (funcall handler this-switch))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
363 (funcall handler this-switch))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
364 (setq args (cons orig-this-switch args)))))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
365 (nconc (nreverse args) x-invocation-args))
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
366
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
367
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
368 ;;
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
369 ;; Available colors
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
370 ;;
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
371 ;; The ordering of the colors is chosen for the user's convenience in
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
372 ;; `list-colors-display', which displays the reverse of this list.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
373 ;; Roughly speaking, `list-colors-display' orders by (i) named shades
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
374 ;; of grey with hue 0.0, sorted by value (ii) named colors with
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
375 ;; saturation 1.0, sorted by hue, (iii) named non-white colors with
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
376 ;; saturation less than 1.0, sorted by hue, (iv) other named shades of
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
377 ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
378 ;; of grey.
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
379
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
380 (declare-function ns-list-colors "nsfns.m" (&optional frame))
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
381
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
382 (defvar x-colors
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
383 (if (featurep 'ns) (ns-list-colors)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
384 (purecopy
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
385 '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
386 "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
387 "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
388 "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
389 "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
390 "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
391 "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
392 "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
393 "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
394 "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
395 "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
396 "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
397 "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
398 "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
399 "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
400 "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
401 "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
402 "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
403 "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
404 "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
405 "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
406 "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
407 "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
408 "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
409 "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
410 "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
411 "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
412 "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
413 "gray1" "grey1" "gray0" "grey0"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
414 "LightPink1" "LightPink2" "LightPink3" "LightPink4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
415 "pink1" "pink2" "pink3" "pink4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
416 "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
417 "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
418 "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
419 "HotPink1" "HotPink2" "HotPink3" "HotPink4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
420 "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
421 "maroon1" "maroon2" "maroon3" "maroon4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
422 "orchid1" "orchid2" "orchid3" "orchid4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
423 "plum1" "plum2" "plum3" "plum4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
424 "thistle1" "thistle2" "thistle3" "thistle4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
425 "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
426 "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
427 "purple1" "purple2" "purple3" "purple4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
428 "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
429 "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
430 "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
431 "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
432 "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
433 "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
434 "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
435 "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
436 "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
437 "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
438 "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
439 "azure1" "azure2" "azure3" "azure4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
440 "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
441 "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
442 "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
443 "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
444 "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
445 "honeydew1" "honeydew2" "honeydew3" "honeydew4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
446 "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
447 "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
448 "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
449 "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
450 "ivory1" "ivory2" "ivory3" "ivory4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
451 "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
452 "khaki1" "khaki2" "khaki3" "khaki4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
453 "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
454 "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
455 "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
456 "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
457 "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
458 "wheat1" "wheat2" "wheat3" "wheat4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
459 "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
460 "burlywood1" "burlywood2" "burlywood3" "burlywood4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
461 "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
462 "bisque1" "bisque2" "bisque3" "bisque4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
463 "tan1" "tan2" "tan3" "tan4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
464 "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
465 "seashell1" "seashell2" "seashell3" "seashell4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
466 "chocolate1" "chocolate2" "chocolate3" "chocolate4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
467 "sienna1" "sienna2" "sienna3" "sienna4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
468 "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
469 "salmon1" "salmon2" "salmon3" "salmon4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
470 "coral1" "coral2" "coral3" "coral4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
471 "tomato1" "tomato2" "tomato3" "tomato4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
472 "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
473 "snow1" "snow2" "snow3" "snow4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
474 "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
475 "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
476 "firebrick1" "firebrick2" "firebrick3" "firebrick4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
477 "brown1" "brown2" "brown3" "brown4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
478 "magenta1" "magenta2" "magenta3" "magenta4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
479 "blue1" "blue2" "blue3" "blue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
480 "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
481 "turquoise1" "turquoise2" "turquoise3" "turquoise4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
482 "cyan1" "cyan2" "cyan3" "cyan4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
483 "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
484 "green1" "green2" "green3" "green4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
485 "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
486 "yellow1" "yellow2" "yellow3" "yellow4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
487 "gold1" "gold2" "gold3" "gold4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
488 "orange1" "orange2" "orange3" "orange4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
489 "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
490 "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
491 "red1" "red2" "red3" "red4"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
492 "lavender blush" "LavenderBlush" "ghost white" "GhostWhite"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
493 "lavender" "alice blue" "AliceBlue" "azure" "light cyan"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
494 "LightCyan" "mint cream" "MintCream" "honeydew" "ivory"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
495 "light goldenrod yellow" "LightGoldenrodYellow" "light yellow"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
496 "LightYellow" "beige" "floral white" "FloralWhite" "old lace"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
497 "OldLace" "blanched almond" "BlanchedAlmond" "moccasin"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
498 "papaya whip" "PapayaWhip" "bisque" "antique white"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
499 "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
500 "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
501 "hot pink" "HotPink" "deep pink" "DeepPink" "maroon"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
502 "pale violet red" "PaleVioletRed" "violet red" "VioletRed"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
503 "medium violet red" "MediumVioletRed" "violet" "plum" "thistle"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
504 "orchid" "medium orchid" "MediumOrchid" "dark orchid"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
505 "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
506 "MediumPurple" "light slate blue" "LightSlateBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
507 "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
508 "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
509 "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
510 "light steel blue" "LightSteelBlue" "cornflower blue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
511 "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
512 "RoyalBlue" "light slate gray" "light slate grey"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
513 "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
514 "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
515 "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
516 "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
517 "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
518 "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
519 "medium turquoise" "MediumTurquoise" "dark turquoise"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
520 "DarkTurquoise" "dark cyan" "DarkCyan" "aquamarine"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
521 "medium aquamarine" "MediumAquamarine" "light sea green"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
522 "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
523 "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
524 "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
525 "forest green" "ForestGreen" "light green" "LightGreen"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
526 "green yellow" "GreenYellow" "yellow green" "YellowGreen"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
527 "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
528 "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
529 "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
530 "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
531 "wheat" "navajo white" "NavajoWhite" "tan" "burlywood"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
532 "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
533 "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
534 "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
535 "salmon" "light coral" "LightCoral" "indian red" "IndianRed"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
536 "firebrick" "brown" "dark red" "DarkRed" "magenta"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
537 "dark magenta" "DarkMagenta" "dark violet" "DarkViolet"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
538 "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
539 "cyan" "medium spring green" "MediumSpringGreen" "spring green"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
540 "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
541 "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
542 "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
543 "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
544 "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray"
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
545 "dim grey" "DimGray" "DimGrey" "black")))
104066
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
546 "List of basic colors available on color displays.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
547 For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20.
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
548 For Nextstep, this is a list of non-PANTONE colors returned by
b564cde0cb8b Fix Bug#3888:
Eli Zaretskii <eliz@gnu.org>
parents: 100908
diff changeset
549 the operating system.")
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
550
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
551 (defvar w32-color-map)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
552
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
553 (defun xw-defined-colors (&optional frame)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
554 "Internal function called by `defined-colors', which see."
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
555 (or frame (setq frame (selected-frame)))
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
556 ;; FIXME for ns, this is just... x-colors.
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
557 (let (defined-colors)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
558 (dolist (this-color (if (eq system-type 'windows-nt)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
559 (or (mapcar 'car w32-color-map) x-colors)
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
560 x-colors))
111183
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
561 (and (or (color-supported-p this-color frame t)
72ef880ed198 Let ns load common-win.
Glenn Morris <rgm@gnu.org>
parents: 111175
diff changeset
562 (featurep 'ns))
111166
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
563 (setq defined-colors (cons this-color defined-colors))))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
564 defined-colors))
6cf6c01cf9bf Move some more shared x-, w32- things to common-win.
Glenn Morris <rgm@gnu.org>
parents: 111134
diff changeset
565
96830
a8aac59d9c7a * term/x-win.el (x-handle-switch, x-handle-numeric-switch)
Dan Nicolaescu <dann@ics.uci.edu>
parents:
diff changeset
566 ;;; common-win.el ends here