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: XEmacs Development Team
8 ;; Keywords: extensions, internal, dumped
10 ;; This file is part of XEmacs.
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)
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.
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.
27 ;;; Synched up with: Not synched.
31 ;; created by jwz, 13-jun-92.
32 ;; changed by Heiko Muenkel, 12-jun-1997: Added a grave keysym.
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.
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.
47 ;; The standard case and syntax tables are set in iso8859-1.el, since
48 ;; that is not X-specific.
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.")
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.)
65 . (lambda (&rest syms-and-iso8859/1-codes)
70 ;; First emit code that puts the `x-iso8859/1' property on all of
71 ;; the keysym symbols.
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)
78 ;; Then emit code that binds all of those keysym symbols to
79 ;; `self-insert-command'.
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)
86 ;; Then emit the value of iso8859/1-code-to-x-keysym-table.
88 (let ((v (make-vector 256 nil)))
89 ;; the printing ASCII chars have 1-char names.
92 (aset v i (intern (make-string 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)))
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
121 (guillemotleft ?\253)
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).
137 (guillemotright ?\273)
140 (threequarters ?\276)
211 ((macro . (lambda (&rest syms-and-iso8859/1-codes)
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))))
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.
222 (SunXK_FA_Acute ?\264)
223 (Dacute_accent ?\264)
224 (DXK_acute_accent ?\264)
226 (hpXK_mute_acute ?\264)
227 (XK_mute_acute ?\264)
233 (DXK_grave_accent ?`)
238 (SunFA_Cedilla ?\270)
239 (SunXK_FA_Cedilla ?\270)
240 (Dcedilla_accent ?\270)
241 (DXK_cedilla_accent ?\270)
243 (SunFA_Diaeresis ?\250)
244 (SunXK_FA_Diaeresis ?\250)
245 (hpmute_diaeresis ?\250)
246 (hpXK_mute_diaeresis ?\250)
247 (XK_mute_diaeresis ?\250)
252 (Dcircumflex_accent ?^)
253 (DXK_circumflex_accent ?^)
254 (hpmute_asciicircum ?^)
255 (hpXK_mute_asciicircum ?^)
256 (XK_mute_asciicircum ?^)
263 (hpmute_asciitilde ?~)
264 (hpXK_mute_asciitilde ?~)
265 (XK_mute_asciitilde ?~)
268 (DXK_ring_accent ?\260)
271 (provide 'x-iso8859-1)
273 ;;; x-iso8859-1.el ends here