comparison lisp/term/xterm.el @ 90143:146c086df160

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-37 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 241-257) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 59-65) - Update from CVS - Merge from emacs--cvs-trunk--0 - (mm-string-to-multibyte): Use Gnus trunk definition.
author Miles Bader <miles@gnu.org>
date Thu, 14 Apr 2005 05:03:52 +0000
parents 02f1dbc4a199 3e0057a2ce89
children 08185296b491
comparison
equal deleted inserted replaced
90142:627771f44771 90143:146c086df160
49 (define-key map "\e[21~" [f10]) 49 (define-key map "\e[21~" [f10])
50 (define-key map "\e[23~" [f11]) 50 (define-key map "\e[23~" [f11])
51 (define-key map "\e[24~" [f12]) 51 (define-key map "\e[24~" [f12])
52 (define-key map "\e[29~" [print]) 52 (define-key map "\e[29~" [print])
53 53
54 (define-key map "\e[11;2~" [S-f1])
55 (define-key map "\e[12;2~" [S-f2])
56 (define-key map "\e[13;2~" [S-f3])
57 (define-key map "\e[14;2~" [S-f4])
58 (define-key map "\e[15;2~" [S-f5])
59 (define-key map "\e[17;2~" [S-f6])
60 (define-key map "\e[18;2~" [S-f7])
61 (define-key map "\e[19;2~" [S-f8])
62 (define-key map "\e[20;2~" [S-f9])
63 (define-key map "\e[21;2~" [S-f10])
64 (define-key map "\e[23;2~" [S-f11])
65 (define-key map "\e[24;2~" [S-f12])
66
67 (define-key map "\e[11;5~" [C-f1])
68 (define-key map "\e[12;5~" [C-f2])
69 (define-key map "\e[13;5~" [C-f3])
70 (define-key map "\e[14;5~" [C-f4])
71 (define-key map "\e[15;5~" [C-f5])
72 (define-key map "\e[17;5~" [C-f6])
73 (define-key map "\e[18;5~" [C-f7])
74 (define-key map "\e[19;5~" [C-f8])
75 (define-key map "\e[20;5~" [C-f9])
76 (define-key map "\e[21;5~" [C-f10])
77 (define-key map "\e[23;5~" [C-f11])
78 (define-key map "\e[24;5~" [C-f12])
79
80 (define-key map "\e[11;6~" [C-S-f1])
81 (define-key map "\e[12;6~" [C-S-f2])
82 (define-key map "\e[13;6~" [C-S-f3])
83 (define-key map "\e[14;6~" [C-S-f4])
84 (define-key map "\e[15;6~" [C-S-f5])
85 (define-key map "\e[17;6~" [C-S-f6])
86 (define-key map "\e[18;6~" [C-S-f7])
87 (define-key map "\e[19;6~" [C-S-f8])
88 (define-key map "\e[20;6~" [C-S-f9])
89 (define-key map "\e[21;6~" [C-S-f10])
90 (define-key map "\e[23;6~" [C-S-f11])
91 (define-key map "\e[24;6~" [C-S-f12])
92
93 (define-key map "\e[11;3~" [A-f1])
94 (define-key map "\e[12;3~" [A-f2])
95 (define-key map "\e[13;3~" [A-f3])
96 (define-key map "\e[14;3~" [A-f4])
97 (define-key map "\e[15;3~" [A-f5])
98 (define-key map "\e[17;3~" [A-f6])
99 (define-key map "\e[18;3~" [A-f7])
100 (define-key map "\e[19;3~" [A-f8])
101 (define-key map "\e[20;3~" [A-f9])
102 (define-key map "\e[21;3~" [A-f10])
103 (define-key map "\e[23;3~" [A-f11])
104 (define-key map "\e[24;3~" [A-f12])
105
54 (define-key map "\e[1;2A" [S-up]) 106 (define-key map "\e[1;2A" [S-up])
55 (define-key map "\e[1;2B" [S-down]) 107 (define-key map "\e[1;2B" [S-down])
56 (define-key map "\e[1;2C" [S-right]) 108 (define-key map "\e[1;2C" [S-right])
57 (define-key map "\e[1;2D" [S-left]) 109 (define-key map "\e[1;2D" [S-left])
110 (define-key map "\e[1;2F" [S-end])
111 (define-key map "\e[1;2H" [S-home])
58 112
59 (define-key map "\e[1;5A" [C-up]) 113 (define-key map "\e[1;5A" [C-up])
60 (define-key map "\e[1;5B" [C-down]) 114 (define-key map "\e[1;5B" [C-down])
61 (define-key map "\e[1;5C" [C-right]) 115 (define-key map "\e[1;5C" [C-right])
62 (define-key map "\e[1;5D" [C-left]) 116 (define-key map "\e[1;5D" [C-left])
117 (define-key map "\e[1;5F" [C-end])
118 (define-key map "\e[1;5H" [C-home])
119
120 (define-key map "\e[1;6A" [C-S-up])
121 (define-key map "\e[1;6B" [C-S-down])
122 (define-key map "\e[1;6C" [C-S-right])
123 (define-key map "\e[1;6D" [C-S-left])
124 (define-key map "\e[1;6F" [C-S-end])
125 (define-key map "\e[1;6H" [C-S-home])
126
127 (define-key map "\e[1;3A" [A-up])
128 (define-key map "\e[1;3B" [A-down])
129 (define-key map "\e[1;3C" [A-right])
130 (define-key map "\e[1;3D" [A-left])
131 (define-key map "\e[1;3F" [A-end])
132 (define-key map "\e[1;3H" [A-home])
63 133
64 (define-key map "\e[2;2~" [S-insert]) 134 (define-key map "\e[2;2~" [S-insert])
65 (define-key map "\e[3;2~" [S-delete]) 135 (define-key map "\e[3;2~" [S-delete])
66 (define-key map "\e[5;2~" [S-prior]) 136 (define-key map "\e[5;2~" [S-prior])
67 (define-key map "\e[6;2~" [S-next]) 137 (define-key map "\e[6;2~" [S-next])
68 138
69 (define-key map "\e[2;5~" [C-insert]) 139 (define-key map "\e[2;5~" [C-insert])
70 (define-key map "\e[3;5~" [C-delete]) 140 (define-key map "\e[3;5~" [C-delete])
71 (define-key map "\e[5;5~" [C-prior]) 141 (define-key map "\e[5;5~" [C-prior])
72 (define-key map "\e[6;5~" [C-next]) 142 (define-key map "\e[6;5~" [C-next])
143
144 (define-key map "\e[2;6~" [C-S-insert])
145 (define-key map "\e[3;6~" [C-S-delete])
146 (define-key map "\e[5;6~" [C-S-prior])
147 (define-key map "\e[6;6~" [C-S-next])
148
149 (define-key map "\e[2;3~" [A-insert])
150 (define-key map "\e[3;3~" [A-delete])
151 (define-key map "\e[5;3~" [A-prior])
152 (define-key map "\e[6;3~" [A-next])
73 153
74 (define-key map "\eOA" [up]) 154 (define-key map "\eOA" [up])
75 (define-key map "\eOB" [down]) 155 (define-key map "\eOB" [down])
76 (define-key map "\eOC" [right]) 156 (define-key map "\eOC" [right])
77 (define-key map "\eOD" [left]) 157 (define-key map "\eOD" [left])
121 ("brightwhite" 15 (255 255 255))) ; white 201 ("brightwhite" 15 (255 255 255))) ; white
122 "Names of 16 standard xterm/aixterm colors, their numbers, and RGB values.") 202 "Names of 16 standard xterm/aixterm colors, their numbers, and RGB values.")
123 203
124 (defun xterm-rgb-convert-to-16bit (prim) 204 (defun xterm-rgb-convert-to-16bit (prim)
125 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value." 205 "Convert an 8-bit primary color value PRIM to a corresponding 16-bit value."
126 (min 65535 (round (* (/ prim 255.0) 65535.0)))) 206 (logior prim (lsh prim 8)))
127 207
128 (defun xterm-register-default-colors () 208 (defun xterm-register-default-colors ()
129 "Register the default set of colors for xterm or compatible emulator. 209 "Register the default set of colors for xterm or compatible emulator.
130 210
131 This function registers the number of colors returned by `display-color-cells' 211 This function registers the number of colors returned by `display-color-cells'
158 ;; This and other formulae taken from 256colres.pl and 238 ;; This and other formulae taken from 256colres.pl and
159 ;; 88colres.pl in the xterm distribution. 239 ;; 88colres.pl in the xterm distribution.
160 (tty-color-define (format "color-%d" (- 256 ncolors)) 240 (tty-color-define (format "color-%d" (- 256 ncolors))
161 (- 256 ncolors) 241 (- 256 ncolors)
162 (mapcar 'xterm-rgb-convert-to-16bit 242 (mapcar 'xterm-rgb-convert-to-16bit
163 (list (round (* r 42.5)) 243 (list (if (zerop r) 0 (+ (* r 40) 55))
164 (round (* g 42.5)) 244 (if (zerop g) 0 (+ (* g 40) 55))
165 (round (* b 42.5))))) 245 (if (zerop b) 0 (+ (* b 40) 55)))))
246
166 (setq b (1+ b)) 247 (setq b (1+ b))
167 (if (> b 5) 248 (if (> b 5)
168 (setq g (1+ g) 249 (setq g (1+ g)
169 b 0)) 250 b 0))
170 (if (> g 5) 251 (if (> g 5)
198 g 0)) 279 g 0))
199 (setq ncolors (1- ncolors)))) 280 (setq ncolors (1- ncolors))))
200 ;; Now the 8 gray colors 281 ;; Now the 8 gray colors
201 (while (> ncolors 0) 282 (while (> ncolors 0)
202 (setq color (xterm-rgb-convert-to-16bit 283 (setq color (xterm-rgb-convert-to-16bit
203 (round 284 (floor
204 (if (= ncolors 8) 285 (if (= ncolors 8)
205 46.36363636 286 46.36363636
206 (+ (* (- 8 ncolors) 23.18181818) 69.54545454))))) 287 (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
207 (tty-color-define (format "color-%d" (- 88 ncolors)) 288 (tty-color-define (format "color-%d" (- 88 ncolors))
208 (- 88 ncolors) 289 (- 88 ncolors)