comparison lisp/term/rxvt.el @ 83353:532e0a9335a9

Merged in changes from CVS trunk. Plus added lisp/term tweaks. Patches applied: * lorentey@elte.hu--2004/emacs--cvs-trunk--0--base-0 tag of miles@gnu.org--gnu-2005/emacs--cvs-trunk--0--patch-474 * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-1 Add CVS metadata files. * lorentey@elte.hu--2004/emacs--cvs-trunk--0--patch-2 Update from CVS. git-archimport-id: lorentey@elte.hu--2004/emacs--multi-tty--0--patch-393
author Karoly Lorentey <lorentey@elte.hu>
date Sun, 04 Sep 2005 03:48:17 +0000
parents 7372c2f9daac 34bd8e434dd7
children 3d2bc61f2da0
comparison
equal deleted inserted replaced
83352:b258b3492423 83353:532e0a9335a9
1 ;;; rxvt.el --- define function key sequences and standard colors for rxvt 1 ;;; rxvt.el --- define function key sequences and standard colors for rxvt
2 2
3 ;; Copyright (C) 2002 Free Software Foundation, Inc. 3 ;; Copyright (C) 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
4 4
5 ;; Author: Eli Zaretskii 5 ;; Author: Eli Zaretskii
6 ;; Keywords: terminals 6 ;; Keywords: terminals
7 7
8 ;; This file is part of GNU Emacs. 8 ;; This file is part of GNU Emacs.
54 (define-key rxvt-function-map "\e[17~" [f6]) 54 (define-key rxvt-function-map "\e[17~" [f6])
55 (define-key rxvt-function-map "\e[18~" [f7]) 55 (define-key rxvt-function-map "\e[18~" [f7])
56 (define-key rxvt-function-map "\e[19~" [f8]) 56 (define-key rxvt-function-map "\e[19~" [f8])
57 (define-key rxvt-function-map "\e[20~" [f9]) 57 (define-key rxvt-function-map "\e[20~" [f9])
58 (define-key rxvt-function-map "\e[21~" [f10]) 58 (define-key rxvt-function-map "\e[21~" [f10])
59 (define-key rxvt-function-map "\e[23~" [f11]) 59 ;; The strings emitted by f11 and f12 are the same as the strings
60 (define-key rxvt-function-map "\e[24~" [f12]) 60 ;; emitted by S-f1 and S-f2, so don't define f11 and f12.
61 ;; (define-key rxvt-function-map "\e[23~" [f11])
62 ;; (define-key rxvt-function-map "\e[24~" [f12])
61 (define-key rxvt-function-map "\e[29~" [print]) 63 (define-key rxvt-function-map "\e[29~" [print])
62 64
63 (define-key rxvt-function-map "\e[11^" [C-f1]) 65 (define-key rxvt-function-map "\e[11^" [C-f1])
64 (define-key rxvt-function-map "\e[12^" [C-f2]) 66 (define-key rxvt-function-map "\e[12^" [C-f2])
65 (define-key rxvt-function-map "\e[13^" [C-f3]) 67 (define-key rxvt-function-map "\e[13^" [C-f3])
68 (define-key rxvt-function-map "\e[17^" [C-f6]) 70 (define-key rxvt-function-map "\e[17^" [C-f6])
69 (define-key rxvt-function-map "\e[18^" [C-f7]) 71 (define-key rxvt-function-map "\e[18^" [C-f7])
70 (define-key rxvt-function-map "\e[19^" [C-f8]) 72 (define-key rxvt-function-map "\e[19^" [C-f8])
71 (define-key rxvt-function-map "\e[20^" [C-f9]) 73 (define-key rxvt-function-map "\e[20^" [C-f9])
72 (define-key rxvt-function-map "\e[21^" [C-f10]) 74 (define-key rxvt-function-map "\e[21^" [C-f10])
73 (define-key rxvt-function-map "\e[23^" [C-f11]) 75
74 (define-key rxvt-function-map "\e[24^" [C-f12]) 76 (define-key rxvt-function-map "\e[23~" [S-f1])
75 77 (define-key rxvt-function-map "\e[24~" [S-f2])
76 (define-key rxvt-function-map "\e[29~" [print]) 78 (define-key rxvt-function-map "\e[25~" [S-f3])
77 79 (define-key rxvt-function-map "\e[26~" [S-f4])
78 (define-key rxvt-function-map "\e[2;2~" [S-insert]) 80 (define-key rxvt-function-map "\e[28~" [S-f5])
79 (define-key rxvt-function-map "\e[3$" [S-delete]) 81 (define-key rxvt-function-map "\e[29~" [S-f6])
82 (define-key rxvt-function-map "\e[31~" [S-f7])
83 (define-key rxvt-function-map "\e[32~" [S-f8])
84 (define-key rxvt-function-map "\e[33~" [S-f9])
85 (define-key rxvt-function-map "\e[34~" [S-f10])
86
87 (define-key rxvt-function-map "\e[23^" [C-S-f1])
88 (define-key rxvt-function-map "\e[24^" [C-S-f2])
89 (define-key rxvt-function-map "\e[25^" [C-S-f3])
90 (define-key rxvt-function-map "\e[26^" [C-S-f4])
91 (define-key rxvt-function-map "\e[28^" [C-S-f5])
92 (define-key rxvt-function-map "\e[29^" [C-S-f6])
93 (define-key rxvt-function-map "\e[31^" [C-S-f7])
94 (define-key rxvt-function-map "\e[32^" [C-S-f8])
95 (define-key rxvt-function-map "\e[33^" [C-S-f9])
96 (define-key rxvt-function-map "\e[34^" [C-S-f10])
80 97
81 (define-key rxvt-function-map "\e[2^" [C-insert]) 98 (define-key rxvt-function-map "\e[2^" [C-insert])
82 (define-key rxvt-function-map "\e[3^" [C-delete]) 99 (define-key rxvt-function-map "\e[3^" [C-delete])
83 (define-key rxvt-function-map "\e[5^" [C-prior]) 100 (define-key rxvt-function-map "\e[5^" [C-prior])
84 (define-key rxvt-function-map "\e[6^" [C-next]) 101 (define-key rxvt-function-map "\e[6^" [C-next])
102 (define-key rxvt-function-map "\e[7^" [C-home])
103 (define-key rxvt-function-map "\e[8^" [C-end])
85 (define-key rxvt-function-map "\eOd" [C-left]) 104 (define-key rxvt-function-map "\eOd" [C-left])
86 (define-key rxvt-function-map "\eOc" [C-right]) 105 (define-key rxvt-function-map "\eOc" [C-right])
87 (define-key rxvt-function-map "\eOa" [C-up]) 106 (define-key rxvt-function-map "\eOa" [C-up])
88 (define-key rxvt-function-map "\eOb" [C-down]) 107 (define-key rxvt-function-map "\eOb" [C-down])
89 108
109 (define-key rxvt-function-map "\e[2;2~" [S-insert])
110 (define-key rxvt-function-map "\e[3$" [S-delete])
90 (define-key rxvt-function-map "\e[5$" [S-prior]) 111 (define-key rxvt-function-map "\e[5$" [S-prior])
91 (define-key rxvt-function-map "\e[6$" [S-next]) 112 (define-key rxvt-function-map "\e[6$" [S-next])
92 (define-key rxvt-function-map "\e[8$" [S-end]) 113 (define-key rxvt-function-map "\e[8$" [S-end])
93 (define-key rxvt-function-map "\e[7$" [S-home]) 114 (define-key rxvt-function-map "\e[7$" [S-home])
94 (define-key rxvt-function-map "\e[d" [S-left]) 115 (define-key rxvt-function-map "\e[d" [S-left])
95 (define-key rxvt-function-map "\e[c" [S-right]) 116 (define-key rxvt-function-map "\e[c" [S-right])
96 (define-key rxvt-function-map "\e[a" [S-up]) 117 (define-key rxvt-function-map "\e[a" [S-up])
97 (define-key rxvt-function-map "\e[b" [S-down])) 118 (define-key rxvt-function-map "\e[b" [S-down]))
98 119
99 ;; Use inheritance to let the main keymap override those defaults. 120 (defun terminal-init-rxvt ()
100 ;; This way we don't override terminfo-derived settings or settings 121 "Terminal initialization function for rxvt."
101 ;; made in the .emacs file. 122 ;; The terminal intialization C code file might have initialized
102 (let ((m (copy-keymap rxvt-function-map))) 123 ;; function keys F11->F42 from the termcap/terminfo information. On
103 (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil))) 124 ;; a PC-style keyboard these keys correspond to
104 (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m)) 125 ;; MODIFIER-FUNCTION_KEY, where modifier is S-, C-, C-S-. The
105 126 ;; code here subsitutes the corresponding defintions in
127 ;; function-key-map. This substitution is needed because if a key
128 ;; definition if found in function-key-map, there are no further
129 ;; lookups in other keymaps.
130 (substitute-key-definition [f11] [S-f1] function-key-map)
131 (substitute-key-definition [f12] [S-f2] function-key-map)
132 (substitute-key-definition [f13] [S-f3] function-key-map)
133 (substitute-key-definition [f14] [S-f4] function-key-map)
134 (substitute-key-definition [f15] [S-f5] function-key-map)
135 (substitute-key-definition [f16] [S-f6] function-key-map)
136 (substitute-key-definition [f17] [S-f7] function-key-map)
137 (substitute-key-definition [f18] [S-f8] function-key-map)
138 (substitute-key-definition [f19] [S-f9] function-key-map)
139 (substitute-key-definition [f20] [S-f10] function-key-map)
140
141 (substitute-key-definition [f23] [C-f1] function-key-map)
142 (substitute-key-definition [f24] [C-f2] function-key-map)
143 (substitute-key-definition [f25] [C-f3] function-key-map)
144 (substitute-key-definition [f26] [C-f4] function-key-map)
145 (substitute-key-definition [f27] [C-f5] function-key-map)
146 (substitute-key-definition [f28] [C-f6] function-key-map)
147 (substitute-key-definition [f29] [C-f7] function-key-map)
148 (substitute-key-definition [f30] [C-f8] function-key-map)
149 (substitute-key-definition [f31] [C-f9] function-key-map)
150 (substitute-key-definition [f32] [C-f10] function-key-map)
151
152 (substitute-key-definition [f33] [C-S-f1] function-key-map)
153 (substitute-key-definition [f34] [C-S-f2] function-key-map)
154 (substitute-key-definition [f35] [C-S-f3] function-key-map)
155 (substitute-key-definition [f36] [C-S-f4] function-key-map)
156 (substitute-key-definition [f37] [C-S-f5] function-key-map)
157 (substitute-key-definition [f38] [C-S-f6] function-key-map)
158 (substitute-key-definition [f39] [C-S-f7] function-key-map)
159 (substitute-key-definition [f40] [C-S-f8] function-key-map)
160 (substitute-key-definition [f41] [C-S-f9] function-key-map)
161 (substitute-key-definition [f42] [C-S-f10] function-key-map)
162
163 ;; Use inheritance to let the main keymap override those defaults.
164 ;; This way we don't override terminfo-derived settings or settings
165 ;; made in the .emacs file.
166 (let ((m (copy-keymap rxvt-function-map)))
167 (set-keymap-parent m (keymap-parent (terminal-local-value 'local-function-key-map nil)))
168 (set-keymap-parent (terminal-local-value 'local-function-key-map nil) m))
169
170 ;; Initialize colors and background mode.
171 (rxvt-register-default-colors)
172 (rxvt-set-background-mode)
173 ;; This recomputes all the default faces given the colors we've just set up.
174 (tty-set-up-initial-frame-faces))
106 175
107 ;; Set up colors, for those versions of rxvt that support it. 176 ;; Set up colors, for those versions of rxvt that support it.
108 (defvar rxvt-standard-colors 177 (defvar rxvt-standard-colors
109 ;; The names of the colors in the comments taken from the rxvt.1 man 178 ;; The names of the colors in the comments taken from the rxvt.1 man
110 ;; page; the corresponding RGB values--from rgb.txt. 179 ;; page; the corresponding RGB values--from rgb.txt.
174 ;; color in rxvt-standard-colors. 243 ;; color in rxvt-standard-colors.
175 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) 244 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
176 (setq default-frame-background-mode 'dark))) 245 (setq default-frame-background-mode 'dark)))
177 (frame-set-background-mode (selected-frame)))) 246 (frame-set-background-mode (selected-frame))))
178 247
179 ;; Do it!
180 (rxvt-register-default-colors)
181 (rxvt-set-background-mode)
182 ;; This recomputes all the default faces given the colors we've just set up.
183 (tty-set-up-initial-frame-faces)
184
185 ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257 248 ;;; arch-tag: 20cf2fb6-6318-4bab-9dbf-1d15048f2257
186 ;;; rxvt.el ends here 249 ;;; rxvt.el ends here