1 ;;; x-iso8859-1 --- Mapping between X keysym names and ISO 8859-1
3 ;; Copyright (C) 1992, 1993, 1997 Free Software Foundation, Inc.
5 ;; Author: Jamie Zawinski <jwz@jwz.org>
7 ;; Maintainer: SXEmacs Development Team
8 ;; Keywords: extensions, internal, dumped
10 ;; This file is part of SXEmacs.
12 ;; SXEmacs is free software: you can redistribute it and/or modify
13 ;; it under the terms of the GNU General Public License as published by
14 ;; the Free Software Foundation, either version 3 of the License, or
15 ;; (at your option) any later version.
17 ;; SXEmacs is distributed in the hope that it will be useful,
18 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
19 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 ;; GNU General Public License for more details.
22 ;; You should have received a copy of the GNU General Public License
23 ;; along with this program. If not, see <http://www.gnu.org/licenses/>.
25 ;;; Synched up with: Not synched.
29 ;; created by jwz, 13-jun-92.
30 ;; changed by Heiko Muenkel, 12-jun-1997: Added a grave keysym.
32 ;; Under X, when the user types a character that is ISO-8859/1 but not ASCII,
33 ;; it comes in as a symbol instead of as a character code. This keeps things
34 ;; nice and character-set independent. This file takes all of those symbols
35 ;; (the symbols that are the X names for the 8859/1 characters) and puts a
36 ;; property on them which holds the character code that should be inserted in
37 ;; the buffer when they are typed. The self-insert-command function will look
38 ;; at this. It also binds them all to self-insert-command.
40 ;; It puts the same property on the keypad keys, so that (read-char) will
41 ;; think that they are the same as the digit characters. However, those
42 ;; keys are bound to one-character keyboard macros, so that `kp-9' will, by
43 ;; default, do the same thing that `9' does, in whatever the current mode is.
45 ;; The standard case and syntax tables are set in iso8859-1.el, since
46 ;; that is not X-specific.
52 (defconst iso8859/1-code-to-x-keysym-table nil
53 "Maps iso8859/1 to an X keysym name which corresponds to it.
54 There may be more than one X name for this keycode; this returns the first one.
55 Note that this is X specific; one should avoid using this table whenever
56 possible, in the interest of portability.")
58 ;; (This esoteric little construct is how you do MACROLET in elisp. It
59 ;; generates the most efficient code for the .elc file by unwinding the
60 ;; loop at compile-time.)
63 . (lambda (&rest syms-and-iso8859/1-codes)
68 ;; First emit code that puts the `x-iso8859/1' property on all of
69 ;; the keysym symbols.
71 (mapcar '(lambda (sym-and-code)
72 (list 'put (list 'quote (car sym-and-code))
73 ''x-iso8859/1 (car (cdr sym-and-code))))
74 syms-and-iso8859/1-codes)
76 ;; Then emit code that binds all of those keysym symbols to
77 ;; `self-insert-command'.
79 (mapcar '(lambda (sym-and-code)
80 (list 'global-set-key (list 'quote (car sym-and-code))
81 ''self-insert-command))
82 syms-and-iso8859/1-codes)
84 ;; Then emit the value of iso8859/1-code-to-x-keysym-table.
86 (let ((v (make-vector 256 nil)))
87 ;; the printing ASCII chars have 1-char names.
90 (aset v i (intern (make-string 1 i)))
92 ;; these are from the keyboard character set.
93 (mapcar '(lambda (x) (aset v (car x) (car (cdr x))))
94 '((8 backspace) (9 tab) (10 linefeed) (13 return)
95 (27 escape) (32 space) (127 delete)))
96 (mapcar '(lambda (sym-and-code)
97 (or (aref v (car (cdr sym-and-code)))
98 (aset v (car (cdr sym-and-code)) (car sym-and-code))))
99 syms-and-iso8859/1-codes)
100 (list (list 'setq 'iso8859/1-code-to-x-keysym-table v)))
103 ;; The names and capitalization here are as per the MIT X11R4 and X11R5
104 ;; distributions. If a vendor varies from this, adjustments will need
119 (guillemotleft ?\253)
127 (threesuperior ?\263)
128 (acute ?\264) ; Why is there an acute keysym that is
129 (mu ?\265) ; distinct from apostrophe/quote, but
130 (paragraph ?\266) ; no grave keysym that is distinct from
131 (periodcentered ?\267) ; backquote?
132 (cedilla ?\270) ; I've added the grave keysym, because it's
133 (onesuperior ?\271) ; used in x-compose (Heiko Muenkel).
135 (guillemotright ?\273)
138 (threequarters ?\276)
209 ((macro . (lambda (&rest syms-and-iso8859/1-codes)
211 (mapcar '(lambda (sym-and-code)
212 (list 'put (list 'quote (car sym-and-code))
213 ''x-iso8859/1 (car (cdr sym-and-code))))
214 syms-and-iso8859/1-codes))))
216 ;; Let's do the appropriate thing for some vendor-specific keysyms too...
217 ;; Apparently nobody agrees on what the names of these keysyms are.
220 (SunXK_FA_Acute ?\264)
221 (Dacute_accent ?\264)
222 (DXK_acute_accent ?\264)
224 (hpXK_mute_acute ?\264)
225 (XK_mute_acute ?\264)
231 (DXK_grave_accent ?`)
236 (SunFA_Cedilla ?\270)
237 (SunXK_FA_Cedilla ?\270)
238 (Dcedilla_accent ?\270)
239 (DXK_cedilla_accent ?\270)
241 (SunFA_Diaeresis ?\250)
242 (SunXK_FA_Diaeresis ?\250)
243 (hpmute_diaeresis ?\250)
244 (hpXK_mute_diaeresis ?\250)
245 (XK_mute_diaeresis ?\250)
250 (Dcircumflex_accent ?^)
251 (DXK_circumflex_accent ?^)
252 (hpmute_asciicircum ?^)
253 (hpXK_mute_asciicircum ?^)
254 (XK_mute_asciicircum ?^)
261 (hpmute_asciitilde ?~)
262 (hpXK_mute_asciitilde ?~)
263 (XK_mute_asciitilde ?~)
266 (DXK_ring_accent ?\260)
269 (provide 'x-iso8859-1)
271 ;;; x-iso8859-1.el ends here