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