Commit | Line | Data |
---|---|---|
0a10297a | 1 | ;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- no-byte-compile: t -*- |
91212006 | 2 | |
f2e3589a | 3 | ;; Copyright (C) 1997, 2001, 2002, 2003, 2004, 2005, |
d7a0267c | 4 | ;; 2006, 2007 Free Software Foundation, Inc. |
91212006 DN |
5 | |
6 | ;; Author: Dan Nicolaescu <dann@ics.uci.edu> | |
7 | ||
8 | ;; This file is part of GNU Emacs. | |
9 | ||
10 | ;; GNU Emacs is free software; you can redistribute it and/or modify | |
11 | ;; it under the terms of the GNU General Public License as published by | |
5a9dffec | 12 | ;; the Free Software Foundation; either version 3, or (at your option) |
91212006 DN |
13 | ;; any later version. |
14 | ||
15 | ;; GNU Emacs is distributed in the hope that it will be useful, | |
16 | ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
17 | ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
18 | ;; GNU General Public License for more details. | |
19 | ||
20 | ;; You should have received a copy of the GNU General Public License | |
21 | ;; along with GNU Emacs; see the file COPYING. If not, write to the | |
4fc5845f LK |
22 | ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
23 | ;; Boston, MA 02110-1301, USA. | |
91212006 | 24 | |
e8af40ee PJ |
25 | ;;; Commentary: |
26 | ||
27 | ;;; Code: | |
28 | ||
8cbd7bed | 29 | (defvar iris-function-map (make-sparse-keymap) |
2bb819d5 | 30 | "Function key definitions for SGI xwsh and winterm apps.") |
941d4811 | 31 | |
8cbd7bed KL |
32 | (define-key iris-function-map "\e[120q" [S-escape]) |
33 | (define-key iris-function-map "\e[121q" [C-escape]) | |
91212006 | 34 | |
8cbd7bed KL |
35 | (define-key iris-function-map "\e[001q" [f1]) |
36 | (define-key iris-function-map "\e[013q" [S-f1]) | |
37 | (define-key iris-function-map "\e[025q" [C-f1]) | |
91212006 DN |
38 | |
39 | ||
8cbd7bed KL |
40 | (define-key iris-function-map "\e[002q" [f2]) |
41 | (define-key iris-function-map "\e[014q" [S-f2]) | |
42 | (define-key iris-function-map "\e[026q" [C-f2]) | |
43 | (define-key iris-function-map "\e[038q" [M-f2]) | |
91212006 | 44 | |
8cbd7bed KL |
45 | (define-key iris-function-map "\e[003q" [f3]) |
46 | (define-key iris-function-map "\e[015q" [S-f3]) | |
47 | (define-key iris-function-map "\e[027q" [C-f3]) | |
91212006 DN |
48 | |
49 | ||
8cbd7bed KL |
50 | (define-key iris-function-map "\e[004q" [f4]) |
51 | (define-key iris-function-map "\e[016q" [S-f4]) | |
52 | (define-key iris-function-map "\e[028q" [C-f4]) | |
91212006 DN |
53 | |
54 | ||
8cbd7bed KL |
55 | (define-key iris-function-map "\e[005q" [f5]) |
56 | (define-key iris-function-map "\e[017q" [S-f5]) | |
57 | (define-key iris-function-map "\e[029q" [C-f5]) | |
91212006 DN |
58 | |
59 | ||
8cbd7bed KL |
60 | (define-key iris-function-map "\e[006q" [f6]) |
61 | (define-key iris-function-map "\e[018q" [S-f6]) | |
62 | (define-key iris-function-map "\e[030q" [C-f6]) | |
91212006 DN |
63 | |
64 | ||
8cbd7bed KL |
65 | (define-key iris-function-map "\e[007q" [f7]) |
66 | (define-key iris-function-map "\e[019q" [S-f7]) | |
67 | (define-key iris-function-map "\e[031q" [C-f7]) | |
91212006 DN |
68 | |
69 | ||
8cbd7bed KL |
70 | (define-key iris-function-map "\e[008q" [f8]) |
71 | (define-key iris-function-map "\e[020q" [S-f8]) | |
72 | (define-key iris-function-map "\e[032q" [C-f8]) | |
91212006 DN |
73 | |
74 | ||
8cbd7bed KL |
75 | (define-key iris-function-map "\e[009q" [f9]) |
76 | (define-key iris-function-map "\e[021q" [S-f9]) | |
77 | (define-key iris-function-map "\e[033q" [C-f9]) | |
91212006 DN |
78 | |
79 | ||
8cbd7bed KL |
80 | (define-key iris-function-map "\e[010q" [f10]) |
81 | (define-key iris-function-map "\e[022q" [S-f10]) | |
82 | (define-key iris-function-map "\e[034q" [C-f10]) | |
91212006 DN |
83 | |
84 | ||
8cbd7bed KL |
85 | (define-key iris-function-map "\e[011q" [f11]) |
86 | (define-key iris-function-map "\e[023q" [S-f11]) | |
87 | (define-key iris-function-map "\e[035q" [C-f11]) | |
88 | (define-key iris-function-map "\e[047q" [M-f11]) | |
91212006 | 89 | |
8cbd7bed KL |
90 | (define-key iris-function-map "\e[012q" [f12]) |
91 | (define-key iris-function-map "\e[024q" [S-f12]) | |
92 | (define-key iris-function-map "\e[036q" [C-f12]) | |
93 | (define-key iris-function-map "\e[048q" [M-f12]) | |
91212006 DN |
94 | |
95 | ||
dbe9f5ba KL |
96 | (define-key iris-function-map "\e[057q" [?\C-`]) |
97 | (define-key iris-function-map "\e[115q" [?\M-`]) | |
91212006 | 98 | |
8cbd7bed KL |
99 | (define-key iris-function-map "\e[049q" [?\C-1]) |
100 | (define-key iris-function-map "\e[058q" [?\M-1]) | |
91212006 DN |
101 | |
102 | ||
8cbd7bed | 103 | (define-key iris-function-map "\e[059q" [?\M-2]) |
91212006 | 104 | |
8cbd7bed KL |
105 | (define-key iris-function-map "\e[050q" [?\C-3]) |
106 | (define-key iris-function-map "\e[060q" [?\M-3]) | |
91212006 | 107 | |
8cbd7bed KL |
108 | (define-key iris-function-map "\e[051q" [?\C-4]) |
109 | (define-key iris-function-map "\e[061q" [?\M-4]) | |
91212006 | 110 | |
8cbd7bed KL |
111 | (define-key iris-function-map "\e[052q" [?\C-5]) |
112 | (define-key iris-function-map "\e[062q" [?\M-5]) | |
91212006 DN |
113 | |
114 | ||
8cbd7bed | 115 | (define-key iris-function-map "\e[063q" [?\M-6]) |
91212006 | 116 | |
8cbd7bed KL |
117 | (define-key iris-function-map "\e[053q" [?\C-7]) |
118 | (define-key iris-function-map "\e[064q" [?\M-7]) | |
91212006 | 119 | |
8cbd7bed KL |
120 | (define-key iris-function-map "\e[054q" [?\C-8]) |
121 | (define-key iris-function-map "\e[065q" [?\M-8]) | |
91212006 | 122 | |
8cbd7bed KL |
123 | (define-key iris-function-map "\e[055q" [?\C-9]) |
124 | (define-key iris-function-map "\e[066q" [?\M-9]) | |
91212006 | 125 | |
8cbd7bed KL |
126 | (define-key iris-function-map "\e[056q" [?\C-0]) |
127 | (define-key iris-function-map "\e[067q" [?\M-0]) | |
91212006 | 128 | |
8cbd7bed | 129 | (define-key iris-function-map "\e[068q" [?\M--]) |
91212006 | 130 | |
8cbd7bed KL |
131 | (define-key iris-function-map "\e[069q" [?\C-=]) |
132 | (define-key iris-function-map "\e[070q" [?\M-=]) | |
91212006 | 133 | |
8cbd7bed KL |
134 | ;; I don't know what to do with those. |
135 | ;;(define-key iris-function-map "^H" [<del>]) | |
136 | ;;(define-key iris-function-map "^H" [S-<del>]) | |
137 | ;;(define-key iris-function-map "\177" [C-<del>]) | |
138 | ;;(define-key iris-function-map "\e[071q" [M-<del>]) | |
91212006 | 139 | |
8cbd7bed KL |
140 | (define-key iris-function-map "\e[Z" [?\S-\t]) |
141 | (define-key iris-function-map "\e[072q" [?\C-\t]) | |
142 | ;; This only works if you remove the M-TAB keybing from the system.4Dwmrc | |
143 | ;; our your ~/.4Dwmrc, if you use the 4Dwm window manager. | |
144 | (define-key iris-function-map "\e[073q" [?\M-\t]) | |
91212006 | 145 | |
8cbd7bed | 146 | (define-key iris-function-map "\e[074q" [?\M-q]) |
91212006 | 147 | |
8cbd7bed | 148 | (define-key iris-function-map "\e[075q" [?\M-w]) |
91212006 | 149 | |
8cbd7bed | 150 | (define-key iris-function-map "\e[076q" [?\M-e]) |
91212006 | 151 | |
8cbd7bed | 152 | (define-key iris-function-map "\e[077q" [?\M-r]) |
91212006 | 153 | |
8cbd7bed | 154 | (define-key iris-function-map "\e[078q" [?\M-t]) |
91212006 | 155 | |
8cbd7bed | 156 | (define-key iris-function-map "\e[079q" [?\M-y]) |
91212006 | 157 | |
8cbd7bed | 158 | (define-key iris-function-map "\e[080q" [?\M-u]) |
91212006 | 159 | |
8cbd7bed | 160 | (define-key iris-function-map "\e[081q" [?\M-i]) |
91212006 | 161 | |
8cbd7bed | 162 | (define-key iris-function-map "\e[082q" [?\M-o]) |
91212006 | 163 | |
8cbd7bed | 164 | (define-key iris-function-map "\e[083q" [?\M-p]) |
91212006 | 165 | |
8cbd7bed | 166 | (define-key iris-function-map "\e[084q" [?\M-\[]) |
91212006 | 167 | |
8cbd7bed | 168 | (define-key iris-function-map "\e[085q" [?\M-\]]) |
91212006 | 169 | |
8cbd7bed | 170 | (define-key iris-function-map "\e[086q" [?\M-\\]) |
91212006 | 171 | |
8cbd7bed | 172 | (define-key iris-function-map "\e[087q" [?\M-a]) |
91212006 | 173 | |
8cbd7bed | 174 | (define-key iris-function-map "\e[088q" [?\M-s]) |
91212006 | 175 | |
8cbd7bed | 176 | (define-key iris-function-map "\e[089q" [?\M-d]) |
91212006 | 177 | |
8cbd7bed | 178 | (define-key iris-function-map "\e[090q" [?\M-f]) |
91212006 | 179 | |
8cbd7bed | 180 | (define-key iris-function-map "\e[091q" [?\M-g]) |
91212006 | 181 | |
8cbd7bed | 182 | (define-key iris-function-map "\e[092q" [?\M-h]) |
91212006 | 183 | |
8cbd7bed | 184 | (define-key iris-function-map "\e[093q" [?\M-j]) |
91212006 | 185 | |
8cbd7bed | 186 | (define-key iris-function-map "\e[094q" [?\M-k]) |
91212006 | 187 | |
8cbd7bed | 188 | (define-key iris-function-map "\e[095q" [?\M-l]) |
91212006 | 189 | |
8cbd7bed KL |
190 | (define-key iris-function-map "\e[096q" [?\C-\;]) |
191 | (define-key iris-function-map "\e[097q" [?\M-:]) ;; we are cheating | |
2bb819d5 KL |
192 | ;; here, this is realy |
193 | ;; M-;, but M-: | |
194 | ;; generates the same | |
195 | ;; string and is more | |
196 | ;; usefull. | |
91212006 | 197 | |
8cbd7bed KL |
198 | (define-key iris-function-map "\e[098q" [?\C-']) |
199 | (define-key iris-function-map "\e[099q" [?\M-']) | |
91212006 | 200 | |
8cbd7bed | 201 | (define-key iris-function-map "\e[100q" [?\M-\n]) |
91212006 | 202 | |
8cbd7bed | 203 | (define-key iris-function-map "\e[101q" [?\M-z]) |
91212006 | 204 | |
8cbd7bed | 205 | (define-key iris-function-map "\e[102q" [?\M-x]) |
91212006 | 206 | |
8cbd7bed | 207 | (define-key iris-function-map "\e[103q" [?\M-c]) |
91212006 | 208 | |
8cbd7bed | 209 | (define-key iris-function-map "\e[104q" [?\M-v]) |
91212006 | 210 | |
8cbd7bed | 211 | (define-key iris-function-map "\e[105q" [?\M-b]) |
91212006 | 212 | |
8cbd7bed | 213 | (define-key iris-function-map "\e[106q" [M-n]) |
91212006 | 214 | |
8cbd7bed | 215 | (define-key iris-function-map "\e[107q" [M-m]) |
91212006 | 216 | |
8cbd7bed KL |
217 | (define-key iris-function-map "\e[108q" [?\C-,]) |
218 | (define-key iris-function-map "\e[109q" [?\M-,]) | |
91212006 | 219 | |
8cbd7bed KL |
220 | (define-key iris-function-map "\e[110q" [?\C-.]) |
221 | (define-key iris-function-map "\e[111q" [?\M-.]) | |
91212006 | 222 | |
8cbd7bed KL |
223 | (define-key iris-function-map "\e[112q" [?\C-/]) |
224 | (define-key iris-function-map "\e[113q" [?\M-/]) | |
91212006 | 225 | |
8cbd7bed KL |
226 | (define-key iris-function-map "\e[139q" [insert]) |
227 | (define-key iris-function-map "\e[139q" [S-insert]) | |
228 | (define-key iris-function-map "\e[140q" [C-insert]) | |
229 | (define-key iris-function-map "\e[141q" [M-insert]) | |
91212006 | 230 | |
8cbd7bed KL |
231 | (define-key iris-function-map "\e[H" [home]) |
232 | (define-key iris-function-map "\e[143q" [S-home]) | |
233 | (define-key iris-function-map "\e[144q" [C-home]) | |
91212006 | 234 | |
91212006 | 235 | |
8cbd7bed KL |
236 | (define-key iris-function-map "\e[150q" [prior]) |
237 | (define-key iris-function-map "\e[151q" [S-prior]) ;; those don't seem | |
2bb819d5 KL |
238 | ;; to generate |
239 | ;; anything | |
8cbd7bed | 240 | (define-key iris-function-map "\e[152q" [C-prior]) |
91212006 | 241 | |
91212006 | 242 | |
8cbd7bed KL |
243 | ;; (define-key iris-function-map "^?" [delete]) ?? something else seems to take care of this. |
244 | (define-key iris-function-map "\e[P" [S-delete]) | |
245 | (define-key iris-function-map "\e[142q" [C-delete]) | |
246 | (define-key iris-function-map "\e[M" [M-delete]) | |
91212006 | 247 | |
8cbd7bed KL |
248 | (define-key iris-function-map "\e[146q" [end]) |
249 | (define-key iris-function-map "\e[147q" [S-end]) ;; those don't seem to | |
2bb819d5 | 250 | ;; generate anything |
8cbd7bed | 251 | (define-key iris-function-map "\e[148q" [C-end]) |
91212006 | 252 | |
8cbd7bed KL |
253 | (define-key iris-function-map "\e[154q" [next]) |
254 | (define-key iris-function-map "\e[155q" [S-next]) | |
255 | (define-key iris-function-map "\e[156q" [C-next]) | |
91212006 | 256 | |
91212006 | 257 | |
8cbd7bed KL |
258 | (define-key iris-function-map "\e[161q" [S-up]) |
259 | (define-key iris-function-map "\e[162q" [C-up]) | |
260 | (define-key iris-function-map "\e[163q" [M-up]) | |
91212006 | 261 | |
8cbd7bed KL |
262 | (define-key iris-function-map "\e[158q" [S-left]) |
263 | (define-key iris-function-map "\e[159q" [C-left]) | |
264 | (define-key iris-function-map "\e[160q" [M-left]) | |
91212006 | 265 | |
8cbd7bed KL |
266 | (define-key iris-function-map "\e[164q" [S-down]) |
267 | (define-key iris-function-map "\e[165q" [C-down]) | |
268 | (define-key iris-function-map "\e[166q" [M-down]) | |
91212006 | 269 | |
8cbd7bed KL |
270 | (define-key iris-function-map "\e[167q" [S-right]) |
271 | (define-key iris-function-map "\e[168q" [C-right]) | |
272 | (define-key iris-function-map "\e[169q" [M-right]) | |
91212006 | 273 | |
8cbd7bed KL |
274 | ;; Keypad functions, most of those are untested. |
275 | (define-key iris-function-map "\e[179q" [?\C-/]) | |
276 | (define-key iris-function-map "\e[180q" [?\M-/]) | |
91212006 | 277 | |
8cbd7bed KL |
278 | (define-key iris-function-map "\e[187q" [?\C-*]) |
279 | (define-key iris-function-map "\e[188q" [?\M-*]) | |
91212006 | 280 | |
8cbd7bed KL |
281 | (define-key iris-function-map "\e[198q" [?\C--]) |
282 | (define-key iris-function-map "\e[199q" [?\M--]) | |
91212006 | 283 | |
8cbd7bed KL |
284 | ;; Something else takes care of home, up, prior, down, left, right, next |
285 | ;(define-key iris-function-map "\e[H" [home]) | |
286 | (define-key iris-function-map "\e[172q" [C-home]) | |
91212006 | 287 | |
8cbd7bed KL |
288 | ;(define-key iris-function-map "\e[A" [up]) |
289 | (define-key iris-function-map "\e[182q" [C-up]) | |
91212006 | 290 | |
91212006 | 291 | |
8cbd7bed KL |
292 | ;(define-key iris-function-map "\e[150q" [prior]) |
293 | (define-key iris-function-map "\e[190q" [C-prior]) | |
91212006 | 294 | |
91212006 | 295 | |
8cbd7bed KL |
296 | (define-key iris-function-map "\e[200q" [?\C-+]) |
297 | (define-key iris-function-map "\e[201q" [?\M-+]) | |
91212006 | 298 | |
8cbd7bed KL |
299 | ;(define-key iris-function-map "\e[D" [left]) |
300 | (define-key iris-function-map "\e[174q" [C-left]) | |
91212006 | 301 | |
91212006 | 302 | |
8cbd7bed KL |
303 | (define-key iris-function-map "\e[000q" [begin]) |
304 | (define-key iris-function-map "\e[184q" [C-begin]) | |
91212006 | 305 | |
91212006 | 306 | |
8cbd7bed KL |
307 | ;(define-key iris-function-map "\e[C" [right]) |
308 | (define-key iris-function-map "\e[192q" [C-right]) | |
91212006 | 309 | |
8cbd7bed KL |
310 | ;(define-key iris-function-map "\e[146q" [end]) |
311 | (define-key iris-function-map "\e[176q" [C-end]) | |
91212006 | 312 | |
8cbd7bed KL |
313 | ;(define-key iris-function-map "\e[B" [down]) |
314 | (define-key iris-function-map "\e[186q" [C-down]) | |
91212006 | 315 | |
8cbd7bed KL |
316 | ;(define-key iris-function-map "\e[154q" [next]) |
317 | (define-key iris-function-map "\e[194q" [C-next]) | |
91212006 | 318 | |
91212006 | 319 | |
8cbd7bed | 320 | (define-key iris-function-map "\e[100q" [M-enter]) |
91212006 | 321 | |
8cbd7bed KL |
322 | (define-key iris-function-map "\e[139q" [insert]) |
323 | (define-key iris-function-map "\e[178q" [C-inset]) | |
2bb819d5 | 324 | |
8cbd7bed KL |
325 | (define-key iris-function-map "\e[P" [delete]) |
326 | (define-key iris-function-map "\e[196q" [C-delete]) | |
327 | (define-key iris-function-map "\e[197q" [M-delete]) | |
2bb819d5 | 328 | |
fbf34973 KL |
329 | (defun terminal-init-iris-ansi () |
330 | "Terminal initialization function for iris-ansi." | |
8cbd7bed KL |
331 | ;; Use inheritance to let the main keymap override these defaults. |
332 | ;; This way we don't override terminfo-derived settings or settings | |
333 | ;; made in the .emacs file. | |
334 | (let ((m (copy-keymap iris-function-map))) | |
335 | (set-keymap-parent m (keymap-parent local-function-key-map)) | |
336 | (set-keymap-parent local-function-key-map m))) | |
91212006 | 337 | |
ab5796a9 | 338 | ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b |
e8af40ee | 339 | ;;; iris-ansi.el ends here |