1 ;;; iris-ansi.el --- configure Emacs for SGI xwsh and winterm apps -*- no-byte-compile: t -*-
3 ;; Copyright (C) 1997, 2002, 2003, 2004, 2005,
4 ;; 2006 Free Software Foundation, Inc.
6 ;; Author: Dan Nicolaescu <dann@ics.uci.edu>
8 ;; This file is part of GNU Emacs.
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
12 ;; the Free Software Foundation; either version 2, or (at your option)
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.
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
22 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
23 ;; Boston, MA 02110-1301, USA.
29 (defun iris-ansi-initialize-terminal ()
30 "Terminal initialization function for iris-ansi."
31 (define-key function-key-map
"\e[120q" [S-escape
])
32 (define-key function-key-map
"\e[121q" [C-escape
])
34 (define-key function-key-map
"\e[001q" [f1])
35 (define-key function-key-map "\e[013q" [S-f1])
36 (define-key function-key-map "\e[025q" [C-f1])
39 (define-key function-key-map "\e[002q" [f2])
40 (define-key function-key-map "\e[014q" [S-f2])
41 (define-key function-key-map "\e[026q" [C-f2])
42 (define-key function-key-map "\e[038q" [M-f2])
44 (define-key function-key-map "\e[003q" [f3])
45 (define-key function-key-map "\e[015q" [S-f3])
46 (define-key function-key-map "\e[027q" [C-f3])
49 (define-key function-key-map "\e[004q" [f4])
50 (define-key function-key-map "\e[016q" [S-f4])
51 (define-key function-key-map "\e[028q" [C-f4])
54 (define-key function-key-map "\e[005q" [f5])
55 (define-key function-key-map "\e[017q" [S-f5])
56 (define-key function-key-map "\e[029q" [C-f5])
59 (define-key function-key-map "\e[006q" [f6])
60 (define-key function-key-map "\e[018q" [S-f6])
61 (define-key function-key-map "\e[030q" [C-f6])
64 (define-key function-key-map "\e[007q" [f7])
65 (define-key function-key-map "\e[019q" [S-f7])
66 (define-key function-key-map "\e[031q" [C-f7])
69 (define-key function-key-map "\e[008q" [f8])
70 (define-key function-key-map "\e[020q" [S-f8])
71 (define-key function-key-map "\e[032q" [C-f8])
74 (define-key function-key-map "\e[009q" [f9])
75 (define-key function-key-map "\e[021q" [S-f9])
76 (define-key function-key-map "\e[033q" [C-f9])
79 (define-key function-key-map "\e[010q" [f10])
80 (define-key function-key-map "\e[022q" [S-f10])
81 (define-key function-key-map "\e[034q" [C-f10])
84 (define-key function-key-map "\e[011q" [f11])
85 (define-key function-key-map "\e[023q" [S-f11])
86 (define-key function-key-map "\e[035q" [C-f11])
87 (define-key function-key-map "\e[047q" [M-f11])
89 (define-key function-key-map "\e[012q" [f12])
90 (define-key function-key-map "\e[024q" [S-f12])
91 (define-key function-key-map "\e[036q" [C-f12])
92 (define-key function-key-map "\e[048q" [M-f12])
95 (define-key function-key-map "\e[057q" [?\C-`])
96 (define-key function-key-map "\e[115q" [?\M-`])
98 (define-key function-key-map "\e[049q" [?\C-1])
99 (define-key function-key-map "\e[058q" [?\M-1])
102 (define-key function-key-map "\e[059q" [?\M-2])
104 (define-key function-key-map "\e[050q" [?\C-3])
105 (define-key function-key-map "\e[060q" [?\M-3])
107 (define-key function-key-map "\e[051q" [?\C-4])
108 (define-key function-key-map "\e[061q" [?\M-4])
110 (define-key function-key-map "\e[052q" [?\C-5])
111 (define-key function-key-map "\e[062q" [?\M-5])
114 (define-key function-key-map "\e[063q" [?\M-6])
116 (define-key function-key-map "\e[053q" [?\C-7])
117 (define-key function-key-map "\e[064q" [?\M-7])
119 (define-key function-key-map "\e[054q" [?\C-8])
120 (define-key function-key-map "\e[065q" [?\M-8])
122 (define-key function-key-map "\e[055q" [?\C-9])
123 (define-key function-key-map "\e[066q" [?\M-9])
125 (define-key function-key-map "\e[056q" [?\C-0])
126 (define-key function-key-map "\e[067q" [?\M-0])
128 (define-key function-key-map "\e[068q" [?\M--])
130 (define-key function-key-map "\e[069q" [?\C-=])
131 (define-key function-key-map "\e[070q" [?\M-=])
133 ;; I don't know what to do with those.
134 ;;(define-key function-key-map "^H" [<del>])
135 ;;(define-key function-key-map "^H" [S-<del>])
136 ;;(define-key function-key-map "\177" [C-<del>])
137 ;;(define-key function-key-map "\e[071q" [M-<del>])
139 (define-key function-key-map "\e[Z" [?\S-\t])
140 (define-key function-key-map "\e[072q" [?\C-\t])
141 ;; This only works if you remove the M-TAB keybing from the system.4Dwmrc
142 ;; our your ~/.4Dwmrc, if you use the 4Dwm window manager.
143 (define-key function-key-map "\e[073q" [?\M-\t])
145 (define-key function-key-map "\e[074q" [?\M-q])
147 (define-key function-key-map "\e[075q" [?\M-w])
149 (define-key function-key-map "\e[076q" [?\M-e])
151 (define-key function-key-map "\e[077q" [?\M-r])
153 (define-key function-key-map "\e[078q" [?\M-t])
155 (define-key function-key-map "\e[079q" [?\M-y])
157 (define-key function-key-map "\e[080q" [?\M-u])
159 (define-key function-key-map "\e[081q" [?\M-i])
161 (define-key function-key-map "\e[082q" [?\M-o])
163 (define-key function-key-map "\e[083q" [?\M-p])
165 (define-key function-key-map "\e[084q" [?\M-\[])
167 (define-key function-key-map "\e[085q" [?\M-\]])
169 (define-key function-key-map "\e[086q" [?\M-\\])
171 (define-key function-key-map "\e[087q" [?\M-a])
173 (define-key function-key-map "\e[088q" [?\M-s])
175 (define-key function-key-map "\e[089q" [?\M-d])
177 (define-key function-key-map "\e[090q" [?\M-f])
179 (define-key function-key-map "\e[091q" [?\M-g])
181 (define-key function-key-map "\e[092q" [?\M-h])
183 (define-key function-key-map "\e[093q" [?\M-j])
185 (define-key function-key-map "\e[094q" [?\M-k])
187 (define-key function-key-map "\e[095q" [?\M-l])
189 (define-key function-key-map "\e[096q" [?\C-\;])
190 (define-key function-key-map "\e[097q" [?\M-:]) ;; we are cheating
197 (define-key function-key-map "\e[098q" [?\C-'])
198 (define-key function-key-map "\e[099q" [?\M-'])
200 (define-key function-key-map "\e[100q" [?\M-\n])
202 (define-key function-key-map "\e[101q" [?\M-z])
204 (define-key function-key-map "\e[102q" [?\M-x])
206 (define-key function-key-map "\e[103q" [?\M-c])
208 (define-key function-key-map "\e[104q" [?\M-v])
210 (define-key function-key-map "\e[105q" [?\M-b])
212 (define-key function-key-map "\e[106q" [M-n])
214 (define-key function-key-map "\e[107q" [M-m])
216 (define-key function-key-map "\e[108q" [?\C-,])
217 (define-key function-key-map "\e[109q" [?\M-,])
219 (define-key function-key-map "\e[110q" [?\C-.])
220 (define-key function-key-map "\e[111q" [?\M-.])
222 (define-key function-key-map "\e[112q" [?\C-/])
223 (define-key function-key-map "\e[113q" [?\M-/])
225 (define-key function-key-map "\e[139q" [insert])
226 (define-key function-key-map "\e[139q" [S-insert])
227 (define-key function-key-map "\e[140q" [C-insert])
228 (define-key function-key-map "\e[141q" [M-insert])
230 (define-key function-key-map "\e[H" [home])
231 (define-key function-key-map "\e[143q" [S-home])
232 (define-key function-key-map "\e[144q" [C-home])
235 (define-key function-key-map "\e[150q" [prior])
236 (define-key function-key-map "\e[151q" [S-prior]) ;; those don't
240 (define-key function-key-map "\e[152q" [C-prior])
243 ;; (define-key function-key-map "^?" [delete])
244 (define-key function-key-map "\e[P" [S-delete])
245 (define-key function-key-map "\e[142q" [C-delete])
246 (define-key function-key-map "\e[M" [M-delete])
248 (define-key function-key-map "\e[146q" [end])
249 (define-key function-key-map "\e[147q" [S-end]) ;; those don't seem
252 (define-key function-key-map "\e[148q" [C-end])
254 (define-key function-key-map "\e[154q" [next])
255 (define-key function-key-map "\e[155q" [S-next])
256 (define-key function-key-map "\e[156q" [C-next])
259 (define-key function-key-map "\e[161q" [S-up])
260 (define-key function-key-map "\e[162q" [C-up])
261 (define-key function-key-map "\e[163q" [M-up])
263 (define-key function-key-map "\e[158q" [S-left])
264 (define-key function-key-map "\e[159q" [C-left])
265 (define-key function-key-map "\e[160q" [M-left])
267 (define-key function-key-map "\e[164q" [S-down])
268 (define-key function-key-map "\e[165q" [C-down])
269 (define-key function-key-map "\e[166q" [M-down])
271 (define-key function-key-map "\e[167q" [S-right])
272 (define-key function-key-map "\e[168q" [C-right])
273 (define-key function-key-map "\e[169q" [M-right])
275 ;; Keypad functions, most of those are untested.
276 (define-key function-key-map "\e[179q" [?\C-/])
277 (define-key function-key-map "\e[180q" [?\M-/])
279 (define-key function-key-map "\e[187q" [?\C-*])
280 (define-key function-key-map "\e[188q" [?\M-*])
282 (define-key function-key-map "\e[198q" [?\C--])
283 (define-key function-key-map "\e[199q" [?\M--])
285 ;; Something else takes care of home, up, prior, down, left, right, next
286 ;;(define-key function-key-map "\e[H" [home])
287 (define-key function-key-map "\e[172q" [C-home])
289 ;;(define-key function-key-map "\e[A" [up])
290 (define-key function-key-map "\e[182q" [C-up])
293 ;;(define-key function-key-map "\e[150q" [prior])
294 (define-key function-key-map "\e[190q" [C-prior])
297 (define-key function-key-map "\e[200q" [?\C-+])
298 (define-key function-key-map "\e[201q" [?\M-+])
300 ;;(define-key function-key-map "\e[D" [left])
301 (define-key function-key-map "\e[174q" [C-left])
304 (define-key function-key-map "\e[000q" [begin])
305 (define-key function-key-map "\e[184q" [C-begin])
308 ;;(define-key function-key-map "\e[C" [right])
309 (define-key function-key-map "\e[192q" [C-right])
311 ;;(define-key function-key-map "\e[146q" [end])
312 (define-key function-key-map "\e[176q" [C-end])
314 ;;(define-key function-key-map "\e[B" [down])
315 (define-key function-key-map "\e[186q" [C-down])
317 ;;(define-key function-key-map "\e[154q" [next])
318 (define-key function-key-map "\e[194q" [C-next])
321 (define-key function-key-map "\e[100q" [M-enter])
323 (define-key function-key-map "\e[139q" [insert])
324 (define-key function-key-map "\e[178q" [C-inset])
326 (define-key function-key-map "\e[P" [delete])
327 (define-key function-key-map "\e[196q" [C-delete])
328 (define-key function-key-map "\e[197q" [M-delete]))
330 ;;; arch-tag: b1d0e73a-bb7d-47be-9fb2-6fb126469a1b
331 ;;; iris-ansi.el ends here