changeset 111183:72ef880ed198

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.
author Glenn Morris <rgm@gnu.org>
date Mon, 25 Oct 2010 19:59:05 -0700
parents d6dad5b04eb8
children c7c697c81a21
files lisp/ChangeLog lisp/loadup.el lisp/term/common-win.el lisp/term/ns-win.el lisp/term/pc-win.el
diffstat 5 files changed, 347 insertions(+), 374 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Tue Oct 26 10:31:27 2010 +0900
+++ b/lisp/ChangeLog	Mon Oct 25 19:59:05 2010 -0700
@@ -1,3 +1,17 @@
+2010-10-26  Glenn Morris  <rgm@gnu.org>
+
+	* term/common-win.el (x-select-enable-clipboard):
+	* term/pc-win.el (x-select-enable-clipboard): Doc fix.
+
+	* 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.
+	* term/common-win.el (x-select-text, x-alternatives-map)
+	(x-setup-function-keys, x-colors, xw-defined-colors): Handle 'ns case.
+	* loadup.el [ns]: Load common-win.
+
 2010-10-26  Daiki Ueno  <ueno@unixuser.org>
 
 	* epa-mail.el (epa-mail-encrypt): Handle local-part only
--- a/lisp/loadup.el	Tue Oct 26 10:31:27 2010 +0900
+++ b/lisp/loadup.el	Mon Oct 25 19:59:05 2010 -0700
@@ -233,7 +233,9 @@
       (load "ls-lisp")
       (load "disp-table"))) ; needed to setup ibm-pc char set, see internal.el
 (if (featurep 'ns)
-    (load "term/ns-win"))
+    (progn
+      (load "term/common-win")
+      (load "term/ns-win")))
 (if (fboundp 'x-create-frame)
     ;; Do it after loading term/foo-win.el since the value of the
     ;; mouse-wheel-*-event vars depends on those files being loaded or not.
--- a/lisp/term/common-win.el	Tue Oct 26 10:31:27 2010 +0900
+++ b/lisp/term/common-win.el	Mon Oct 25 19:59:05 2010 -0700
@@ -1,7 +1,7 @@
 ;;; common-win.el --- common part of handling window systems
 
 ;; Copyright (C) 1993, 1994, 2001, 2002, 2003, 2004, 2005, 2006, 2007,
-;;   2008, 2009, 2010 Free Software Foundation, Inc.
+;;   2008, 2009, 2010  Free Software Foundation, Inc.
 
 ;; Maintainer: FSF
 ;; Keywords: terminals
@@ -30,8 +30,10 @@
 This is in addition to, but in preference to, the primary selection.
 
 Note that MS-Windows does not support selection types other than the
-clipboard.   \(The primary selection that is set by Emacs is not
-accessible to other programs on MS-Windows.\)"
+clipboard.  (The primary selection that is set by Emacs is not
+accessible to other programs on MS-Windows.)
+
+This variable is not used by the Nextstep port."
   :type 'boolean
   :group 'killing
   ;; The GNU/Linux version changed in 24.1, the MS-Windows version did not.
@@ -40,6 +42,8 @@
 (defvar x-last-selected-text)		; w32-fns.el
 (declare-function w32-set-clipboard-data "w32select.c"
 		  (string &optional ignored))
+(defvar ns-last-selected-text)		; ns-win.el
+(declare-function ns-set-pasteboard "ns-win" (string))
 
 (defun x-select-text (text)
   "Select TEXT, a string, according to the window system.
@@ -52,20 +56,26 @@
 `x-select-enable-clipboard' is non-nil, copy the text to the
 clipboard as well.
 
-On Nextstep, put TEXT in the pasteboard."
-  (if (eq system-type 'windows-nt)
-      (progn
-	(if x-select-enable-clipboard
-	    (w32-set-clipboard-data text))
-	(setq x-last-selected-text text))
-    ;; With multi-tty, this function may be called from a tty frame.
-    (when (eq (framep (selected-frame)) 'x)
-      (when x-select-enable-primary
-	(x-set-selection 'PRIMARY text)
-	(setq x-last-selected-text-primary text))
-      (when x-select-enable-clipboard
-	(x-set-selection 'CLIPBOARD text)
-	(setq x-last-selected-text-clipboard text)))))
+On Nextstep, put TEXT in the pasteboard (`x-select-enable-clipboard'
+is not used)."
+  (cond ((eq system-type 'windows-nt)
+	 (if x-select-enable-clipboard
+	     (w32-set-clipboard-data text))
+	 (setq x-last-selected-text text))
+	((featurep 'ns)
+	 ;; Don't send the pasteboard too much text.
+	 ;; It becomes slow, and if really big it causes errors.
+	 (ns-set-pasteboard text)
+	 (setq ns-last-selected-text text))
+	(t
+	 ;; With multi-tty, this function may be called from a tty frame.
+	 (when (eq (framep (selected-frame)) 'x)
+	   (when x-select-enable-primary
+	     (x-set-selection 'PRIMARY text)
+	     (setq x-last-selected-text-primary text))
+	   (when x-select-enable-clipboard
+	     (x-set-selection 'CLIPBOARD text)
+	     (setq x-last-selected-text-clipboard text))))))
 
 ;;;; Function keys
 
@@ -79,9 +89,11 @@
     (define-key map [M-clear] [?\M-\C-l])
     (define-key map [M-return] [?\M-\C-m])
     (define-key map [M-escape] [?\M-\e])
-    (define-key map [iso-lefttab] [backtab])
-    (define-key map [S-iso-lefttab] [backtab])
-    (and (eq system-type 'windows-nt)
+    (unless (featurep 'ns)
+      (define-key map [iso-lefttab] [backtab])
+      (define-key map [S-iso-lefttab] [backtab]))
+    (and (or (eq system-type 'windows-nt)
+	     (featurep 'ns))
 	 (define-key map [S-tab] [backtab]))
     map)
   "Keymap of possible alternative meanings for some keys.")
@@ -95,7 +107,117 @@
     (with-selected-frame frame
       (let ((map (copy-keymap x-alternatives-map)))
         (set-keymap-parent map (keymap-parent local-function-key-map))
-        (set-keymap-parent local-function-key-map map)))
+        (set-keymap-parent local-function-key-map map))
+      (when (featurep 'ns)
+	(setq interprogram-cut-function 'x-select-text
+	      interprogram-paste-function 'x-selection-value
+	      system-key-alist
+	      (list
+	       (cons (logior (lsh 0 16)   1) 'ns-power-off)
+	       (cons (logior (lsh 0 16)   2) 'ns-open-file)
+	       (cons (logior (lsh 0 16)   3) 'ns-open-temp-file)
+	       (cons (logior (lsh 0 16)   4) 'ns-drag-file)
+	       (cons (logior (lsh 0 16)   5) 'ns-drag-color)
+	       (cons (logior (lsh 0 16)   6) 'ns-drag-text)
+	       (cons (logior (lsh 0 16)   7) 'ns-change-font)
+	       (cons (logior (lsh 0 16)   8) 'ns-open-file-line)
+;;;	       (cons (logior (lsh 0 16)   9) 'ns-insert-working-text)
+;;;	       (cons (logior (lsh 0 16)  10) 'ns-delete-working-text)
+	       (cons (logior (lsh 0 16)  11) 'ns-spi-service-call)
+	       (cons (logior (lsh 0 16)  12) 'ns-new-frame)
+	       (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
+	       (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
+	       (cons (logior (lsh 1 16)  32) 'f1)
+	       (cons (logior (lsh 1 16)  33) 'f2)
+	       (cons (logior (lsh 1 16)  34) 'f3)
+	       (cons (logior (lsh 1 16)  35) 'f4)
+	       (cons (logior (lsh 1 16)  36) 'f5)
+	       (cons (logior (lsh 1 16)  37) 'f6)
+	       (cons (logior (lsh 1 16)  38) 'f7)
+	       (cons (logior (lsh 1 16)  39) 'f8)
+	       (cons (logior (lsh 1 16)  40) 'f9)
+	       (cons (logior (lsh 1 16)  41) 'f10)
+	       (cons (logior (lsh 1 16)  42) 'f11)
+	       (cons (logior (lsh 1 16)  43) 'f12)
+	       (cons (logior (lsh 1 16)  44) 'kp-insert)
+	       (cons (logior (lsh 1 16)  45) 'kp-delete)
+	       (cons (logior (lsh 1 16)  46) 'kp-home)
+	       (cons (logior (lsh 1 16)  47) 'kp-end)
+	       (cons (logior (lsh 1 16)  48) 'kp-prior)
+	       (cons (logior (lsh 1 16)  49) 'kp-next)
+	       (cons (logior (lsh 1 16)  50) 'print-screen)
+	       (cons (logior (lsh 1 16)  51) 'scroll-lock)
+	       (cons (logior (lsh 1 16)  52) 'pause)
+	       (cons (logior (lsh 1 16)  53) 'system)
+	       (cons (logior (lsh 1 16)  54) 'break)
+	       ;; Erm, this looks like a FIXME...
+	       (cons (logior (lsh 1 16)  56)
+		     'please-tell-carl-what-this-key-is-called-56)
+	       (cons (logior (lsh 1 16)  61)
+		     'please-tell-carl-what-this-key-is-called-61)
+	       (cons (logior (lsh 1 16)  62)
+		     'please-tell-carl-what-this-key-is-called-62)
+	       (cons (logior (lsh 1 16)  63)
+		     'please-tell-carl-what-this-key-is-called-63)
+	       (cons (logior (lsh 1 16)  64)
+		     'please-tell-carl-what-this-key-is-called-64)
+	       (cons (logior (lsh 1 16)  69)
+		     'please-tell-carl-what-this-key-is-called-69)
+	       (cons (logior (lsh 1 16)  70)
+		     'please-tell-carl-what-this-key-is-called-70)
+	       (cons (logior (lsh 1 16)  71)
+		     'please-tell-carl-what-this-key-is-called-71)
+	       (cons (logior (lsh 1 16)  72)
+		     'please-tell-carl-what-this-key-is-called-72)
+	       (cons (logior (lsh 1 16)  73)
+		     'please-tell-carl-what-this-key-is-called-73)
+	       (cons (logior (lsh 2 16)   3) 'kp-enter)
+	       (cons (logior (lsh 2 16)   9) 'kp-tab)
+	       (cons (logior (lsh 2 16)  28) 'kp-quit)
+	       (cons (logior (lsh 2 16)  35) 'kp-hash)
+	       (cons (logior (lsh 2 16)  42) 'kp-multiply)
+	       (cons (logior (lsh 2 16)  43) 'kp-add)
+	       (cons (logior (lsh 2 16)  44) 'kp-separator)
+	       (cons (logior (lsh 2 16)  45) 'kp-subtract)
+	       (cons (logior (lsh 2 16)  46) 'kp-decimal)
+	       (cons (logior (lsh 2 16)  47) 'kp-divide)
+	       (cons (logior (lsh 2 16)  48) 'kp-0)
+	       (cons (logior (lsh 2 16)  49) 'kp-1)
+	       (cons (logior (lsh 2 16)  50) 'kp-2)
+	       (cons (logior (lsh 2 16)  51) 'kp-3)
+	       (cons (logior (lsh 2 16)  52) 'kp-4)
+	       (cons (logior (lsh 2 16)  53) 'kp-5)
+	       (cons (logior (lsh 2 16)  54) 'kp-6)
+	       (cons (logior (lsh 2 16)  55) 'kp-7)
+	       (cons (logior (lsh 2 16)  56) 'kp-8)
+	       (cons (logior (lsh 2 16)  57) 'kp-9)
+	       (cons (logior (lsh 2 16)  60) 'kp-less)
+	       (cons (logior (lsh 2 16)  61) 'kp-equal)
+	       (cons (logior (lsh 2 16)  62) 'kp-more)
+	       (cons (logior (lsh 2 16)  64) 'kp-at)
+	       (cons (logior (lsh 2 16)  92) 'kp-backslash)
+	       (cons (logior (lsh 2 16)  96) 'kp-backtick)
+	       (cons (logior (lsh 2 16) 124) 'kp-bar)
+	       (cons (logior (lsh 2 16) 126) 'kp-tilde)
+	       (cons (logior (lsh 2 16) 157) 'kp-mu)
+	       (cons (logior (lsh 2 16) 165) 'kp-yen)
+	       (cons (logior (lsh 2 16) 167) 'kp-paragraph)
+	       (cons (logior (lsh 2 16) 172) 'left)
+	       (cons (logior (lsh 2 16) 173) 'up)
+	       (cons (logior (lsh 2 16) 174) 'right)
+	       (cons (logior (lsh 2 16) 175) 'down)
+	       (cons (logior (lsh 2 16) 176) 'kp-ring)
+	       (cons (logior (lsh 2 16) 201) 'kp-square)
+	       (cons (logior (lsh 2 16) 204) 'kp-cube)
+	       (cons (logior (lsh 3 16)   8) 'backspace)
+	       (cons (logior (lsh 3 16)   9) 'tab)
+	       (cons (logior (lsh 3 16)  10) 'linefeed)
+	       (cons (logior (lsh 3 16)  11) 'clear)
+	       (cons (logior (lsh 3 16)  13) 'return)
+	       (cons (logior (lsh 3 16)  18) 'pause)
+	       (cons (logior (lsh 3 16)  25) 'S-tab)
+	       (cons (logior (lsh 3 16)  27) 'escape)
+	       (cons (logior (lsh 3 16) 127) 'delete)))))
     (set-terminal-parameter frame 'x-setup-function-keys t)))
 
 (defvar x-invocation-args)
@@ -201,7 +323,7 @@
 \(e.g., \"black\") in the option handler code (e.g., x-handle-switch).
 This function returns ARGS minus the arguments that have been processed."
   ;; We use ARGS to accumulate the args that we don't handle here, to return.
-  (setq x-invocation-args args
+  (setq x-invocation-args args		; FIXME let-bind?
 	args nil)
   (while (and x-invocation-args
 	      (not (equal (car x-invocation-args) "--")))
@@ -250,169 +372,172 @@
 ;; white, (v) numbered colors sorted by hue, and (vi) numbered shades
 ;; of grey.
 
+(declare-function ns-list-colors "nsfns.m" (&optional frame))
+
 (defvar x-colors
-  (purecopy
-   '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97"
-     "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94"
-     "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90"
-     "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87"
-     "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83"
-     "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80"
-     "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76"
-     "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73"
-     "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69"
-     "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66"
-     "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62"
-     "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59"
-     "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55"
-     "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52"
-     "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48"
-     "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45"
-     "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41"
-     "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38"
-     "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34"
-     "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31"
-     "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27"
-     "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24"
-     "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20"
-     "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17"
-     "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13"
-     "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10"
-     "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6"
-     "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2"
-     "gray1" "grey1" "gray0" "grey0"
-     "LightPink1" "LightPink2" "LightPink3" "LightPink4"
-     "pink1" "pink2" "pink3" "pink4"
-     "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
-     "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4"
-     "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4"
-     "HotPink1" "HotPink2" "HotPink3" "HotPink4"
-     "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4"
-     "maroon1" "maroon2" "maroon3" "maroon4"
-     "orchid1" "orchid2" "orchid3" "orchid4"
-     "plum1" "plum2" "plum3" "plum4"
-     "thistle1" "thistle2" "thistle3" "thistle4"
-     "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4"
-     "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4"
-     "purple1" "purple2" "purple3" "purple4"
-     "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4"
-     "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4"
-     "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
-     "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4"
-     "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4"
-     "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4"
-     "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4"
-     "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4"
-     "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4"
-     "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4"
-     "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4"
-     "azure1" "azure2" "azure3" "azure4"
-     "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4"
-     "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4"
-     "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4"
-     "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
-     "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4"
-     "honeydew1" "honeydew2" "honeydew3" "honeydew4"
-     "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4"
-     "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
-     "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4"
-     "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4"
-     "ivory1" "ivory2" "ivory3" "ivory4"
-     "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4"
-     "khaki1" "khaki2" "khaki3" "khaki4"
-     "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
-     "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4"
-     "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4"
-     "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4"
-     "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
-     "wheat1" "wheat2" "wheat3" "wheat4"
-     "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4"
-     "burlywood1" "burlywood2" "burlywood3" "burlywood4"
-     "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4"
-     "bisque1" "bisque2" "bisque3" "bisque4"
-     "tan1" "tan2" "tan3" "tan4"
-     "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4"
-     "seashell1" "seashell2" "seashell3" "seashell4"
-     "chocolate1" "chocolate2" "chocolate3" "chocolate4"
-     "sienna1" "sienna2" "sienna3" "sienna4"
-     "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4"
-     "salmon1" "salmon2" "salmon3" "salmon4"
-     "coral1" "coral2" "coral3" "coral4"
-     "tomato1" "tomato2" "tomato3" "tomato4"
-     "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4"
-     "snow1" "snow2" "snow3" "snow4"
-     "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
-     "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4"
-     "firebrick1" "firebrick2" "firebrick3" "firebrick4"
-     "brown1" "brown2" "brown3" "brown4"
-     "magenta1" "magenta2" "magenta3" "magenta4"
-     "blue1" "blue2" "blue3" "blue4"
-     "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4"
-     "turquoise1" "turquoise2" "turquoise3" "turquoise4"
-     "cyan1" "cyan2" "cyan3" "cyan4"
-     "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4"
-     "green1" "green2" "green3" "green4"
-     "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4"
-     "yellow1" "yellow2" "yellow3" "yellow4"
-     "gold1" "gold2" "gold3" "gold4"
-     "orange1" "orange2" "orange3" "orange4"
-     "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4"
-     "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
-     "red1" "red2" "red3" "red4"
-     "lavender blush" "LavenderBlush" "ghost white" "GhostWhite"
-     "lavender" "alice blue" "AliceBlue" "azure" "light cyan"
-     "LightCyan" "mint cream" "MintCream" "honeydew" "ivory"
-     "light goldenrod yellow" "LightGoldenrodYellow" "light yellow"
-     "LightYellow" "beige" "floral white" "FloralWhite" "old lace"
-     "OldLace" "blanched almond" "BlanchedAlmond" "moccasin"
-     "papaya whip" "PapayaWhip" "bisque" "antique white"
-     "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell"
-     "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink"
-     "hot pink" "HotPink" "deep pink" "DeepPink" "maroon"
-     "pale violet red" "PaleVioletRed" "violet red" "VioletRed"
-     "medium violet red" "MediumVioletRed" "violet" "plum" "thistle"
-     "orchid" "medium orchid" "MediumOrchid" "dark orchid"
-     "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple"
-     "MediumPurple" "light slate blue" "LightSlateBlue"
-     "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue"
-     "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue"
-     "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue"
-     "light steel blue" "LightSteelBlue" "cornflower blue"
-     "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue"
-     "RoyalBlue" "light slate gray" "light slate grey"
-     "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey"
-     "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey"
-     "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue"
-     "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue"
-     "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue"
-     "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise"
-     "medium turquoise" "MediumTurquoise" "dark turquoise"
-     "DarkTurquoise"  "dark cyan" "DarkCyan" "aquamarine"
-     "medium aquamarine" "MediumAquamarine" "light sea green"
-     "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green"
-     "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green"
-     "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen"
-     "forest green" "ForestGreen" "light green" "LightGreen"
-     "green yellow" "GreenYellow" "yellow green" "YellowGreen"
-     "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen"
-     "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki"
-     "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod"
-     "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod"
-     "wheat" "navajo white" "NavajoWhite" "tan" "burlywood"
-     "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown"
-     "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon"
-     "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon"
-     "salmon" "light coral" "LightCoral" "indian red" "IndianRed"
-     "firebrick" "brown" "dark red" "DarkRed" "magenta"
-     "dark magenta" "DarkMagenta" "dark violet" "DarkViolet"
-     "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue"
-     "cyan" "medium spring green" "MediumSpringGreen" "spring green"
-     "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse"
-     "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red"
-     "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro"
-     "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey"
-     "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray"
-     "dim grey" "DimGray" "DimGrey" "black"))
+  (if (featurep 'ns) (ns-list-colors)
+    (purecopy
+     '("gray100" "grey100" "gray99" "grey99" "gray98" "grey98" "gray97"
+       "grey97" "gray96" "grey96" "gray95" "grey95" "gray94" "grey94"
+       "gray93" "grey93" "gray92" "grey92" "gray91" "grey91" "gray90"
+       "grey90" "gray89" "grey89" "gray88" "grey88" "gray87" "grey87"
+       "gray86" "grey86" "gray85" "grey85" "gray84" "grey84" "gray83"
+       "grey83" "gray82" "grey82" "gray81" "grey81" "gray80" "grey80"
+       "gray79" "grey79" "gray78" "grey78" "gray77" "grey77" "gray76"
+       "grey76" "gray75" "grey75" "gray74" "grey74" "gray73" "grey73"
+       "gray72" "grey72" "gray71" "grey71" "gray70" "grey70" "gray69"
+       "grey69" "gray68" "grey68" "gray67" "grey67" "gray66" "grey66"
+       "gray65" "grey65" "gray64" "grey64" "gray63" "grey63" "gray62"
+       "grey62" "gray61" "grey61" "gray60" "grey60" "gray59" "grey59"
+       "gray58" "grey58" "gray57" "grey57" "gray56" "grey56" "gray55"
+       "grey55" "gray54" "grey54" "gray53" "grey53" "gray52" "grey52"
+       "gray51" "grey51" "gray50" "grey50" "gray49" "grey49" "gray48"
+       "grey48" "gray47" "grey47" "gray46" "grey46" "gray45" "grey45"
+       "gray44" "grey44" "gray43" "grey43" "gray42" "grey42" "gray41"
+       "grey41" "gray40" "grey40" "gray39" "grey39" "gray38" "grey38"
+       "gray37" "grey37" "gray36" "grey36" "gray35" "grey35" "gray34"
+       "grey34" "gray33" "grey33" "gray32" "grey32" "gray31" "grey31"
+       "gray30" "grey30" "gray29" "grey29" "gray28" "grey28" "gray27"
+       "grey27" "gray26" "grey26" "gray25" "grey25" "gray24" "grey24"
+       "gray23" "grey23" "gray22" "grey22" "gray21" "grey21" "gray20"
+       "grey20" "gray19" "grey19" "gray18" "grey18" "gray17" "grey17"
+       "gray16" "grey16" "gray15" "grey15" "gray14" "grey14" "gray13"
+       "grey13" "gray12" "grey12" "gray11" "grey11" "gray10" "grey10"
+       "gray9" "grey9" "gray8" "grey8" "gray7" "grey7" "gray6" "grey6"
+       "gray5" "grey5" "gray4" "grey4" "gray3" "grey3" "gray2" "grey2"
+       "gray1" "grey1" "gray0" "grey0"
+       "LightPink1" "LightPink2" "LightPink3" "LightPink4"
+       "pink1" "pink2" "pink3" "pink4"
+       "PaleVioletRed1" "PaleVioletRed2" "PaleVioletRed3" "PaleVioletRed4"
+       "LavenderBlush1" "LavenderBlush2" "LavenderBlush3" "LavenderBlush4"
+       "VioletRed1" "VioletRed2" "VioletRed3" "VioletRed4"
+       "HotPink1" "HotPink2" "HotPink3" "HotPink4"
+       "DeepPink1" "DeepPink2" "DeepPink3" "DeepPink4"
+       "maroon1" "maroon2" "maroon3" "maroon4"
+       "orchid1" "orchid2" "orchid3" "orchid4"
+       "plum1" "plum2" "plum3" "plum4"
+       "thistle1" "thistle2" "thistle3" "thistle4"
+       "MediumOrchid1" "MediumOrchid2" "MediumOrchid3" "MediumOrchid4"
+       "DarkOrchid1" "DarkOrchid2" "DarkOrchid3" "DarkOrchid4"
+       "purple1" "purple2" "purple3" "purple4"
+       "MediumPurple1" "MediumPurple2" "MediumPurple3" "MediumPurple4"
+       "SlateBlue1" "SlateBlue2" "SlateBlue3" "SlateBlue4"
+       "RoyalBlue1" "RoyalBlue2" "RoyalBlue3" "RoyalBlue4"
+       "LightSteelBlue1" "LightSteelBlue2" "LightSteelBlue3" "LightSteelBlue4"
+       "SlateGray1" "SlateGray2" "SlateGray3" "SlateGray4"
+       "DodgerBlue1" "DodgerBlue2" "DodgerBlue3" "DodgerBlue4"
+       "SteelBlue1" "SteelBlue2" "SteelBlue3" "SteelBlue4"
+       "SkyBlue1" "SkyBlue2" "SkyBlue3" "SkyBlue4"
+       "LightSkyBlue1" "LightSkyBlue2" "LightSkyBlue3" "LightSkyBlue4"
+       "LightBlue1" "LightBlue2" "LightBlue3" "LightBlue4"
+       "CadetBlue1" "CadetBlue2" "CadetBlue3" "CadetBlue4"
+       "azure1" "azure2" "azure3" "azure4"
+       "LightCyan1" "LightCyan2" "LightCyan3" "LightCyan4"
+       "PaleTurquoise1" "PaleTurquoise2" "PaleTurquoise3" "PaleTurquoise4"
+       "DarkSlateGray1" "DarkSlateGray2" "DarkSlateGray3" "DarkSlateGray4"
+       "aquamarine1" "aquamarine2" "aquamarine3" "aquamarine4"
+       "SeaGreen1" "SeaGreen2" "SeaGreen3" "SeaGreen4"
+       "honeydew1" "honeydew2" "honeydew3" "honeydew4"
+       "DarkSeaGreen1" "DarkSeaGreen2" "DarkSeaGreen3" "DarkSeaGreen4"
+       "PaleGreen1" "PaleGreen2" "PaleGreen3" "PaleGreen4"
+       "DarkOliveGreen1" "DarkOliveGreen2" "DarkOliveGreen3" "DarkOliveGreen4"
+       "OliveDrab1" "OliveDrab2" "OliveDrab3" "OliveDrab4"
+       "ivory1" "ivory2" "ivory3" "ivory4"
+       "LightYellow1" "LightYellow2" "LightYellow3" "LightYellow4"
+       "khaki1" "khaki2" "khaki3" "khaki4"
+       "LemonChiffon1" "LemonChiffon2" "LemonChiffon3" "LemonChiffon4"
+       "LightGoldenrod1" "LightGoldenrod2" "LightGoldenrod3" "LightGoldenrod4"
+       "cornsilk1" "cornsilk2" "cornsilk3" "cornsilk4"
+       "goldenrod1" "goldenrod2" "goldenrod3" "goldenrod4"
+       "DarkGoldenrod1" "DarkGoldenrod2" "DarkGoldenrod3" "DarkGoldenrod4"
+       "wheat1" "wheat2" "wheat3" "wheat4"
+       "NavajoWhite1" "NavajoWhite2" "NavajoWhite3" "NavajoWhite4"
+       "burlywood1" "burlywood2" "burlywood3" "burlywood4"
+       "AntiqueWhite1" "AntiqueWhite2" "AntiqueWhite3" "AntiqueWhite4"
+       "bisque1" "bisque2" "bisque3" "bisque4"
+       "tan1" "tan2" "tan3" "tan4"
+       "PeachPuff1" "PeachPuff2" "PeachPuff3" "PeachPuff4"
+       "seashell1" "seashell2" "seashell3" "seashell4"
+       "chocolate1" "chocolate2" "chocolate3" "chocolate4"
+       "sienna1" "sienna2" "sienna3" "sienna4"
+       "LightSalmon1" "LightSalmon2" "LightSalmon3" "LightSalmon4"
+       "salmon1" "salmon2" "salmon3" "salmon4"
+       "coral1" "coral2" "coral3" "coral4"
+       "tomato1" "tomato2" "tomato3" "tomato4"
+       "MistyRose1" "MistyRose2" "MistyRose3" "MistyRose4"
+       "snow1" "snow2" "snow3" "snow4"
+       "RosyBrown1" "RosyBrown2" "RosyBrown3" "RosyBrown4"
+       "IndianRed1" "IndianRed2" "IndianRed3" "IndianRed4"
+       "firebrick1" "firebrick2" "firebrick3" "firebrick4"
+       "brown1" "brown2" "brown3" "brown4"
+       "magenta1" "magenta2" "magenta3" "magenta4"
+       "blue1" "blue2" "blue3" "blue4"
+       "DeepSkyBlue1" "DeepSkyBlue2" "DeepSkyBlue3" "DeepSkyBlue4"
+       "turquoise1" "turquoise2" "turquoise3" "turquoise4"
+       "cyan1" "cyan2" "cyan3" "cyan4"
+       "SpringGreen1" "SpringGreen2" "SpringGreen3" "SpringGreen4"
+       "green1" "green2" "green3" "green4"
+       "chartreuse1" "chartreuse2" "chartreuse3" "chartreuse4"
+       "yellow1" "yellow2" "yellow3" "yellow4"
+       "gold1" "gold2" "gold3" "gold4"
+       "orange1" "orange2" "orange3" "orange4"
+       "DarkOrange1" "DarkOrange2" "DarkOrange3" "DarkOrange4"
+       "OrangeRed1" "OrangeRed2" "OrangeRed3" "OrangeRed4"
+       "red1" "red2" "red3" "red4"
+       "lavender blush" "LavenderBlush" "ghost white" "GhostWhite"
+       "lavender" "alice blue" "AliceBlue" "azure" "light cyan"
+       "LightCyan" "mint cream" "MintCream" "honeydew" "ivory"
+       "light goldenrod yellow" "LightGoldenrodYellow" "light yellow"
+       "LightYellow" "beige" "floral white" "FloralWhite" "old lace"
+       "OldLace" "blanched almond" "BlanchedAlmond" "moccasin"
+       "papaya whip" "PapayaWhip" "bisque" "antique white"
+       "AntiqueWhite" "linen" "peach puff" "PeachPuff" "seashell"
+       "misty rose" "MistyRose" "snow" "light pink" "LightPink" "pink"
+       "hot pink" "HotPink" "deep pink" "DeepPink" "maroon"
+       "pale violet red" "PaleVioletRed" "violet red" "VioletRed"
+       "medium violet red" "MediumVioletRed" "violet" "plum" "thistle"
+       "orchid" "medium orchid" "MediumOrchid" "dark orchid"
+       "DarkOrchid" "purple" "blue violet" "BlueViolet" "medium purple"
+       "MediumPurple" "light slate blue" "LightSlateBlue"
+       "medium slate blue" "MediumSlateBlue" "slate blue" "SlateBlue"
+       "dark slate blue" "DarkSlateBlue" "midnight blue" "MidnightBlue"
+       "navy" "navy blue" "NavyBlue" "dark blue" "DarkBlue"
+       "light steel blue" "LightSteelBlue" "cornflower blue"
+       "CornflowerBlue" "dodger blue" "DodgerBlue" "royal blue"
+       "RoyalBlue" "light slate gray" "light slate grey"
+       "LightSlateGray" "LightSlateGrey" "slate gray" "slate grey"
+       "SlateGray" "SlateGrey" "dark slate gray" "dark slate grey"
+       "DarkSlateGray" "DarkSlateGrey" "steel blue" "SteelBlue"
+       "cadet blue" "CadetBlue" "light sky blue" "LightSkyBlue"
+       "sky blue" "SkyBlue" "light blue" "LightBlue" "powder blue"
+       "PowderBlue" "pale turquoise" "PaleTurquoise" "turquoise"
+       "medium turquoise" "MediumTurquoise" "dark turquoise"
+       "DarkTurquoise"  "dark cyan" "DarkCyan" "aquamarine"
+       "medium aquamarine" "MediumAquamarine" "light sea green"
+       "LightSeaGreen" "medium sea green" "MediumSeaGreen" "sea green"
+       "SeaGreen" "dark sea green" "DarkSeaGreen" "pale green"
+       "PaleGreen" "lime green" "LimeGreen" "dark green" "DarkGreen"
+       "forest green" "ForestGreen" "light green" "LightGreen"
+       "green yellow" "GreenYellow" "yellow green" "YellowGreen"
+       "olive drab" "OliveDrab" "dark olive green" "DarkOliveGreen"
+       "lemon chiffon" "LemonChiffon" "khaki" "dark khaki" "DarkKhaki"
+       "cornsilk" "pale goldenrod" "PaleGoldenrod" "light goldenrod"
+       "LightGoldenrod" "goldenrod" "dark goldenrod" "DarkGoldenrod"
+       "wheat" "navajo white" "NavajoWhite" "tan" "burlywood"
+       "sandy brown" "SandyBrown" "peru" "chocolate" "saddle brown"
+       "SaddleBrown" "sienna" "rosy brown" "RosyBrown" "dark salmon"
+       "DarkSalmon" "coral" "tomato" "light salmon" "LightSalmon"
+       "salmon" "light coral" "LightCoral" "indian red" "IndianRed"
+       "firebrick" "brown" "dark red" "DarkRed" "magenta"
+       "dark magenta" "DarkMagenta" "dark violet" "DarkViolet"
+       "medium blue" "MediumBlue" "blue" "deep sky blue" "DeepSkyBlue"
+       "cyan" "medium spring green" "MediumSpringGreen" "spring green"
+       "SpringGreen" "green" "lawn green" "LawnGreen" "chartreuse"
+       "yellow" "gold" "orange" "dark orange" "DarkOrange" "orange red"
+       "OrangeRed" "red" "white" "white smoke" "WhiteSmoke" "gainsboro"
+       "light gray" "light grey" "LightGray" "LightGrey" "gray" "grey"
+       "dark gray" "dark grey" "DarkGray" "DarkGrey" "dim gray"
+       "dim grey" "DimGray" "DimGrey" "black")))
   "List of basic colors available on color displays.
 For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20.
 For Nextstep, this is a list of non-PANTONE colors returned by
@@ -423,11 +548,13 @@
 (defun xw-defined-colors (&optional frame)
   "Internal function called by `defined-colors', which see."
   (or frame (setq frame (selected-frame)))
+  ;; FIXME for ns, this is just... x-colors.
   (let (defined-colors)
     (dolist (this-color (if (eq system-type 'windows-nt)
 			    (or (mapcar 'car w32-color-map) x-colors)
 			  x-colors))
-      (and (color-supported-p this-color frame t)
+      (and (or (color-supported-p this-color frame t)
+	       (featurep 'ns))
 	   (setq defined-colors (cons this-color defined-colors))))
     defined-colors))
 
--- a/lisp/term/ns-win.el	Tue Oct 26 10:31:27 2010 +0900
+++ b/lisp/term/ns-win.el	Mon Oct 25 19:59:05 2010 -0700
@@ -42,11 +42,9 @@
 ;;; Code:
 
 
-(if (not (featurep 'ns))
+(or (featurep 'ns)
     (error "%s: Loading ns-win.el but not compiled for GNUstep/MacOS"
-	   (invocation-name)))
-
-(eval-when-compile (require 'cl))
+           (invocation-name)))
 
 ;; Documentation-purposes only: actually loaded in loadup.el
 (require 'frame)
@@ -84,10 +82,7 @@
 (defun ns-handle-numeric-switch (switch)
   (ns-handle-switch switch t))
 
-;; Make -iconic apply only to the initial frame!
-(defun ns-handle-iconic (switch)
-  (setq initial-frame-alist
-        (cons '(visibility . icon) initial-frame-alist)))
+(defalias 'ns-handle-iconic 'x-handle-iconic)
 
 ;; Handle the -name option, set the name of the initial frame.
 (defun ns-handle-name-switch (switch)
@@ -96,12 +91,6 @@
   (setq initial-frame-alist (cons (cons 'name (pop ns-invocation-args))
                                   initial-frame-alist)))
 
-;; Set (but not used?) in frame.el.
-(defvar x-display-name nil
-  "The name of the window display on which Emacs was started.
-On X, the display name of individual X frames is recorded in the
-`display' frame parameter.")
-
 ;; nsterm.m.
 (defvar ns-input-file)
 
@@ -183,20 +172,7 @@
 
 ;;;; Keyboard mapping.
 
-(defvar ns-alternatives-map
-  (let ((map (make-sparse-keymap)))
-    ;; Map certain keypad keys into ASCII characters
-    ;; that people usually expect.
-    (define-key map [S-tab] [backtab])
-    (define-key map [M-backspace] [?\M-\d])
-    (define-key map [M-delete] [?\M-\d])
-    (define-key map [M-tab] [?\M-\t])
-    (define-key map [M-linefeed] [?\M-\n])
-    (define-key map [M-clear] [?\M-\C-l])
-    (define-key map [M-return] [?\M-\C-m])
-    (define-key map [M-escape] [?\M-\e])
-    map)
-  "Keymap of alternative meanings for some keys under Nextstep.")
+(define-obsolete-variable-alias 'ns-alternatives-map 'x-alternatives-map "24.1")
 
 ;; Here are some Nextstep-like bindings for command key sequences.
 (define-key global-map [?\s-,] 'customize)
@@ -286,115 +262,6 @@
 (declare-function ns-do-applescript "nsfns.m" (script))
 (defalias 'do-applescript 'ns-do-applescript)
 
-(defun x-setup-function-keys (frame)
-  "Set up `function-key-map' on the graphical frame FRAME."
-  (unless (terminal-parameter frame 'x-setup-function-keys)
-    (with-selected-frame frame
-      (setq interprogram-cut-function 'x-select-text
-	    interprogram-paste-function 'x-selection-value)
-      (let ((map (copy-keymap ns-alternatives-map)))
-	(set-keymap-parent map (keymap-parent local-function-key-map))
-	(set-keymap-parent local-function-key-map map))
-      (setq system-key-alist
-            (list
-             (cons (logior (lsh 0 16)   1) 'ns-power-off)
-             (cons (logior (lsh 0 16)   2) 'ns-open-file)
-             (cons (logior (lsh 0 16)   3) 'ns-open-temp-file)
-             (cons (logior (lsh 0 16)   4) 'ns-drag-file)
-             (cons (logior (lsh 0 16)   5) 'ns-drag-color)
-             (cons (logior (lsh 0 16)   6) 'ns-drag-text)
-             (cons (logior (lsh 0 16)   7) 'ns-change-font)
-             (cons (logior (lsh 0 16)   8) 'ns-open-file-line)
-;             (cons (logior (lsh 0 16)   9) 'ns-insert-working-text)
-;             (cons (logior (lsh 0 16)  10) 'ns-delete-working-text)
-             (cons (logior (lsh 0 16)  11) 'ns-spi-service-call)
-	     (cons (logior (lsh 0 16)  12) 'ns-new-frame)
-	     (cons (logior (lsh 0 16)  13) 'ns-toggle-toolbar)
-	     (cons (logior (lsh 0 16)  14) 'ns-show-prefs)
-	     (cons (logior (lsh 1 16)  32) 'f1)
-             (cons (logior (lsh 1 16)  33) 'f2)
-             (cons (logior (lsh 1 16)  34) 'f3)
-             (cons (logior (lsh 1 16)  35) 'f4)
-             (cons (logior (lsh 1 16)  36) 'f5)
-             (cons (logior (lsh 1 16)  37) 'f6)
-             (cons (logior (lsh 1 16)  38) 'f7)
-             (cons (logior (lsh 1 16)  39) 'f8)
-             (cons (logior (lsh 1 16)  40) 'f9)
-             (cons (logior (lsh 1 16)  41) 'f10)
-             (cons (logior (lsh 1 16)  42) 'f11)
-             (cons (logior (lsh 1 16)  43) 'f12)
-             (cons (logior (lsh 1 16)  44) 'kp-insert)
-             (cons (logior (lsh 1 16)  45) 'kp-delete)
-             (cons (logior (lsh 1 16)  46) 'kp-home)
-             (cons (logior (lsh 1 16)  47) 'kp-end)
-             (cons (logior (lsh 1 16)  48) 'kp-prior)
-             (cons (logior (lsh 1 16)  49) 'kp-next)
-             (cons (logior (lsh 1 16)  50) 'print-screen)
-             (cons (logior (lsh 1 16)  51) 'scroll-lock)
-             (cons (logior (lsh 1 16)  52) 'pause)
-             (cons (logior (lsh 1 16)  53) 'system)
-             (cons (logior (lsh 1 16)  54) 'break)
-             (cons (logior (lsh 1 16)  56) 'please-tell-carl-what-this-key-is-called-56)
-             (cons (logior (lsh 1 16)  61) 'please-tell-carl-what-this-key-is-called-61)
-             (cons (logior (lsh 1 16)  62) 'please-tell-carl-what-this-key-is-called-62)
-             (cons (logior (lsh 1 16)  63) 'please-tell-carl-what-this-key-is-called-63)
-             (cons (logior (lsh 1 16)  64) 'please-tell-carl-what-this-key-is-called-64)
-             (cons (logior (lsh 1 16)  69) 'please-tell-carl-what-this-key-is-called-69)
-             (cons (logior (lsh 1 16)  70) 'please-tell-carl-what-this-key-is-called-70)
-             (cons (logior (lsh 1 16)  71) 'please-tell-carl-what-this-key-is-called-71)
-             (cons (logior (lsh 1 16)  72) 'please-tell-carl-what-this-key-is-called-72)
-             (cons (logior (lsh 1 16)  73) 'please-tell-carl-what-this-key-is-called-73)
-             (cons (logior (lsh 2 16)   3) 'kp-enter)
-             (cons (logior (lsh 2 16)   9) 'kp-tab)
-             (cons (logior (lsh 2 16)  28) 'kp-quit)
-             (cons (logior (lsh 2 16)  35) 'kp-hash)
-             (cons (logior (lsh 2 16)  42) 'kp-multiply)
-             (cons (logior (lsh 2 16)  43) 'kp-add)
-             (cons (logior (lsh 2 16)  44) 'kp-separator)
-             (cons (logior (lsh 2 16)  45) 'kp-subtract)
-             (cons (logior (lsh 2 16)  46) 'kp-decimal)
-             (cons (logior (lsh 2 16)  47) 'kp-divide)
-             (cons (logior (lsh 2 16)  48) 'kp-0)
-             (cons (logior (lsh 2 16)  49) 'kp-1)
-             (cons (logior (lsh 2 16)  50) 'kp-2)
-             (cons (logior (lsh 2 16)  51) 'kp-3)
-             (cons (logior (lsh 2 16)  52) 'kp-4)
-             (cons (logior (lsh 2 16)  53) 'kp-5)
-             (cons (logior (lsh 2 16)  54) 'kp-6)
-             (cons (logior (lsh 2 16)  55) 'kp-7)
-             (cons (logior (lsh 2 16)  56) 'kp-8)
-             (cons (logior (lsh 2 16)  57) 'kp-9)
-             (cons (logior (lsh 2 16)  60) 'kp-less)
-             (cons (logior (lsh 2 16)  61) 'kp-equal)
-             (cons (logior (lsh 2 16)  62) 'kp-more)
-             (cons (logior (lsh 2 16)  64) 'kp-at)
-             (cons (logior (lsh 2 16)  92) 'kp-backslash)
-             (cons (logior (lsh 2 16)  96) 'kp-backtick)
-             (cons (logior (lsh 2 16) 124) 'kp-bar)
-             (cons (logior (lsh 2 16) 126) 'kp-tilde)
-             (cons (logior (lsh 2 16) 157) 'kp-mu)
-             (cons (logior (lsh 2 16) 165) 'kp-yen)
-             (cons (logior (lsh 2 16) 167) 'kp-paragraph)
-             (cons (logior (lsh 2 16) 172) 'left)
-             (cons (logior (lsh 2 16) 173) 'up)
-             (cons (logior (lsh 2 16) 174) 'right)
-             (cons (logior (lsh 2 16) 175) 'down)
-             (cons (logior (lsh 2 16) 176) 'kp-ring)
-             (cons (logior (lsh 2 16) 201) 'kp-square)
-             (cons (logior (lsh 2 16) 204) 'kp-cube)
-             (cons (logior (lsh 3 16)   8) 'backspace)
-             (cons (logior (lsh 3 16)   9) 'tab)
-             (cons (logior (lsh 3 16)  10) 'linefeed)
-             (cons (logior (lsh 3 16)  11) 'clear)
-             (cons (logior (lsh 3 16)  13) 'return)
-             (cons (logior (lsh 3 16)  18) 'pause)
-             (cons (logior (lsh 3 16)  25) 'S-tab)
-             (cons (logior (lsh 3 16)  27) 'escape)
-             (cons (logior (lsh 3 16) 127) 'delete)
-             )))
-    (set-terminal-parameter frame 'x-setup-function-keys t)))
-
-
 ;; Add a couple of menus and rearrange some others; easiest just to redo toplvl
 ;; Note keymap defns must be given last-to-first
 (define-key global-map [menu-bar] (make-sparse-keymap "menu-bar"))
@@ -911,17 +778,16 @@
 See the documentation of `create-fontset-from-fontset-spec' for the format.")
 
 ;; Conditional on new-fontset so bootstrapping works on non-GUI compiles.
-(if (fboundp 'new-fontset)
-    (progn
-      ;; Setup the default fontset.
-      (create-default-fontset)
-      ;; Create the standard fontset.
-      (condition-case err
-	  (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
-	(error (display-warning
-		'initialization
-		(format "Creation of the standard fontset failed: %s" err)
-		:error)))))
+(when (fboundp 'new-fontset)
+  ;; Setup the default fontset.
+  (create-default-fontset)
+  ;; Create the standard fontset.
+  (condition-case err
+      (create-fontset-from-fontset-spec ns-standard-fontset-spec t)
+    (error (display-warning
+            'initialization
+            (format "Creation of the standard fontset failed: %s" err)
+            :error))))
 
 (defvar ns-reg-to-script)               ; nsfont.m
 
@@ -985,23 +851,6 @@
 ;; from x-selection-value.
 (defvar ns-last-selected-text nil)
 
-(defun x-select-text (text)
-  "Select TEXT, a string, according to the window system.
-
-On X, if `x-select-enable-clipboard' is non-nil, copy TEXT to the
-clipboard.  If `x-select-enable-primary' is non-nil, put TEXT in
-the primary selection.
-
-On MS-Windows, make TEXT the current selection.  If
-`x-select-enable-clipboard' is non-nil, copy the text to the
-clipboard as well.
-
-On Nextstep, put TEXT in the pasteboard."
-  ;; Don't send the pasteboard too much text.
-  ;; It becomes slow, and if really big it causes errors.
-  (ns-set-pasteboard text)
-  (setq ns-last-selected-text text))
-
 ;; Return the value of the current Nextstep selection.  For
 ;; compatibility with older Nextstep applications, this checks cut
 ;; buffer 0 before retrieving the value of the primary selection.
@@ -1093,27 +942,6 @@
 
 ;;;; Color support.
 
-(declare-function ns-list-colors "nsfns.m" (&optional frame))
-
-(defvar x-colors (ns-list-colors)
-  "List of basic colors available on color displays.
-For X, the list comes from the `rgb.txt' file,v 10.41 94/02/20.
-For Nextstep, this is a list of non-PANTONE colors returned by
-the operating system.")
-
-(defun xw-defined-colors (&optional frame)
-  "Internal function called by `defined-colors', which see."
-  (or frame (setq frame (selected-frame)))
-  (let ((all-colors x-colors)
-	(this-color nil)
-	(defined-colors nil))
-    (while all-colors
-      (setq this-color (car all-colors)
-	    all-colors (cdr all-colors))
-      ;; (and (face-color-supported-p frame this-color t)
-      (setq defined-colors (cons this-color defined-colors))) ;;)
-    defined-colors))
-
 ;; Functions for color panel + drag
 (defun ns-face-at-pos (pos)
   (let* ((frame (car pos))
--- a/lisp/term/pc-win.el	Tue Oct 26 10:31:27 2010 +0900
+++ b/lisp/term/pc-win.el	Mon Oct 25 19:59:05 2010 -0700
@@ -204,8 +204,10 @@
 This is in addition to, but in preference to, the primary selection.
 
 Note that MS-Windows does not support selection types other than the
-clipboard.   \(The primary selection that is set by Emacs is not
-accessible to other programs on MS-Windows.\)"
+clipboard.  (The primary selection that is set by Emacs is not
+accessible to other programs on MS-Windows.)
+
+This variable is not used by the Nextstep port."
   :type 'boolean
   :group 'killing)