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