aboutsummaryrefslogtreecommitdiffstats
path: root/lisp
diff options
context:
space:
mode:
authorGlenn Morris2010-10-25 19:59:05 -0700
committerGlenn Morris2010-10-25 19:59:05 -0700
commit725513b7d9eea9e78ef9c61a604660450fa6831d (patch)
tree768c56154549e481e05fb67b29f960ad129002f5 /lisp
parent6ee7927589ecc3e7fa058e1d2d9e3ae299ea068b (diff)
downloademacs-725513b7d9eea9e78ef9c61a604660450fa6831d.tar.gz
emacs-725513b7d9eea9e78ef9c61a604660450fa6831d.zip
Let ns load common-win.
* lisp/term/common-win.el (x-select-enable-clipboard): * lisp/term/pc-win.el (x-select-enable-clipboard): Doc fix. * lisp/term/ns-win.el: No need to require cl when compiling. (x-display-name, x-setup-function-keys, x-select-text, x-colors) (xw-defined-colors): Use the common-win definitions. (ns-alternatives-map): Make it an obsolete alias for x-alternatives-map. (ns-handle-iconic): Make it an alias for x-handle-iconic. * lisp/term/common-win.el (x-select-text, x-alternatives-map) (x-setup-function-keys, x-colors, xw-defined-colors): Handle 'ns case. * lisp/loadup.el [ns]: Load common-win.
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog14
-rw-r--r--lisp/loadup.el4
-rw-r--r--lisp/term/common-win.el497
-rw-r--r--lisp/term/ns-win.el200
-rw-r--r--lisp/term/pc-win.el6
5 files changed, 347 insertions, 374 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 4e9b62ed200..5e5de12ede6 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,17 @@
12010-10-26 Glenn Morris <rgm@gnu.org>
2
3 * term/common-win.el (x-select-enable-clipboard):
4 * term/pc-win.el (x-select-enable-clipboard): Doc fix.
5
6 * term/ns-win.el: No need to require cl when compiling.
7 (x-display-name, x-setup-function-keys, x-select-text, x-colors)
8 (xw-defined-colors): Use the common-win definitions.
9 (ns-alternatives-map): Make it an obsolete alias for x-alternatives-map.
10 (ns-handle-iconic): Make it an alias for x-handle-iconic.
11 * term/common-win.el (x-select-text, x-alternatives-map)
12 (x-setup-function-keys, x-colors, xw-defined-colors): Handle 'ns case.
13 * loadup.el [ns]: Load common-win.
14
12010-10-26 Daiki Ueno <ueno@unixuser.org> 152010-10-26 Daiki Ueno <ueno@unixuser.org>
2 16
3 * epa-mail.el (epa-mail-encrypt): Handle local-part only 17 * epa-mail.el (epa-mail-encrypt): Handle local-part only
diff --git a/lisp/loadup.el b/lisp/loadup.el
index 775b6ee4aea..d13e38c0b36 100644
--- a/lisp/loadup.el
+++ b/lisp/loadup.el
@@ -233,7 +233,9 @@
233 (load "ls-lisp") 233 (load "ls-lisp")
234 (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el 234 (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el
235(if (featurep 'ns) 235(if (featurep 'ns)
236 (load "term/ns-win")) 236 (progn
237 (load "term/common-win")
238 (load "term/ns-win")))
237(if (fboundp 'x-create-frame) 239(if (fboundp 'x-create-frame)
238 ;; Do it after loading term/foo-win.el since the value of the 240 ;; Do it after loading term/foo-win.el since the value of the
239 ;; mouse-wheel-*-event vars depends on those files being loaded or not. 241 ;; mouse-wheel-*-event vars depends on those files being loaded or not.
diff --git a/lisp/term/common-win.el b/lisp/term/common-win.el
index 331f20fe3ff..ff69ff9404b 100644
--- a/lisp/term/common-win.el
+++ b/lisp/term/common-win.el
@@ -1,7 +1,7 @@
1;;; common-win.el --- common part of handling window systems 1;;; common-win.el --- common part of handling window systems
2 2
3;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 3;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
4;; 2008, 2009, 2010 Free Software Foundation, Inc. 4;; 2008, 2009, 2010 Free Software Foundation, Inc.
5 5
6;; Maintainer: FSF 6;; Maintainer: FSF
7;; Keywords: terminals 7;; Keywords: terminals
@@ -30,8 +30,10 @@
30This is in addition to, but in preference to, the primary selection. 30This is in addition to, but in preference to, the primary selection.
31 31
32Note that MS-Windows does not support selection types other than the 32Note that MS-Windows does not support selection types other than the
33clipboard. \(The primary selection that is set by Emacs is not 33clipboard. (The primary selection that is set by Emacs is not
34accessible to other programs on MS-Windows.\)" 34accessible to other programs on MS-Windows.)
35
36This variable is not used by the Nextstep port."
35 :type 'boolean 37 :type 'boolean
36 :group 'killing 38 :group 'killing
37 ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not. 39 ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not.
@@ -40,6 +42,8 @@ accessible to other programs on MS-Windows.\)"
40(defvar x-last-selected-text) ; w32-fns.el 42(defvar x-last-selected-text) ; w32-fns.el
41(declare-function w32-set-clipboard-data "w32select.c" 43(declare-function w32-set-clipboard-data "w32select.c"
42 (string &optional ignored)) 44 (string &optional ignored))
45(defvar ns-last-selected-text) ; ns-win.el
46(declare-function ns-set-pasteboard "ns-win" (string))
43 47
44(defun x-select-text (text) 48(defun x-select-text (text)
45 "Select TEXT, a string, according to the window system. 49 "Select TEXT, a string, according to the window system.
@@ -52,20 +56,26 @@ On MS-Windows, make TEXT the current selection. If
52`x-select-enable-clipboard' is non-nil, copy the text to the 56`x-select-enable-clipboard' is non-nil, copy the text to the
53clipboard as well. 57clipboard as well.
54 58
55On Nextstep, put TEXT in the pasteboard." 59On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
56 (if (eq system-type 'windows-nt) 60is not used)."
57 (progn 61 (cond ((eq system-type 'windows-nt)
58 (if x-select-enable-clipboard 62 (if x-select-enable-clipboard
59 (w32-set-clipboard-data text)) 63 (w32-set-clipboard-data text))
60 (setq x-last-selected-text text)) 64 (setq x-last-selected-text text))
61 ;; With multi-tty, this function may be called from a tty frame. 65 ((featurep 'ns)
62 (when (eq (framep (selected-frame)) 'x) 66 ;; Don't send the pasteboard too much text.
63 (when x-select-enable-primary 67 ;; It becomes slow, and if really big it causes errors.
64 (x-set-selection 'PRIMARY text) 68 (ns-set-pasteboard text)
65 (setq x-last-selected-text-primary text)) 69 (setq ns-last-selected-text text))
66 (when x-select-enable-clipboard 70 (t
67 (x-set-selection 'CLIPBOARD text) 71 ;; With multi-tty, this function may be called from a tty frame.
68 (setq x-last-selected-text-clipboard text))))) 72 (when (eq (framep (selected-frame)) 'x)
73 (when x-select-enable-primary
74 (x-set-selection 'PRIMARY text)
75 (setq x-last-selected-text-primary text))
76 (when x-select-enable-clipboard
77 (x-set-selection 'CLIPBOARD text)
78 (setq x-last-selected-text-clipboard text))))))
69 79
70;;;; Function keys 80;;;; Function keys
71 81
@@ -79,9 +89,11 @@ On Nextstep, put TEXT in the pasteboard."
79 (define-key map [M-clear] [?\M-\C-l]) 89 (define-key map [M-clear] [?\M-\C-l])
80 (define-key map [M-return] [?\M-\C-m]) 90 (define-key map [M-return] [?\M-\C-m])
81 (define-key map [M-escape] [?\M-\e]) 91 (define-key map [M-escape] [?\M-\e])
82 (define-key map [iso-lefttab] [backtab]) 92 (unless (featurep 'ns)
83 (define-key map [S-iso-lefttab] [backtab]) 93 (define-key map [iso-lefttab] [backtab])
84 (and (eq system-type 'windows-nt) 94 (define-key map [S-iso-lefttab] [backtab]))
95 (and (or (eq system-type 'windows-nt)
96 (featurep 'ns))
85 (define-key map [S-tab] [backtab])) 97 (define-key map [S-tab] [backtab]))
86 map) 98 map)
87 "Keymap of possible alternative meanings for some keys.") 99 "Keymap of possible alternative meanings for some keys.")
@@ -95,7 +107,117 @@ On Nextstep, put TEXT in the pasteboard."
95 (with-selected-frame frame 107 (with-selected-frame frame
96 (let ((map (copy-keymap x-alternatives-map))) 108 (let ((map (copy-keymap x-alternatives-map)))
97 (set-keymap-parent map (keymap-parent local-function-key-map)) 109 (set-keymap-parent map (keymap-parent local-function-key-map))
98 (set-keymap-parent local-function-key-map map))) 110 (set-keymap-parent local-function-key-map map))
111 (when (featurep 'ns)
112 (setq interprogram-cut-function 'x-select-text
113 interprogram-paste-function 'x-selection-value
114 system-key-alist
115 (list
116 (cons (logior (lsh 0 16) 1) 'ns-power-off)
117 (cons (logior (lsh 0 16) 2) 'ns-open-file)
118 (cons (logior (lsh 0 16) 3) 'ns-open-temp-file)
119 (cons (logior (lsh 0 16) 4) 'ns-drag-file)
120 (cons (logior (lsh 0 16) 5) 'ns-drag-color)
121 (cons (logior (lsh 0 16) 6) 'ns-drag-text)
122 (cons (logior (lsh 0 16) 7) 'ns-change-font)
123 (cons (logior (lsh 0 16) 8) 'ns-open-file-line)
124;;; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text)
125;;; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text)
126 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call)
127 (cons (logior (lsh 0 16) 12) 'ns-new-frame)
128 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
129 (cons (logior (lsh 0 16) 14) 'ns-show-prefs)
130 (cons (logior (lsh 1 16) 32) 'f1)
131 (cons (logior (lsh 1 16) 33) 'f2)
132 (cons (logior (lsh 1 16) 34) 'f3)
133 (cons (logior (lsh 1 16) 35) 'f4)
134 (cons (logior (lsh 1 16) 36) 'f5)
135 (cons (logior (lsh 1 16) 37) 'f6)
136 (cons (logior (lsh 1 16) 38) 'f7)
137 (cons (logior (lsh 1 16) 39) 'f8)
138 (cons (logior (lsh 1 16) 40) 'f9)
139 (cons (logior (lsh 1 16) 41) 'f10)
140 (cons (logior (lsh 1 16) 42) 'f11)
141 (cons (logior (lsh 1 16) 43) 'f12)
142 (cons (logior (lsh 1 16) 44) 'kp-insert)
143 (cons (logior (lsh 1 16) 45) 'kp-delete)
144 (cons (logior (lsh 1 16) 46) 'kp-home)
145 (cons (logior (lsh 1 16) 47) 'kp-end)
146 (cons (logior (lsh 1 16) 48) 'kp-prior)
147 (cons (logior (lsh 1 16) 49) 'kp-next)
148 (cons (logior (lsh 1 16) 50) 'print-screen)
149 (cons (logior (lsh 1 16) 51) 'scroll-lock)
150 (cons (logior (lsh 1 16) 52) 'pause)
151 (cons (logior (lsh 1 16) 53) 'system)
152 (cons (logior (lsh 1 16) 54) 'break)
153 ;; Erm, this looks like a FIXME...
154 (cons (logior (lsh 1 16) 56)
155 'please-tell-carl-what-this-key-is-called-56)
156 (cons (logior (lsh 1 16) 61)
157 'please-tell-carl-what-this-key-is-called-61)
158 (cons (logior (lsh 1 16) 62)
159 'please-tell-carl-what-this-key-is-called-62)
160 (cons (logior (lsh 1 16) 63)
161 'please-tell-carl-what-this-key-is-called-63)
162 (cons (logior (lsh 1 16) 64)
163 'please-tell-carl-what-this-key-is-called-64)
164 (cons (logior (lsh 1 16) 69)
165 'please-tell-carl-what-this-key-is-called-69)
166 (cons (logior (lsh 1 16) 70)
167 'please-tell-carl-what-this-key-is-called-70)
168 (cons (logior (lsh 1 16) 71)
169 'please-tell-carl-what-this-key-is-called-71)
170 (cons (logior (lsh 1 16) 72)
171 'please-tell-carl-what-this-key-is-called-72)
172 (cons (logior (lsh 1 16) 73)
173 'please-tell-carl-what-this-key-is-called-73)
174 (cons (logior (lsh 2 16) 3) 'kp-enter)
175 (cons (logior (lsh 2 16) 9) 'kp-tab)
176 (cons (logior (lsh 2 16) 28) 'kp-quit)
177 (cons (logior (lsh 2 16) 35) 'kp-hash)
178 (cons (logior (lsh 2 16) 42) 'kp-multiply)
179 (cons (logior (lsh 2 16) 43) 'kp-add)
180 (cons (logior (lsh 2 16) 44) 'kp-separator)
181 (cons (logior (lsh 2 16) 45) 'kp-subtract)
182 (cons (logior (lsh 2 16) 46) 'kp-decimal)
183 (cons (logior (lsh 2 16) 47) 'kp-divide)
184 (cons (logior (lsh 2 16) 48) 'kp-0)
185 (cons (logior (lsh 2 16) 49) 'kp-1)
186 (cons (logior (lsh 2 16) 50) 'kp-2)
187 (cons (logior (lsh 2 16) 51) 'kp-3)
188 (cons (logior (lsh 2 16) 52) 'kp-4)
189 (cons (logior (lsh 2 16) 53) 'kp-5)
190 (cons (logior (lsh 2 16) 54) 'kp-6)
191 (cons (logior (lsh 2 16) 55) 'kp-7)
192 (cons (logior (lsh 2 16) 56) 'kp-8)
193 (cons (logior (lsh 2 16) 57) 'kp-9)
194 (cons (logior (lsh 2 16) 60) 'kp-less)
195 (cons (logior (lsh 2 16) 61) 'kp-equal)
196 (cons (logior (lsh 2 16) 62) 'kp-more)
197 (cons (logior (lsh 2 16) 64) 'kp-at)
198 (cons (logior (lsh 2 16) 92) 'kp-backslash)
199 (cons (logior (lsh 2 16) 96) 'kp-backtick)
200 (cons (logior (lsh 2 16) 124) 'kp-bar)
201 (cons (logior (lsh 2 16) 126) 'kp-tilde)
202 (cons (logior (lsh 2 16) 157) 'kp-mu)
203 (cons (logior (lsh 2 16) 165) 'kp-yen)
204 (cons (logior (lsh 2 16) 167) 'kp-paragraph)
205 (cons (logior (lsh 2 16) 172) 'left)
206 (cons (logior (lsh 2 16) 173) 'up)
207 (cons (logior (lsh 2 16) 174) 'right)
208 (cons (logior (lsh 2 16) 175) 'down)
209 (cons (logior (lsh 2 16) 176) 'kp-ring)
210 (cons (logior (lsh 2 16) 201) 'kp-square)
211 (cons (logior (lsh 2 16) 204) 'kp-cube)
212 (cons (logior (lsh 3 16) 8) 'backspace)
213 (cons (logior (lsh 3 16) 9) 'tab)
214 (cons (logior (lsh 3 16) 10) 'linefeed)
215 (cons (logior (lsh 3 16) 11) 'clear)
216 (cons (logior (lsh 3 16) 13) 'return)
217 (cons (logior (lsh 3 16) 18) 'pause)
218 (cons (logior (lsh 3 16) 25) 'S-tab)
219 (cons (logior (lsh 3 16) 27) 'escape)
220 (cons (logior (lsh 3 16) 127) 'delete)))))
99 (set-terminal-parameter frame 'x-setup-function-keys t))) 221 (set-terminal-parameter frame 'x-setup-function-keys t)))
100 222
101(defvar x-invocation-args) 223(defvar x-invocation-args)
@@ -201,7 +323,7 @@ the switch (e.g., \"-fg\") in the following code, and possible values
201\(e.g., \"black\") in the option handler code (e.g., x-handle-switch). 323\(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
202This function returns ARGS minus the arguments that have been processed." 324This function returns ARGS minus the arguments that have been processed."
203 ;; We use ARGS to accumulate the args that we don't handle here, to return. 325 ;; We use ARGS to accumulate the args that we don't handle here, to return.
204 (setq x-invocation-args args 326 (setq x-invocation-args args ; FIXME let-bind?
205 args nil) 327 args nil)
206 (while (and x-invocation-args 328 (while (and x-invocation-args
207 (not (equal (car x-invocation-args) "--"))) 329 (not (equal (car x-invocation-args) "--")))
@@ -250,169 +372,172 @@ This function returns ARGS minus the arguments that have been processed."
250;; white, (v) numbered colors sorted by hue, and (vi) numbered shades 372;; white, (v) numbered colors sorted by hue, and (vi) numbered shades
251;; of grey. 373;; of grey.
252 374
375(declare-function ns-list-colors "nsfns.m" (&optional frame))
376
253(defvar x-colors 377(defvar x-colors
254 (purecopy 378 (if (featurep 'ns) (ns-list-colors)
255 '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97" 379 (purecopy
256 "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94" 380 '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97"
257 "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90" 381 "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94"
258 "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87" 382 "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90"
259 "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83" 383 "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87"
260 "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80" 384 "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83"
261 "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76" 385 "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80"
262 "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73" 386 "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76"
263 "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69" 387 "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73"
264 "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66" 388 "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69"
265 "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62" 389 "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66"
266 "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59" 390 "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62"
267 "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55" 391 "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59"
268 "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52" 392 "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55"
269 "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48" 393 "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52"
270 "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45" 394 "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48"
271 "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41" 395 "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45"
272 "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38" 396 "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41"
273 "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34" 397 "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38"
274 "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31" 398 "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34"
275 "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27" 399 "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31"
276 "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24" 400 "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27"
277 "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20" 401 "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24"
278 "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17" 402 "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20"
279 "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13" 403 "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17"
280 "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10" 404 "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13"
281 "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6" 405 "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10"
282 "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2" 406 "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6"
283 "gray1" "grey1" "gray0" "grey0" 407 "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2"
284 "LightPink1" "LightPink2" "LightPink3" "LightPink4" 408 "gray1" "grey1" "gray0" "grey0"
285 "pink1" "pink2" "pink3" "pink4" 409 "LightPink1" "LightPink2" "LightPink3" "LightPink4"
286 "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4" 410 "pink1" "pink2" "pink3" "pink4"
287 "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4" 411 "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
288 "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4" 412 "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4"
289 "HotPink1" "HotPink2" "HotPink3" "HotPink4" 413 "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4"
290 "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4" 414 "HotPink1" "HotPink2" "HotPink3" "HotPink4"
291 "maroon1" "maroon2" "maroon3" "maroon4" 415 "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4"
292 "orchid1" "orchid2" "orchid3" "orchid4" 416 "maroon1" "maroon2" "maroon3" "maroon4"
293 "plum1" "plum2" "plum3" "plum4" 417 "orchid1" "orchid2" "orchid3" "orchid4"
294 "thistle1" "thistle2" "thistle3" "thistle4" 418 "plum1" "plum2" "plum3" "plum4"
295 "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4" 419 "thistle1" "thistle2" "thistle3" "thistle4"
296 "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4" 420 "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4"
297 "purple1" "purple2" "purple3" "purple4" 421 "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4"
298 "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4" 422 "purple1" "purple2" "purple3" "purple4"
299 "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4" 423 "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4"
300 "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4" 424 "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4"
301 "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4" 425 "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
302 "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4" 426 "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4"
303 "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4" 427 "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4"
304 "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4" 428 "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4"
305 "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4" 429 "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4"
306 "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4" 430 "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4"
307 "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4" 431 "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4"
308 "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4" 432 "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4"
309 "azure1" "azure2" "azure3" "azure4" 433 "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4"
310 "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4" 434 "azure1" "azure2" "azure3" "azure4"
311 "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4" 435 "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4"
312 "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4" 436 "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4"
313 "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4" 437 "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4"
314 "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4" 438 "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
315 "honeydew1" "honeydew2" "honeydew3" "honeydew4" 439 "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4"
316 "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4" 440 "honeydew1" "honeydew2" "honeydew3" "honeydew4"
317 "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4" 441 "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4"
318 "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4" 442 "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
319 "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4" 443 "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4"
320 "ivory1" "ivory2" "ivory3" "ivory4" 444 "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4"
321 "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4" 445 "ivory1" "ivory2" "ivory3" "ivory4"
322 "khaki1" "khaki2" "khaki3" "khaki4" 446 "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4"
323 "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4" 447 "khaki1" "khaki2" "khaki3" "khaki4"
324 "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4" 448 "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
325 "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4" 449 "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4"
326 "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4" 450 "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4"
327 "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4" 451 "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4"
328 "wheat1" "wheat2" "wheat3" "wheat4" 452 "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
329 "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4" 453 "wheat1" "wheat2" "wheat3" "wheat4"
330 "burlywood1" "burlywood2" "burlywood3" "burlywood4" 454 "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4"
331 "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4" 455 "burlywood1" "burlywood2" "burlywood3" "burlywood4"
332 "bisque1" "bisque2" "bisque3" "bisque4" 456 "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4"
333 "tan1" "tan2" "tan3" "tan4" 457 "bisque1" "bisque2" "bisque3" "bisque4"
334 "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4" 458 "tan1" "tan2" "tan3" "tan4"
335 "seashell1" "seashell2" "seashell3" "seashell4" 459 "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4"
336 "chocolate1" "chocolate2" "chocolate3" "chocolate4" 460 "seashell1" "seashell2" "seashell3" "seashell4"
337 "sienna1" "sienna2" "sienna3" "sienna4" 461 "chocolate1" "chocolate2" "chocolate3" "chocolate4"
338 "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4" 462 "sienna1" "sienna2" "sienna3" "sienna4"
339 "salmon1" "salmon2" "salmon3" "salmon4" 463 "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4"
340 "coral1" "coral2" "coral3" "coral4" 464 "salmon1" "salmon2" "salmon3" "salmon4"
341 "tomato1" "tomato2" "tomato3" "tomato4" 465 "coral1" "coral2" "coral3" "coral4"
342 "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4" 466 "tomato1" "tomato2" "tomato3" "tomato4"
343 "snow1" "snow2" "snow3" "snow4" 467 "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4"
344 "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4" 468 "snow1" "snow2" "snow3" "snow4"
345 "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4" 469 "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
346 "firebrick1" "firebrick2" "firebrick3" "firebrick4" 470 "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4"
347 "brown1" "brown2" "brown3" "brown4" 471 "firebrick1" "firebrick2" "firebrick3" "firebrick4"
348 "magenta1" "magenta2" "magenta3" "magenta4" 472 "brown1" "brown2" "brown3" "brown4"
349 "blue1" "blue2" "blue3" "blue4" 473 "magenta1" "magenta2" "magenta3" "magenta4"
350 "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4" 474 "blue1" "blue2" "blue3" "blue4"
351 "turquoise1" "turquoise2" "turquoise3" "turquoise4" 475 "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4"
352 "cyan1" "cyan2" "cyan3" "cyan4" 476 "turquoise1" "turquoise2" "turquoise3" "turquoise4"
353 "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4" 477 "cyan1" "cyan2" "cyan3" "cyan4"
354 "green1" "green2" "green3" "green4" 478 "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4"
355 "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4" 479 "green1" "green2" "green3" "green4"
356 "yellow1" "yellow2" "yellow3" "yellow4" 480 "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4"
357 "gold1" "gold2" "gold3" "gold4" 481 "yellow1" "yellow2" "yellow3" "yellow4"
358 "orange1" "orange2" "orange3" "orange4" 482 "gold1" "gold2" "gold3" "gold4"
359 "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4" 483 "orange1" "orange2" "orange3" "orange4"
360 "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4" 484 "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4"
361 "red1" "red2" "red3" "red4" 485 "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
362 "lavender blush" "LavenderBlush" "ghost white" "GhostWhite" 486 "red1" "red2" "red3" "red4"
363 "lavender" "alice blue" "AliceBlue" "azure" "light cyan" 487 "lavender blush" "LavenderBlush" "ghost white" "GhostWhite"
364 "LightCyan" "mint cream" "MintCream" "honeydew" "ivory" 488 "lavender" "alice blue" "AliceBlue" "azure" "light cyan"
365 "light goldenrod yellow" "LightGoldenrodYellow" "light yellow" 489 "LightCyan" "mint cream" "MintCream" "honeydew" "ivory"
366 "LightYellow" "beige" "floral white" "FloralWhite" "old lace" 490 "light goldenrod yellow" "LightGoldenrodYellow" "light yellow"
367 "OldLace" "blanched almond" "BlanchedAlmond" "moccasin" 491 "LightYellow" "beige" "floral white" "FloralWhite" "old lace"
368 "papaya whip" "PapayaWhip" "bisque" "antique white" 492 "OldLace" "blanched almond" "BlanchedAlmond" "moccasin"
369 "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell" 493 "papaya whip" "PapayaWhip" "bisque" "antique white"
370 "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink" 494 "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell"
371 "hot pink" "HotPink" "deep pink" "DeepPink" "maroon" 495 "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink"
372 "pale violet red" "PaleVioletRed" "violet red" "VioletRed" 496 "hot pink" "HotPink" "deep pink" "DeepPink" "maroon"
373 "medium violet red" "MediumVioletRed" "violet" "plum" "thistle" 497 "pale violet red" "PaleVioletRed" "violet red" "VioletRed"
374 "orchid" "medium orchid" "MediumOrchid" "dark orchid" 498 "medium violet red" "MediumVioletRed" "violet" "plum" "thistle"
375 "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple" 499 "orchid" "medium orchid" "MediumOrchid" "dark orchid"
376 "MediumPurple" "light slate blue" "LightSlateBlue" 500 "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple"
377 "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue" 501 "MediumPurple" "light slate blue" "LightSlateBlue"
378 "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue" 502 "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue"
379 "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue" 503 "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue"
380 "light steel blue" "LightSteelBlue" "cornflower blue" 504 "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue"
381 "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue" 505 "light steel blue" "LightSteelBlue" "cornflower blue"
382 "RoyalBlue" "light slate gray" "light slate grey" 506 "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue"
383 "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey" 507 "RoyalBlue" "light slate gray" "light slate grey"
384 "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey" 508 "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey"
385 "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue" 509 "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey"
386 "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue" 510 "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue"
387 "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue" 511 "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue"
388 "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise" 512 "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue"
389 "medium turquoise" "MediumTurquoise" "dark turquoise" 513 "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise"
390 "DarkTurquoise" "dark cyan" "DarkCyan" "aquamarine" 514 "medium turquoise" "MediumTurquoise" "dark turquoise"
391 "medium aquamarine" "MediumAquamarine" "light sea green" 515 "DarkTurquoise" "dark cyan" "DarkCyan" "aquamarine"
392 "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green" 516 "medium aquamarine" "MediumAquamarine" "light sea green"
393 "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green" 517 "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green"
394 "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen" 518 "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green"
395 "forest green" "ForestGreen" "light green" "LightGreen" 519 "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen"
396 "green yellow" "GreenYellow" "yellow green" "YellowGreen" 520 "forest green" "ForestGreen" "light green" "LightGreen"
397 "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen" 521 "green yellow" "GreenYellow" "yellow green" "YellowGreen"
398 "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki" 522 "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen"
399 "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod" 523 "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki"
400 "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod" 524 "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod"
401 "wheat" "navajo white" "NavajoWhite" "tan" "burlywood" 525 "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod"
402 "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown" 526 "wheat" "navajo white" "NavajoWhite" "tan" "burlywood"
403 "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon" 527 "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown"
404 "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon" 528 "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon"
405 "salmon" "light coral" "LightCoral" "indian red" "IndianRed" 529 "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon"
406 "firebrick" "brown" "dark red" "DarkRed" "magenta" 530 "salmon" "light coral" "LightCoral" "indian red" "IndianRed"
407 "dark magenta" "DarkMagenta" "dark violet" "DarkViolet" 531 "firebrick" "brown" "dark red" "DarkRed" "magenta"
408 "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue" 532 "dark magenta" "DarkMagenta" "dark violet" "DarkViolet"
409 "cyan" "medium spring green" "MediumSpringGreen" "spring green" 533 "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue"
410 "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse" 534 "cyan" "medium spring green" "MediumSpringGreen" "spring green"
411 "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red" 535 "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse"
412 "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro" 536 "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red"
413 "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey" 537 "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro"
414 "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray" 538 "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey"
415 "dim grey" "DimGray" "DimGrey" "black")) 539 "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray"
540 "dim grey" "DimGray" "DimGrey" "black")))
416 "List of basic colors available on color displays. 541 "List of basic colors available on color displays.
417For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20. 542For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20.
418For Nextstep, this is a list of non-PANTONE colors returned by 543For Nextstep, this is a list of non-PANTONE colors returned by
@@ -423,11 +548,13 @@ the operating system.")
423(defun xw-defined-colors (&optional frame) 548(defun xw-defined-colors (&optional frame)
424 "Internal function called by `defined-colors', which see." 549 "Internal function called by `defined-colors', which see."
425 (or frame (setq frame (selected-frame))) 550 (or frame (setq frame (selected-frame)))
551 ;; FIXME for ns, this is just... x-colors.
426 (let (defined-colors) 552 (let (defined-colors)
427 (dolist (this-color (if (eq system-type 'windows-nt) 553 (dolist (this-color (if (eq system-type 'windows-nt)
428 (or (mapcar 'car w32-color-map) x-colors) 554 (or (mapcar 'car w32-color-map) x-colors)
429 x-colors)) 555 x-colors))
430 (and (color-supported-p this-color frame t) 556 (and (or (color-supported-p this-color frame t)
557 (featurep 'ns))
431 (setq defined-colors (cons this-color defined-colors)))) 558 (setq defined-colors (cons this-color defined-colors))))
432 defined-colors)) 559 defined-colors))
433 560
diff --git a/lisp/term/ns-win.el b/lisp/term/ns-win.el
index ccbe9be7f9d..b09dd7a01f7 100644
--- a/lisp/term/ns-win.el
+++ b/lisp/term/ns-win.el
@@ -42,11 +42,9 @@
42;;; Code: 42;;; Code:
43 43
44 44
45(if (not (featurep 'ns)) 45(or (featurep 'ns)
46 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS" 46 (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
47 (invocation-name))) 47 (invocation-name)))
48
49(eval-when-compile (require 'cl))
50 48
51;; Documentation-purposes only: actually loaded in loadup.el 49;; Documentation-purposes only: actually loaded in loadup.el
52(require 'frame) 50(require 'frame)
@@ -84,10 +82,7 @@
84(defun ns-handle-numeric-switch (switch) 82(defun ns-handle-numeric-switch (switch)
85 (ns-handle-switch switch t)) 83 (ns-handle-switch switch t))
86 84
87;; Make -iconic apply only to the initial frame! 85(defalias 'ns-handle-iconic 'x-handle-iconic)
88(defun ns-handle-iconic (switch)
89 (setq initial-frame-alist
90 (cons '(visibility . icon) initial-frame-alist)))
91 86
92;; Handle the -name option, set the name of the initial frame. 87;; Handle the -name option, set the name of the initial frame.
93(defun ns-handle-name-switch (switch) 88(defun ns-handle-name-switch (switch)
@@ -96,12 +91,6 @@
96 (setq initial-frame-alist (cons (cons 'name (pop ns-invocation-args)) 91 (setq initial-frame-alist (cons (cons 'name (pop ns-invocation-args))
97 initial-frame-alist))) 92 initial-frame-alist)))
98 93
99;; Set (but not used?) in frame.el.
100(defvar x-display-name nil
101 "The name of the window display on which Emacs was started.
102On X, the display name of individual X frames is recorded in the
103`display' frame parameter.")
104
105;; nsterm.m. 94;; nsterm.m.
106(defvar ns-input-file) 95(defvar ns-input-file)
107 96
@@ -183,20 +172,7 @@ The properties returned may include `top', `left', `height', and `width'."
183 172
184;;;; Keyboard mapping. 173;;;; Keyboard mapping.
185 174
186(defvar ns-alternatives-map 175(define-obsolete-variable-alias 'ns-alternatives-map 'x-alternatives-map "24.1")
187 (let ((map (make-sparse-keymap)))
188 ;; Map certain keypad keys into ASCII characters
189 ;; that people usually expect.
190 (define-key map [S-tab] [backtab])
191 (define-key map [M-backspace] [?\M-\d])
192 (define-key map [M-delete] [?\M-\d])
193 (define-key map [M-tab] [?\M-\t])
194 (define-key map [M-linefeed] [?\M-\n])
195 (define-key map [M-clear] [?\M-\C-l])
196 (define-key map [M-return] [?\M-\C-m])
197 (define-key map [M-escape] [?\M-\e])
198 map)
199 "Keymap of alternative meanings for some keys under Nextstep.")
200 176
201;; Here are some Nextstep-like bindings for command key sequences. 177;; Here are some Nextstep-like bindings for command key sequences.
202(define-key global-map [?\s-,] 'customize) 178(define-key global-map [?\s-,] 'customize)
@@ -286,115 +262,6 @@ The properties returned may include `top', `left', `height', and `width'."
286(declare-function ns-do-applescript "nsfns.m" (script)) 262(declare-function ns-do-applescript "nsfns.m" (script))
287(defalias 'do-applescript 'ns-do-applescript) 263(defalias 'do-applescript 'ns-do-applescript)
288 264
289(defun x-setup-function-keys (frame)
290 "Set up `function-key-map' on the graphical frame FRAME."
291 (unless (terminal-parameter frame 'x-setup-function-keys)
292 (with-selected-frame frame
293 (setq interprogram-cut-function 'x-select-text
294 interprogram-paste-function 'x-selection-value)
295 (let ((map (copy-keymap ns-alternatives-map)))
296 (set-keymap-parent map (keymap-parent local-function-key-map))
297 (set-keymap-parent local-function-key-map map))
298 (setq system-key-alist
299 (list
300 (cons (logior (lsh 0 16) 1) 'ns-power-off)
301 (cons (logior (lsh 0 16) 2) 'ns-open-file)
302 (cons (logior (lsh 0 16) 3) 'ns-open-temp-file)
303 (cons (logior (lsh 0 16) 4) 'ns-drag-file)
304 (cons (logior (lsh 0 16) 5) 'ns-drag-color)
305 (cons (logior (lsh 0 16) 6) 'ns-drag-text)
306 (cons (logior (lsh 0 16) 7) 'ns-change-font)
307 (cons (logior (lsh 0 16) 8) 'ns-open-file-line)
308; (cons (logior (lsh 0 16) 9) 'ns-insert-working-text)
309; (cons (logior (lsh 0 16) 10) 'ns-delete-working-text)
310 (cons (logior (lsh 0 16) 11) 'ns-spi-service-call)
311 (cons (logior (lsh 0 16) 12) 'ns-new-frame)
312 (cons (logior (lsh 0 16) 13) 'ns-toggle-toolbar)
313 (cons (logior (lsh 0 16) 14) 'ns-show-prefs)
314 (cons (logior (lsh 1 16) 32) 'f1)
315 (cons (logior (lsh 1 16) 33) 'f2)
316 (cons (logior (lsh 1 16) 34) 'f3)
317 (cons (logior (lsh 1 16) 35) 'f4)
318 (cons (logior (lsh 1 16) 36) 'f5)
319 (cons (logior (lsh 1 16) 37) 'f6)
320 (cons (logior (lsh 1 16) 38) 'f7)
321 (cons (logior (lsh 1 16) 39) 'f8)
322 (cons (logior (lsh 1 16) 40) 'f9)
323 (cons (logior (lsh 1 16) 41) 'f10)
324 (cons (logior (lsh 1 16) 42) 'f11)
325 (cons (logior (lsh 1 16) 43) 'f12)
326 (cons (logior (lsh 1 16) 44) 'kp-insert)
327 (cons (logior (lsh 1 16) 45) 'kp-delete)
328 (cons (logior (lsh 1 16) 46) 'kp-home)
329 (cons (logior (lsh 1 16) 47) 'kp-end)
330 (cons (logior (lsh 1 16) 48) 'kp-prior)
331 (cons (logior (lsh 1 16) 49) 'kp-next)
332 (cons (logior (lsh 1 16) 50) 'print-screen)
333 (cons (logior (lsh 1 16) 51) 'scroll-lock)
334 (cons (logior (lsh 1 16) 52) 'pause)
335 (cons (logior (lsh 1 16) 53) 'system)
336 (cons (logior (lsh 1 16) 54) 'break)
337 (cons (logior (lsh 1 16) 56) 'please-tell-carl-what-this-key-is-called-56)
338 (cons (logior (lsh 1 16) 61) 'please-tell-carl-what-this-key-is-called-61)
339 (cons (logior (lsh 1 16) 62) 'please-tell-carl-what-this-key-is-called-62)
340 (cons (logior (lsh 1 16) 63) 'please-tell-carl-what-this-key-is-called-63)
341 (cons (logior (lsh 1 16) 64) 'please-tell-carl-what-this-key-is-called-64)
342 (cons (logior (lsh 1 16) 69) 'please-tell-carl-what-this-key-is-called-69)
343 (cons (logior (lsh 1 16) 70) 'please-tell-carl-what-this-key-is-called-70)
344 (cons (logior (lsh 1 16) 71) 'please-tell-carl-what-this-key-is-called-71)
345 (cons (logior (lsh 1 16) 72) 'please-tell-carl-what-this-key-is-called-72)
346 (cons (logior (lsh 1 16) 73) 'please-tell-carl-what-this-key-is-called-73)
347 (cons (logior (lsh 2 16) 3) 'kp-enter)
348 (cons (logior (lsh 2 16) 9) 'kp-tab)
349 (cons (logior (lsh 2 16) 28) 'kp-quit)
350 (cons (logior (lsh 2 16) 35) 'kp-hash)
351 (cons (logior (lsh 2 16) 42) 'kp-multiply)
352 (cons (logior (lsh 2 16) 43) 'kp-add)
353 (cons (logior (lsh 2 16) 44) 'kp-separator)
354 (cons (logior (lsh 2 16) 45) 'kp-subtract)
355 (cons (logior (lsh 2 16) 46) 'kp-decimal)
356 (cons (logior (lsh 2 16) 47) 'kp-divide)
357 (cons (logior (lsh 2 16) 48) 'kp-0)
358 (cons (logior (lsh 2 16) 49) 'kp-1)
359 (cons (logior (lsh 2 16) 50) 'kp-2)
360 (cons (logior (lsh 2 16) 51) 'kp-3)
361 (cons (logior (lsh 2 16) 52) 'kp-4)
362 (cons (logior (lsh 2 16) 53) 'kp-5)
363 (cons (logior (lsh 2 16) 54) 'kp-6)
364 (cons (logior (lsh 2 16) 55) 'kp-7)
365 (cons (logior (lsh 2 16) 56) 'kp-8)
366 (cons (logior (lsh 2 16) 57) 'kp-9)
367 (cons (logior (lsh 2 16) 60) 'kp-less)
368 (cons (logior (lsh 2 16) 61) 'kp-equal)
369 (cons (logior (lsh 2 16) 62) 'kp-more)
370 (cons (logior (lsh 2 16) 64) 'kp-at)
371 (cons (logior (lsh 2 16) 92) 'kp-backslash)
372 (cons (logior (lsh 2 16) 96) 'kp-backtick)
373 (cons (logior (lsh 2 16) 124) 'kp-bar)
374 (cons (logior (lsh 2 16) 126) 'kp-tilde)
375 (cons (logior (lsh 2 16) 157) 'kp-mu)
376 (cons (logior (lsh 2 16) 165) 'kp-yen)
377 (cons (logior (lsh 2 16) 167) 'kp-paragraph)
378 (cons (logior (lsh 2 16) 172) 'left)
379 (cons (logior (lsh 2 16) 173) 'up)
380 (cons (logior (lsh 2 16) 174) 'right)
381 (cons (logior (lsh 2 16) 175) 'down)
382 (cons (logior (lsh 2 16) 176) 'kp-ring)
383 (cons (logior (lsh 2 16) 201) 'kp-square)
384 (cons (logior (lsh 2 16) 204) 'kp-cube)
385 (cons (logior (lsh 3 16) 8) 'backspace)
386 (cons (logior (lsh 3 16) 9) 'tab)
387 (cons (logior (lsh 3 16) 10) 'linefeed)
388 (cons (logior (lsh 3 16) 11) 'clear)
389 (cons (logior (lsh 3 16) 13) 'return)
390 (cons (logior (lsh 3 16) 18) 'pause)
391 (cons (logior (lsh 3 16) 25) 'S-tab)
392 (cons (logior (lsh 3 16) 27) 'escape)
393 (cons (logior (lsh 3 16) 127) 'delete)
394 )))
395 (set-terminal-parameter frame 'x-setup-function-keys t)))
396
397
398;; Add a couple of menus and rearrange some others; easiest just to redo toplvl 265;; Add a couple of menus and rearrange some others; easiest just to redo toplvl
399;; Note keymap defns must be given last-to-first 266;; Note keymap defns must be given last-to-first
400(define-key global-map [menu-bar] (make-sparse-keymap "menu-bar")) 267(define-key global-map [menu-bar] (make-sparse-keymap "menu-bar"))
@@ -911,17 +778,16 @@ come with OS X.
911See the documentation of `create-fontset-from-fontset-spec' for the format.") 778See the documentation of `create-fontset-from-fontset-spec' for the format.")
912 779
913;; Conditional on new-fontset so bootstrapping works on non-GUI compiles. 780;; Conditional on new-fontset so bootstrapping works on non-GUI compiles.
914(if (fboundp 'new-fontset) 781(when (fboundp 'new-fontset)
915 (progn 782 ;; Setup the default fontset.
916 ;; Setup the default fontset. 783 (create-default-fontset)
917 (create-default-fontset) 784 ;; Create the standard fontset.
918 ;; Create the standard fontset. 785 (condition-case err
919 (condition-case err 786 (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
920 (create-fontset-from-fontset-spec ns-standard-fontset-spec t) 787 (error (display-warning
921 (error (display-warning 788 'initialization
922 'initialization 789 (format "Creation of the standard fontset failed: %s" err)
923 (format "Creation of the standard fontset failed: %s" err) 790 :error))))
924 :error)))))
925 791
926(defvar ns-reg-to-script) ; nsfont.m 792(defvar ns-reg-to-script) ; nsfont.m
927 793
@@ -985,23 +851,6 @@ See the documentation of `create-fontset-from-fontset-spec' for the format.")
985;; from x-selection-value. 851;; from x-selection-value.
986(defvar ns-last-selected-text nil) 852(defvar ns-last-selected-text nil)
987 853
988(defun x-select-text (text)
989 "Select TEXT, a string, according to the window system.
990
991On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
992clipboard. If `x-select-enable-primary' is non-nil, put TEXT in
993the primary selection.
994
995On MS-Windows, make TEXT the current selection. If
996`x-select-enable-clipboard' is non-nil, copy the text to the
997clipboard as well.
998
999On Nextstep, put TEXT in the pasteboard."
1000 ;; Don't send the pasteboard too much text.
1001 ;; It becomes slow, and if really big it causes errors.
1002 (ns-set-pasteboard text)
1003 (setq ns-last-selected-text text))
1004
1005;; Return the value of the current Nextstep selection. For 854;; Return the value of the current Nextstep selection. For
1006;; compatibility with older Nextstep applications, this checks cut 855;; compatibility with older Nextstep applications, this checks cut
1007;; buffer 0 before retrieving the value of the primary selection. 856;; buffer 0 before retrieving the value of the primary selection.
@@ -1093,27 +942,6 @@ On Nextstep, put TEXT in the pasteboard."
1093 942
1094;;;; Color support. 943;;;; Color support.
1095 944
1096(declare-function ns-list-colors "nsfns.m" (&optional frame))
1097
1098(defvar x-colors (ns-list-colors)
1099 "List of basic colors available on color displays.
1100For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20.
1101For Nextstep, this is a list of non-PANTONE colors returned by
1102the operating system.")
1103
1104(defun xw-defined-colors (&optional frame)
1105 "Internal function called by `defined-colors', which see."
1106 (or frame (setq frame (selected-frame)))
1107 (let ((all-colors x-colors)
1108 (this-color nil)
1109 (defined-colors nil))
1110 (while all-colors
1111 (setq this-color (car all-colors)
1112 all-colors (cdr all-colors))
1113 ;; (and (face-color-supported-p frame this-color t)
1114 (setq defined-colors (cons this-color defined-colors))) ;;)
1115 defined-colors))
1116
1117;; Functions for color panel + drag 945;; Functions for color panel + drag
1118(defun ns-face-at-pos (pos) 946(defun ns-face-at-pos (pos)
1119 (let* ((frame (car pos)) 947 (let* ((frame (car pos))
diff --git a/lisp/term/pc-win.el b/lisp/term/pc-win.el
index 16e7e8f88f0..767c291c754 100644
--- a/lisp/term/pc-win.el
+++ b/lisp/term/pc-win.el
@@ -204,8 +204,10 @@ the operating system.")
204This is in addition to, but in preference to, the primary selection. 204This is in addition to, but in preference to, the primary selection.
205 205
206Note that MS-Windows does not support selection types other than the 206Note that MS-Windows does not support selection types other than the
207clipboard. \(The primary selection that is set by Emacs is not 207clipboard. (The primary selection that is set by Emacs is not
208accessible to other programs on MS-Windows.\)" 208accessible to other programs on MS-Windows.)
209
210This variable is not used by the Nextstep port."
209 :type 'boolean 211 :type 'boolean
210 :group 'killing) 212 :group 'killing)
211 213