0
|
1 ;; Mapping between X keysym names and ISO 8859-1 (aka Latin1) character codes.
|
|
2 ;; Copyright (C) 1992, 1993 Free Software Foundation, Inc.
|
|
3
|
|
4 ;; This file is part of XEmacs.
|
|
5
|
|
6 ;; XEmacs is free software; you can redistribute it and/or modify it
|
|
7 ;; under the terms of the GNU General Public License as published by
|
|
8 ;; the Free Software Foundation; either version 2, or (at your option)
|
|
9 ;; any later version.
|
|
10
|
|
11 ;; XEmacs is distributed in the hope that it will be useful, but
|
|
12 ;; WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
|
14 ;; General Public License for more details.
|
|
15
|
|
16 ;; You should have received a copy of the GNU General Public License
|
|
17 ;; along with XEmacs; see the file COPYING. If not, write to the Free
|
|
18 ;; Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
|
19
|
|
20 ;; created by jwz, 13-jun-92.
|
48
|
21 ;; changed by Heiko Muenkel, 12-jun-1997: Added a grave keysym.
|
0
|
22
|
|
23 ;; Under X, when the user types a character that is ISO-8859/1 but not ASCII,
|
|
24 ;; it comes in as a symbol instead of as a character code. This keeps things
|
|
25 ;; nice and character-set independent. This file takes all of those symbols
|
|
26 ;; (the symbols that are the X names for the 8859/1 characters) and puts a
|
|
27 ;; property on them which holds the character code that should be inserted in
|
|
28 ;; the buffer when they are typed. The self-insert-command function will look
|
|
29 ;; at this. It also binds them all to self-insert-command.
|
|
30
|
|
31 ;; It puts the same property on the keypad keys, so that (read-char) will
|
|
32 ;; think that they are the same as the digit characters. However, those
|
52
|
33 ;; keys are bound to one-character keyboard macros, so that `kp-9' will, by
|
0
|
34 ;; default, do the same thing that `9' does, in whatever the current mode is.
|
|
35
|
|
36 ;; The standard case and syntax tables are set in prim/iso8859-1.el, since
|
|
37 ;; that is not X-specific.
|
|
38
|
|
39 (require 'iso8859-1)
|
|
40
|
|
41 (defconst iso8859/1-code-to-x-keysym-table nil
|
|
42 "Maps iso8859/1 to an X keysym name which corresponds to it.
|
|
43 There may be more than one X name for this keycode; this returns the first one.
|
|
44 Note that this is X specific; one should avoid using this table whenever
|
|
45 possible, in the interest of portability.")
|
|
46
|
|
47 ;; (This esoteric little construct is how you do MACROLET in elisp. It
|
|
48 ;; generates the most efficient code for the .elc file by unwinding the
|
|
49 ;; loop at compile-time.)
|
|
50
|
|
51 ((macro
|
|
52 . (lambda (&rest syms-and-iso8859/1-codes)
|
|
53 (cons
|
|
54 'progn
|
|
55 (nconc
|
|
56 ;;
|
|
57 ;; First emit code that puts the `x-iso8859/1' property on all of
|
|
58 ;; the keysym symbols.
|
|
59 ;;
|
|
60 (mapcar '(lambda (sym-and-code)
|
|
61 (list 'put (list 'quote (car sym-and-code))
|
|
62 ''x-iso8859/1 (car (cdr sym-and-code))))
|
|
63 syms-and-iso8859/1-codes)
|
|
64 ;;
|
|
65 ;; Then emit code that binds all of those keysym symbols to
|
|
66 ;; `self-insert-command'.
|
|
67 ;;
|
|
68 (mapcar '(lambda (sym-and-code)
|
|
69 (list 'global-set-key (list 'quote (car sym-and-code))
|
|
70 ''self-insert-command))
|
|
71 syms-and-iso8859/1-codes)
|
|
72 ;;
|
|
73 ;; Then emit the value of iso8859/1-code-to-x-keysym-table.
|
|
74 ;;
|
|
75 (let ((v (make-vector 256 nil)))
|
|
76 ;; the printing ASCII chars have 1-char names.
|
|
77 (let ((i 33))
|
|
78 (while (< i 127)
|
|
79 (aset v i (intern (make-string 1 i)))
|
|
80 (setq i (1+ i))))
|
|
81 ;; these are from the keyboard character set.
|
|
82 (mapcar '(lambda (x) (aset v (car x) (car (cdr x))))
|
|
83 '((8 backspace) (9 tab) (10 linefeed) (13 return)
|
|
84 (27 escape) (32 space) (127 delete)))
|
|
85 (mapcar '(lambda (sym-and-code)
|
|
86 (or (aref v (car (cdr sym-and-code)))
|
|
87 (aset v (car (cdr sym-and-code)) (car sym-and-code))))
|
|
88 syms-and-iso8859/1-codes)
|
|
89 (list (list 'setq 'iso8859/1-code-to-x-keysym-table v)))
|
|
90 ))))
|
|
91
|
|
92 ;; The names and capitalization here are as per the MIT X11R4 and X11R5
|
|
93 ;; distributions. If a vendor varies from this, adjustments will need
|
|
94 ;; to be made...
|
|
95
|
48
|
96 (grave ?\140)
|
0
|
97 (nobreakspace ?\240)
|
|
98 (exclamdown ?\241)
|
|
99 (cent ?\242)
|
|
100 (sterling ?\243)
|
|
101 (currency ?\244)
|
|
102 (yen ?\245)
|
|
103 (brokenbar ?\246)
|
|
104 (section ?\247)
|
|
105 (diaeresis ?\250)
|
|
106 (copyright ?\251)
|
|
107 (ordfeminine ?\252)
|
|
108 (guillemotleft ?\253)
|
|
109 (notsign ?\254)
|
|
110 (hyphen ?\255)
|
|
111 (registered ?\256)
|
|
112 (macron ?\257)
|
|
113 (degree ?\260)
|
|
114 (plusminus ?\261)
|
|
115 (twosuperior ?\262)
|
|
116 (threesuperior ?\263)
|
|
117 (acute ?\264) ; Why is there an acute keysym that is
|
|
118 (mu ?\265) ; distinct from apostrophe/quote, but
|
|
119 (paragraph ?\266) ; no grave keysym that is distinct from
|
48
|
120 (periodcentered ?\267) ; backquote?
|
|
121 (cedilla ?\270) ; I've added the grave keysym, because it's
|
|
122 (onesuperior ?\271) ; used in x-compose (Heiko Muenkel).
|
0
|
123 (masculine ?\272)
|
|
124 (guillemotright ?\273)
|
|
125 (onequarter ?\274)
|
|
126 (onehalf ?\275)
|
|
127 (threequarters ?\276)
|
|
128 (questiondown ?\277)
|
|
129
|
|
130 (Agrave ?\300)
|
|
131 (Aacute ?\301)
|
|
132 (Acircumflex ?\302)
|
|
133 (Atilde ?\303)
|
|
134 (Adiaeresis ?\304)
|
|
135 (Aring ?\305)
|
|
136 (AE ?\306)
|
|
137 (Ccedilla ?\307)
|
|
138 (Egrave ?\310)
|
|
139 (Eacute ?\311)
|
|
140 (Ecircumflex ?\312)
|
|
141 (Ediaeresis ?\313)
|
|
142 (Igrave ?\314)
|
|
143 (Iacute ?\315)
|
|
144 (Icircumflex ?\316)
|
|
145 (Idiaeresis ?\317)
|
|
146 (ETH ?\320)
|
|
147 (Ntilde ?\321)
|
|
148 (Ograve ?\322)
|
|
149 (Oacute ?\323)
|
|
150 (Ocircumflex ?\324)
|
|
151 (Otilde ?\325)
|
|
152 (Odiaeresis ?\326)
|
|
153 (multiply ?\327)
|
|
154 (Ooblique ?\330)
|
|
155 (Ugrave ?\331)
|
|
156 (Uacute ?\332)
|
|
157 (Ucircumflex ?\333)
|
|
158 (Udiaeresis ?\334)
|
|
159 (Yacute ?\335)
|
|
160 (THORN ?\336)
|
|
161 (ssharp ?\337)
|
|
162
|
|
163 (agrave ?\340)
|
|
164 (aacute ?\341)
|
|
165 (acircumflex ?\342)
|
|
166 (atilde ?\343)
|
|
167 (adiaeresis ?\344)
|
|
168 (aring ?\345)
|
|
169 (ae ?\346)
|
|
170 (ccedilla ?\347)
|
|
171 (egrave ?\350)
|
|
172 (eacute ?\351)
|
|
173 (ecircumflex ?\352)
|
|
174 (ediaeresis ?\353)
|
|
175 (igrave ?\354)
|
|
176 (iacute ?\355)
|
|
177 (icircumflex ?\356)
|
|
178 (idiaeresis ?\357)
|
|
179 (eth ?\360)
|
|
180 (ntilde ?\361)
|
|
181 (ograve ?\362)
|
|
182 (oacute ?\363)
|
|
183 (ocircumflex ?\364)
|
|
184 (otilde ?\365)
|
|
185 (odiaeresis ?\366)
|
|
186 (division ?\367)
|
|
187 (oslash ?\370)
|
|
188 (ugrave ?\371)
|
|
189 (uacute ?\372)
|
|
190 (ucircumflex ?\373)
|
|
191 (udiaeresis ?\374)
|
|
192 (yacute ?\375)
|
|
193 (thorn ?\376)
|
|
194 (ydiaeresis ?\377)
|
|
195
|
|
196 )
|
|
197
|
|
198 ((macro . (lambda (&rest syms-and-iso8859/1-codes)
|
|
199 (cons 'progn
|
|
200 (mapcar '(lambda (sym-and-code)
|
|
201 (list 'put (list 'quote (car sym-and-code))
|
|
202 ''x-iso8859/1 (car (cdr sym-and-code))))
|
|
203 syms-and-iso8859/1-codes))))
|
|
204 ;;
|
|
205 ;; Let's do the appropriate thing for some vendor-specific keysyms too...
|
|
206 ;; Apparently nobody agrees on what the names of these keysyms are.
|
|
207 ;;
|
|
208 (SunFA_Acute ?\264)
|
|
209 (SunXK_FA_Acute ?\264)
|
|
210 (Dacute_accent ?\264)
|
|
211 (DXK_acute_accent ?\264)
|
|
212 (hpmute_acute ?\264)
|
|
213 (hpXK_mute_acute ?\264)
|
|
214 (XK_mute_acute ?\264)
|
|
215
|
|
216 (SunFA_Grave ?`)
|
|
217 (Dead_Grave ?`)
|
|
218 (SunXK_FA_Grave ?`)
|
|
219 (Dgrave_accent ?`)
|
|
220 (DXK_grave_accent ?`)
|
|
221 (hpmute_grave ?`)
|
|
222 (hpXK_mute_grave ?`)
|
|
223 (XK_mute_grave ?`)
|
|
224
|
|
225 (SunFA_Cedilla ?\270)
|
|
226 (SunXK_FA_Cedilla ?\270)
|
|
227 (Dcedilla_accent ?\270)
|
|
228 (DXK_cedilla_accent ?\270)
|
|
229
|
|
230 (SunFA_Diaeresis ?\250)
|
|
231 (SunXK_FA_Diaeresis ?\250)
|
|
232 (hpmute_diaeresis ?\250)
|
|
233 (hpXK_mute_diaeresis ?\250)
|
|
234 (XK_mute_diaeresis ?\250)
|
|
235
|
|
236 (SunFA_Circum ?^)
|
|
237 (Dead_Circum ?^)
|
|
238 (SunXK_FA_Circum ?^)
|
|
239 (Dcircumflex_accent ?^)
|
|
240 (DXK_circumflex_accent ?^)
|
|
241 (hpmute_asciicircum ?^)
|
|
242 (hpXK_mute_asciicircum ?^)
|
|
243 (XK_mute_asciicircum ?^)
|
|
244
|
|
245 (SunFA_Tilde ?~)
|
|
246 (Dead_Tilde ?~)
|
|
247 (SunXK_FA_Tilde ?~)
|
|
248 (Dtilde ?~)
|
|
249 (DXK_tilde ?~)
|
|
250 (hpmute_asciitilde ?~)
|
|
251 (hpXK_mute_asciitilde ?~)
|
|
252 (XK_mute_asciitilde ?~)
|
|
253
|
|
254 (Dring_accent ?\260)
|
|
255 (DXK_ring_accent ?\260)
|
|
256 )
|
|
257
|
|
258 (provide 'x-iso8859-1)
|