comparison lisp/term/rxvt.el @ 90233:ee12d75eb214

Revision: miles@gnu.org--gnu-2005/emacs--unicode--0--patch-85 Merge from emacs--cvs-trunk--0 Patches applied: * emacs--cvs-trunk--0 (patch 556-561) - Update from CVS - Merge from gnus--rel--5.10 * gnus--rel--5.10 (patch 122-124) - Update from CVS: lisp/mm-url.el (mm-url-decode-entities): Fix regexp. - Update from CVS
author Miles Bader <miles@gnu.org>
date Sun, 25 Sep 2005 22:07:01 +0000
parents edf295560b5a dc239a66e600
children c5406394f567
comparison
equal deleted inserted replaced
90232:eab32348047a 90233:ee12d75eb214
31 ;; The terminal intialization C code file might have initialized 31 ;; The terminal intialization C code file might have initialized
32 ;; function keys F11->F42 from the termcap/terminfo information. On 32 ;; function keys F11->F42 from the termcap/terminfo information. On
33 ;; a PC-style keyboard these keys correspond to 33 ;; a PC-style keyboard these keys correspond to
34 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The 34 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The
35 ;; code here subsitutes the corresponding defintions in 35 ;; code here subsitutes the corresponding defintions in
36 ;; function-key-map. This substitution is needed because if a key 36 ;; function-key-map. This substitution is needed because if a key
37 ;; definition if found in function-key-map, there are no further 37 ;; definition if found in function-key-map, there are no further
38 ;; lookups in other keymaps. 38 ;; lookups in other keymaps.
39 (substitute-key-definition [f11] [S-f1] function-key-map) 39 (substitute-key-definition [f11] [S-f1] function-key-map)
40 (substitute-key-definition [f12] [S-f2] function-key-map) 40 (substitute-key-definition [f12] [S-f2] function-key-map)
41 (substitute-key-definition [f13] [S-f3] function-key-map) 41 (substitute-key-definition [f13] [S-f3] function-key-map)
73 (let ((map (make-sparse-keymap))) 73 (let ((map (make-sparse-keymap)))
74 (define-key map "\e[A" [up]) 74 (define-key map "\e[A" [up])
75 (define-key map "\e[B" [down]) 75 (define-key map "\e[B" [down])
76 (define-key map "\e[C" [right]) 76 (define-key map "\e[C" [right])
77 (define-key map "\e[D" [left]) 77 (define-key map "\e[D" [left])
78 (define-key map "\e[7~" [home])
79 (define-key map "\e[2~" [insert]) 78 (define-key map "\e[2~" [insert])
80 (define-key map "\e[3~" [delete]) 79 (define-key map "\e[3~" [delete])
81 (define-key map "\e[4~" [select]) 80 (define-key map "\e[4~" [select])
82 (define-key map "\e[5~" [prior]) 81 (define-key map "\e[5~" [prior])
83 (define-key map "\e[6~" [next]) 82 (define-key map "\e[6~" [next])
83 (define-key map "\e[7~" [home])
84 (define-key map "\e[8~" [end])
84 (define-key map "\e[11~" [f1]) 85 (define-key map "\e[11~" [f1])
85 (define-key map "\e[12~" [f2]) 86 (define-key map "\e[12~" [f2])
86 (define-key map "\e[13~" [f3]) 87 (define-key map "\e[13~" [f3])
87 (define-key map "\e[14~" [f4]) 88 (define-key map "\e[14~" [f4])
88 (define-key map "\e[15~" [f5]) 89 (define-key map "\e[15~" [f5])
143 144
144 (define-key map "\e[2;2~" [S-insert]) 145 (define-key map "\e[2;2~" [S-insert])
145 (define-key map "\e[3$" [S-delete]) 146 (define-key map "\e[3$" [S-delete])
146 (define-key map "\e[5$" [S-prior]) 147 (define-key map "\e[5$" [S-prior])
147 (define-key map "\e[6$" [S-next]) 148 (define-key map "\e[6$" [S-next])
149 (define-key map "\e[7$" [S-home])
148 (define-key map "\e[8$" [S-end]) 150 (define-key map "\e[8$" [S-end])
149 (define-key map "\e[7$" [S-home])
150 (define-key map "\e[d" [S-left]) 151 (define-key map "\e[d" [S-left])
151 (define-key map "\e[c" [S-right]) 152 (define-key map "\e[c" [S-right])
152 (define-key map "\e[a" [S-up]) 153 (define-key map "\e[a" [S-up])
153 (define-key map "\e[b" [S-down]) 154 (define-key map "\e[b" [S-down])
154 155
173 ("green" 2 ( 0 205 0)) ; green3 174 ("green" 2 ( 0 205 0)) ; green3
174 ("yellow" 3 (205 205 0)) ; yellow3 175 ("yellow" 3 (205 205 0)) ; yellow3
175 ("blue" 4 ( 0 0 205)) ; blue3 176 ("blue" 4 ( 0 0 205)) ; blue3
176 ("magenta" 5 (205 0 205)) ; magenta3 177 ("magenta" 5 (205 0 205)) ; magenta3
177 ("cyan" 6 ( 0 205 205)) ; cyan3 178 ("cyan" 6 ( 0 205 205)) ; cyan3
178 ("white" 7 (250 235 215)) ; AntiqueWhite 179 ("white" 7 (229 229 229)) ; gray90
179 ("brightblack" 8 ( 64 64 64)) ; gray25 180 ("brightblack" 8 ( 77 77 77)) ; gray30
180 ("brightred" 9 (255 0 0)) ; red 181 ("brightred" 9 (255 0 0)) ; red
181 ("brightgreen" 10 ( 0 255 0)) ; green 182 ("brightgreen" 10 ( 0 255 0)) ; green
182 ("brightyellow" 11 (255 255 0)) ; yellow 183 ("brightyellow" 11 (255 255 0)) ; yellow
183 ("brightblue" 12 ( 0 0 255)) ; blue 184 ("brightblue" 12 ( 0 0 255)) ; blue
184 ("brightmagenta" 13 (255 0 255)) ; magenta 185 ("brightmagenta" 13 (255 0 255)) ; magenta
207 (mapcar 'rxvt-rgb-convert-to-16bit 208 (mapcar 'rxvt-rgb-convert-to-16bit
208 (car (cddr color)))) 209 (car (cddr color))))
209 (setq colors (cdr colors) 210 (setq colors (cdr colors)
210 color (car colors) 211 color (car colors)
211 ncolors (1- ncolors))) 212 ncolors (1- ncolors)))
213 (when (> ncolors 0)
214 (cond
215 ((= ncolors 240) ; 256-color rxvt
216 ;; 216 non-gray colors first
217 (let ((r 0) (g 0) (b 0))
218 (while (> ncolors 24)
219 ;; This and other formulae taken from 256colres.pl and
220 ;; 88colres.pl in the xterm distribution.
221 (tty-color-define (format "color-%d" (- 256 ncolors))
222 (- 256 ncolors)
223 (mapcar 'rxvt-rgb-convert-to-16bit
224 (list (round (* r 42.5))
225 (round (* g 42.5))
226 (round (* b 42.5)))))
227 (setq b (1+ b))
228 (if (> b 5)
229 (setq g (1+ g)
230 b 0))
231 (if (> g 5)
232 (setq r (1+ r)
233 g 0))
234 (setq ncolors (1- ncolors))))
235 ;; Now the 24 gray colors
236 (while (> ncolors 0)
237 (setq color (rxvt-rgb-convert-to-16bit (+ 8 (* (- 24 ncolors) 10))))
238 (tty-color-define (format "color-%d" (- 256 ncolors))
239 (- 256 ncolors)
240 (list color color color))
241 (setq ncolors (1- ncolors))))
242
243 ((= ncolors 72) ; rxvt-unicode
244 ;; 64 non-gray colors
245 (let ((levels '(0 139 205 255))
246 (r 0) (g 0) (b 0))
247 (while (> ncolors 8)
248 (tty-color-define (format "color-%d" (- 88 ncolors))
249 (- 88 ncolors)
250 (mapcar 'rxvt-rgb-convert-to-16bit
251 (list (nth r levels)
252 (nth g levels)
253 (nth b levels))))
254 (setq b (1+ b))
255 (if (> b 3)
256 (setq g (1+ g)
257 b 0))
258 (if (> g 3)
259 (setq r (1+ r)
260 g 0))
261 (setq ncolors (1- ncolors))))
262 ;; Now the 8 gray colors
263 (while (> ncolors 0)
264 (setq color (rxvt-rgb-convert-to-16bit
265 (floor
266 (if (= ncolors 8)
267 46.36363636
268 (+ (* (- 8 ncolors) 23.18181818) 69.54545454)))))
269 (tty-color-define (format "color-%d" (- 88 ncolors))
270 (- 88 ncolors)
271 (list color color color))
272 (setq ncolors (1- ncolors))))
273 (t (error "Unsupported number of rxvt colors (%d)" (+ 16 ncolors)))))
212 ;; Modifying color mappings means realized faces don't use the 274 ;; Modifying color mappings means realized faces don't use the
213 ;; right colors, so clear them. 275 ;; right colors, so clear them.
214 (clear-face-cache))) 276 (clear-face-cache)))
215 277
216 ;; rxvt puts the default colors into an environment variable 278 ;; rxvt puts the default colors into an environment variable
234 ;; color in rxvt-standard-colors. 296 ;; color in rxvt-standard-colors.
235 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) 297 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
236 (setq default-frame-background-mode 'dark))) 298 (setq default-frame-background-mode 'dark)))
237 (frame-set-background-mode (selected-frame)))) 299 (frame-set-background-mode (selected-frame))))
238 300
239 ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 301 ;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257
240 ;;; rxvt.el ends here 302 ;;; rxvt.el ends here