comparison lisp/iso/iso-acc.el @ 153:25f70ba0133c r20-3b3

Import from CVS: tag r20-3b3
author cvs
date Mon, 13 Aug 2007 09:38:25 +0200
parents 318232e2a3f0
children 15872534500d
comparison
equal deleted inserted replaced
152:4c132ee2d62b 153:25f70ba0133c
1 ;;; iso-acc.el --- minor mode providing electric accent keys 1 ;;; iso-acc.el --- minor mode providing electric accent keys
2 2
3 ;; Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc. 3 ;; Copyright (C) 1993, 1994, 1996 Free Software Foundation, Inc.
4 4
5 ;; Author: Johan Vromans <jv@mh.nl> 5 ;; Author: Johan Vromans
6 ;; Maintainer: Alexandre Oliva <oliva@dcc.unicamp.br> 6 ;; Maintainer: Alexandre Oliva <oliva@dcc.unicamp.br>
7 ;; Keywords: i18n 7 ;; Keywords: i18n
8 ;; Adapted to XEmacs 19.14 by Alexandre Oliva <oliva@dcc.unicamp.br> 8 ;; $Revision: 1.5 $
9 ;; $Revision: 1.4 $ 9 ;; $Date: 1997/05/29 23:49:45 $
10 ;; $Date: 1997/05/10 23:20:58 $
11 10
12 ;; This file is part of GNU Emacs. 11 ;; This file is part of GNU Emacs.
13 12
14 ;; GNU Emacs is free software; you can redistribute it and/or modify 13 ;; GNU Emacs is free software; you can redistribute it and/or modify
15 ;; it under the terms of the GNU General Public License as published by 14 ;; it under the terms of the GNU General Public License as published by
29 ;;; Commentary: 28 ;;; Commentary:
30 29
31 ;; Function `iso-accents-mode' activates a minor mode in which 30 ;; Function `iso-accents-mode' activates a minor mode in which
32 ;; typewriter "dead keys" are emulated. The purpose of this emulation 31 ;; typewriter "dead keys" are emulated. The purpose of this emulation
33 ;; is to provide a simple means for inserting accented characters 32 ;; is to provide a simple means for inserting accented characters
34 ;; according to the ISO-8859-1 character set. 33 ;; according to the ISO-8859-1 and other character sets.
35 ;; 34 ;;
36 ;; In `iso-accents-mode', pseudo accent characters are used to 35 ;; In `iso-accents-mode', pseudo accent characters are used to
37 ;; introduce accented keys. The pseudo-accent characters are: 36 ;; introduce accented keys. The pseudo-accent characters are:
38 ;; 37 ;;
39 ;; ' (minute) -> grave accent 38 ;; ' (minute) -> grave accent
40 ;; ` (backtick) -> acute accent 39 ;; ` (backtick) -> acute accent
41 ;; " (second) -> diaeresis 40 ;; " (second) -> diaeresis
42 ;; ^ (caret) -> circumflex 41 ;; ^ (caret) -> circumflex
43 ;; ~ (tilde) -> tilde over the character 42 ;; ~ (tilde) -> tilde over the character
44 ;; / (slash) -> slash through the character 43 ;; / (slash) -> slash through the character
44 ;; Also: /A is A-with-ring and /E is AE ligature.
45 ;; . (dot) -> dot over the character 45 ;; . (dot) -> dot over the character
46 ;; , (cedilla) -> cedilla under the character (except on default mode) 46 ;; , (cedilla) -> cedilla under the character (some languages only)
47 ;; Also: /A is A-with-ring and /E is AE ligature.
48 ;; 47 ;;
49 ;; The action taken depends on the key that follows the pseudo accent. 48 ;; The action taken depends on the key that follows the pseudo accent.
50 ;; In general: 49 ;; In general:
51 ;; 50 ;;
52 ;; pseudo-accent + appropriate letter -> accented letter 51 ;; pseudo-accent + appropriate letter -> accented letter
67 66
68 ;;; Code: 67 ;;; Code:
69 68
70 (provide 'iso-acc) 69 (provide 'iso-acc)
71 70
72 ;; needed for compatibility with XEmacs 19.14 71 ;; multiple Emacs versions compatibility section
72
73 (if (fboundp 'make-char)
74 (defalias 'iso-make-char 'make-char)
75 (defun iso-make-char (charset) 128))
76
73 (if (fboundp 'read-event) 77 (if (fboundp 'read-event)
74 (defalias 'iso-read-event 'read-event) 78 (defalias 'iso-read-event 'read-event)
75 (defun iso-read-event () 79 (defun iso-read-event ()
76 (event-key (next-command-event)))) 80 (event-key (next-command-event))))
77 81
78 (if (fboundp 'character-to-event) 82 (if (fboundp 'character-to-event)
79 (defun iso-char-to-event (ch) 83 (progn
80 "returns an event containing the given character" 84 (defun iso-char-list-to-event (l)
81 (character-to-event (list ch))) 85 "returns an event containing the given list of characters"
82 (defun iso-char-to-event (ch) 86 (character-to-event l))
83 "returns the character itself" 87 (defun iso-char-to-event (ch)
84 ch)) 88 "returns an event containing the given character"
85 89 (iso-char-list-to-event (list ch))))
86 ;; needed for compatibility with XEmacs 19.14 and GNU Emacs 19.30 90 (defalias 'iso-char-to-event 'identity)
91 (defalias 'iso-char-list-to-event 'identity))
92
87 (if (fboundp 'this-single-command-keys) () 93 (if (fboundp 'this-single-command-keys) ()
88 (if (string-match "Lucid" (version)) 94 (if (string-match "Lucid" (version))
89 (defun this-single-command-keys () 95 (defun this-single-command-keys ()
90 (setq this-command (not (this-command-keys))) 96 (setq this-command (not (this-command-keys)))
91 (this-command-keys)) 97 (this-command-keys))
92 (defun this-single-command-keys () (this-command-keys)))) 98 (defun this-single-command-keys () (this-command-keys))))
93 99
94 ;; end of compatibility modules 100 (defvar iso-accents-insert-offset
101 (if (boundp 'nonascii-insert-offset)
102 nonascii-insert-offset
103 0)
104 "*Offset added by ISO Accents mode to character codes 0200 and above.")
105
106 ;; end of compatibility section
95 107
96 (defvar iso-languages 108 (defvar iso-languages
97 '(("portuguese" 109 '(("catalan"
110 ;; Note this includes some extra characters used in Spanish,
111 ;; on the idea that someone who uses Catalan is likely to use Spanish
112 ;; as well.
113 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
114 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
115 (?\ . ?'))
116 (?` (?A . ?\300) (?E . ?\310) (?O . ?\322)
117 (?a . ?\340) (?e . ?\350) (?o . ?\362) (?\ . ?`))
118 (?\" (?I . ?\317) (?U . ?\334) (?i . ?\357) (?u . ?\374) (?\ . ?\"))
119 (?~ (?C . ?\307) (?N . ?\321) (?c . ?\347) (?n . ?\361)
120 (?> . ?\273) (?< . ?\253) (?! . ?\241) (?? . ?\277)
121 (?\ . ?~)))
122
123 ("esperanto"
124 (?^ (?H . ?\246) (?J . ?\254) (?h . ?\266) (?j . ?\274) (?C . ?\306)
125 (?G . ?\330) (?S . ?\336) (?c . ?\346) (?g . ?\370) (?s . ?\376)
126 (?^ . ?^) (?\ . ?^))
127 (?~ (?U . ?\335) (?u . ?\375) (?\ . ?~)))
128
129 ("french"
130 (?' (?E . ?\311) (?C . ?\307)
131 (?e . ?\351) (?c . ?\347)
132 (?\ . ?') (space . ?'))
133 (?` (?A . ?\300) (?E . ?\310) (?U . ?\331)
134 (?a . ?\340) (?e . ?\350) (?u . ?\371)
135 (?\ . ?`) (space . ?`))
136 (?^ (?A . ?\302) (?E . ?\312) (?I . ?\316) (?O . ?\324) (?U . ?\333)
137 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373)
138 (?\ . ?^) (space . ?^))
139 (?\" (?E . ?\313) (?I . ?\317)
140 (?e . ?\353) (?i . ?\357)
141 (?\ . ?\") (space . ?\"))
142 (?~ (?< . ?\253) (?> . ?\273)
143 (?C . ?\307) (?c . ?\347)
144 (?\ . ?~) (space . ?~))
145 (?, (?c . ?\347) (?C . ?\307) (?, . ?,)))
146
147 ("german"
148 (?\" (?A . ?\304) (?O . ?\326) (?U . ?\334)
149 (?a . ?\344) (?o . ?\366) (?u . ?\374) (?s . ?\337) (?\ . ?\")))
150
151 ("irish"
152 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
153 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
154 (?\ . ?') (space . ?')))
155
156 ("portuguese"
98 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332) 157 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
99 (?C . ?\307) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) 158 (?C . ?\307) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363)
100 (?u . ?\372) (?c . ?\347) (?\ . ?') (space . ?')) 159 (?u . ?\372) (?c . ?\347) (?\ . ?') (space . ?'))
101 (?` (?A . ?\300) (?a . ?\340) (?\ . ?`) (space . ?`)) 160 (?` (?A . ?\300) (?a . ?\340) (?\ . ?`) (space . ?`))
102 (?^ (?A . ?\302) (?E . ?\312) (?O . ?\324) (?a . ?\342) (?e . ?\352) 161 (?^ (?A . ?\302) (?E . ?\312) (?O . ?\324) (?a . ?\342) (?e . ?\352)
103 (?o . ?\364) (?\ . ?^) (space . ?^)) 162 (?o . ?\364) (?\ . ?^) (space . ?^))
104 (?\" (?U . ?\334) (?u . ?\374) (?\ . ?\") (space . ?\")) 163 (?\" (?U . ?\334) (?u . ?\374) (?\ . ?\") (space . ?\"))
105 (?\~ (?A . ?\303) (?O . ?\325) (?a . ?\343) (?o . ?\365) (?\ . ?\~) 164 (?~ (?A . ?\303) (?O . ?\325)
106 (space . ?\~)) 165 (?a . ?\343) (?o . ?\365)
107 (?, (?c . ?\347) (?C . ?\307))) 166 (?\ . ?~) (space . ?~))
108 167 (?, (?c . ?\347) (?C . ?\307) (?, . ?,)))
109 ("irish" 168
169 ("spanish"
110 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332) 170 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
111 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372) 171 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
112 (?\ . ?') (space . ?'))) 172 (?\ . ?'))
173 (?\" (?U . ?\334) (?u . ?\374) (?\ . ?\"))
174 (?~ (?N . ?\321) (?n . ?\361) (?> . ?\273) (?< . ?\253) (?! . ?\241)
175 (?? . ?\277) (?\ . ?~)))
113 176
114 ("french"
115 (?' (?E . ?\311) (?C . ?\307) (?e . ?\351) (?c . ?\347) (?\ . ?')
116 (space . ?'))
117 (?` (?A . ?\300) (?E . ?\310) (?a . ?\340) (?e . ?\350) (?\ . ?`)
118 (space . ?`))
119 (?^ (?A . ?\302) (?E . ?\312) (?I . ?\316) (?O . ?\324) (?U . ?\333)
120 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373)
121 (?\ . ?^) (space . ?^))
122 (?\" (?E . ?\313) (?I . ?\317)
123 (?e . ?\353) (?i . ?\357) (?\ . ?\") (space . ?\"))
124 (?\~ (?< . ?\253) (?> . ?\273) (?C . ?\307) (?c . ?\347) (?\ . ?\~)
125 (space . ?\~))
126 (?, (?c . ?\347) (?C . ?\307)))
127
128 ;;; ISO-8859-3, developed by D. Dale Gulledge <ddg@cci.com>
129 ("latin-3"
130 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323)
131 (?U . ?\332) (?a . ?\341) (?e . ?\351) (?i . ?\355)
132 (?o . ?\363) (?u . ?\372) (?\ . ?') (space . ?'))
133 (?. (?C . ?\305) (?G . ?\325) (?I . ?\251) (?Z . ?\257)
134 (?c . ?\345) (?g . ?\365) (?z . ?\277))
135 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326)
136 (?U . ?\334) (?a . ?\344) (?e . ?\353) (?i . ?\357)
137 (?o ?\366) (?u ?\374) (?\ . ?\") (space . ?\"))
138 (?\/ (?\/ . ?\260) (?\ . ?/) (space . ?/))
139 (?\~ (?C . ?\307) (?G . ?\253) (?N . ?\321) (?S . ?\252)
140 (?U . ?\335) (?\~ . ?\270) (?c . ?\347) (?g . ?\273)
141 (?h . ?\261) (?n . ?\361) (?u . ?\375)
142 (?\ . ?~) (space . ?~))
143 (?^ (?A . ?\302) (?C . ?\306) (?E . ?\312) (?G . ?\330)
144 (?H . ?\246) (?I . ?\316) (?J . ?\254) (?O . ?\324)
145 (?S . ?\336) (?U . ?\333) (?a . ?\342) (?c . ?\346)
146 (?e . ?\352) (?g . ?\370) (?h . ?\266) (?i . ?\356)
147 (?j . ?\274) (?o . ?\364) (?s . ?\376) (?u . ?\373)
148 (?\ . ?^) (space . \^))
149 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322)
150 (?U . ?\331) (?a . ?\340) (?e . ?\350) (?i . ?\354)
151 (?o . ?\362) (?u . ?\371) (?\ . ?`) (space . ?`)))
152
153 ;;; Thanks to Tudor <tudor@cs.unh.edu> for some fixes and additions.
154 ("latin-2"
155 (?' (?A . ?\301) (?C . ?\306) (?D . ?\320) (?E . ?\311) (?I . ?\315)
156 (?L . ?\305) (?N . ?\321) (?O . ?\323) (?R . ?\300) (?S . ?\246)
157 (?U . ?\332) (?Y . ?\335) (?Z . ?\254) (?a . ?\341) (?c . ?\346)
158 (?d . ?\360) (?e . ?\351) (?i . ?\355) (?l . ?\345) (?n . ?\361)
159 (?o . ?\363) (?r . ?\340) (?s . ?\266) (?u . ?\372) (?y . ?\375)
160 (?z . ?\274) (?' . ?\264) (?\ . ?') (space . ?'))
161 (?` (?A . ?\241) (?C . ?\307) (?E . ?\312) (?L . ?\243) (?S . ?\252)
162 (?T . ?\336) (?Z . ?\257) (?a . ?\261) (?l . ?\263) (?c . ?\347)
163 (?e . ?\352) (?s . ?\272) (?t . ?\376) (?z . ?\277) (?` . ?\252)
164 (?. . ?\377) (?\ . ?`) (space . ?`))
165 (?^ (?A . ?\302) (?I . ?\316) (?O . ?\324)
166 (?a . ?\342) (?i . ?\356) (?o . ?\364)
167 (?^ . ?^) ; no special code?
168 (?\ . ?^) (space . ?^))
169 (?\" (?A . ?\304) (?E . ?\313) (?O . ?\326) (?U . ?\334) (?a . ?\344)
170 (?e . ?\353) (?o . ?\366) (?s . ?\337) (?u . ?\374) (?\" . ?\250)
171 (?\ . ?\") (space . ?\"))
172 (?\~ (?A . ?\303) (?C . ?\310) (?D . ?\317) (?L . ?\245) (?N . ?\322)
173 (?O . ?\325) (?R . ?\330) (?S . ?\251) (?T . ?\253) (?U . ?\333)
174 (?Z . ?\256) (?a . ?\343) (?c . ?\350) (?d . ?\357) (?l . ?\265)
175 (?n . ?\362) (?o . ?\365) (?r . ?\370) (?s . ?\271) (?t . ?\273)
176 (?u . ?\373) (?z . ?\276)
177 (?v . ?\242) ; v accent
178 (?\~ . ?\242) ; v accent
179 (?\. . ?\270) ; cedilla accent
180 (?\ . ?\~) (space . ?\~)))
181
182 ("latin-1" 177 ("latin-1"
183 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332) 178 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
184 (?Y . ?\335) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) 179 (?Y . ?\335) (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363)
185 (?u . ?\372) (?y . ?\375) (?' . ?\264) (?\ . ?') (space . ?')) 180 (?u . ?\372) (?y . ?\375) (?' . ?\264) (?\ . ?') (space . ?'))
186 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322) (?U . ?\331) 181 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322) (?U . ?\331)
190 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373) 185 (?a . ?\342) (?e . ?\352) (?i . ?\356) (?o . ?\364) (?u . ?\373)
191 (?^ . ?^) (?\ . ?^) (space . ?^)) 186 (?^ . ?^) (?\ . ?^) (space . ?^))
192 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326) (?U . ?\334) 187 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326) (?U . ?\334)
193 (?a . ?\344) (?e . ?\353) (?i . ?\357) (?o . ?\366) (?s . ?\337) 188 (?a . ?\344) (?e . ?\353) (?i . ?\357) (?o . ?\366) (?s . ?\337)
194 (?u . ?\374) (?y . ?\377) (?\" . ?\250) (?\ . ?\") (space . ?\")) 189 (?u . ?\374) (?y . ?\377) (?\" . ?\250) (?\ . ?\") (space . ?\"))
195 (?\~ (?A . ?\303) (?C . ?\307) (?D . ?\320) (?N . ?\321) (?O . ?\325) 190 (?~ (?A . ?\303) (?C . ?\307) (?D . ?\320) (?N . ?\321) (?O . ?\325)
196 (?T . ?\336) (?a . ?\343) (?c . ?\347) (?d . ?\360) (?n . ?\361) 191 (?T . ?\336) (?a . ?\343) (?c . ?\347) (?d . ?\360) (?n . ?\361)
197 (?o . ?\365) (?t . ?\376) (?> . ?\273) (?< . ?\253) (?\~ . ?\270) 192 (?o . ?\365) (?t . ?\376) (?> . ?\273) (?< . ?\253) (?~ . ?\270)
198 (?! . ?\241) (?? . ?\277) 193 (?! . ?\241) (?? . ?\277)
199 (?\ . ?\~) (space . ?\~)) 194 (?\ . ?~) (space . ?~))
200 (?\/ (?A . ?\305) (?E . ?\306) (?O . ?\330) (?a . ?\345) (?e . ?\346) 195 (?/ (?A . ?\305) (?E . ?\306) (?O . ?\330) (?a . ?\345) (?e . ?\346)
201 (?o . ?\370) (?\/ . ?\260) (?\ . ?\/) (space . ?\/)))) 196 (?o . ?\370) (?/ . ?\260) (?\ . ?/) (space . ?/)))
197
198 ("latin-2" latin-iso8859-2
199 (?' (?A . ?\301) (?C . ?\306) (?D . ?\320) (?E . ?\311) (?I . ?\315)
200 (?L . ?\305) (?N . ?\321) (?O . ?\323) (?R . ?\300) (?S . ?\246)
201 (?U . ?\332) (?Y . ?\335) (?Z . ?\254)
202 (?a . ?\341) (?c . ?\346) (?d . ?\360) (?e . ?\351) (?i . ?\355)
203 (?l . ?\345) (?n . ?\361) (?o . ?\363) (?r . ?\340) (?s . ?\266)
204 (?u . ?\372) (?y . ?\375) (?z . ?\274)
205 (?' . ?\264) (?\ . ?') (space . ?'))
206 (?` (?A . ?\241) (?C . ?\307) (?E . ?\312) (?L . ?\243) (?S . ?\252)
207 (?T . ?\336) (?Z . ?\257)
208 (?a . ?\261) (?l . ?\263) (?c . ?\347) (?e . ?\352) (?s . ?\272)
209 (?t . ?\376) (?z . ?\277)
210 (?` . ?\252)
211 (?. . ?\377) (?\ . ?`) (space . ?`))
212 (?^ (?A . ?\302) (?I . ?\316) (?O . ?\324)
213 (?a . ?\342) (?i . ?\356) (?o . ?\364)
214 (?^ . ?^) ; no special code?
215 (?\ . ?^) (space . ?^))
216 (?\" (?A . ?\304) (?E . ?\313) (?O . ?\326) (?U . ?\334)
217 (?a . ?\344) (?e . ?\353) (?o . ?\366) (?s . ?\337) (?u . ?\374)
218 (?\" . ?\250)
219 (?\ . ?\") (space . ?\"))
220 (?~ (?A . ?\303) (?C . ?\310) (?D . ?\317) (?L . ?\245) (?N . ?\322)
221 (?O . ?\325) (?R . ?\330) (?S . ?\251) (?T . ?\253) (?U . ?\333)
222 (?Z . ?\256)
223 (?a . ?\343) (?c . ?\350) (?d . ?\357) (?l . ?\265) (?n . ?\362)
224 (?o . ?\365) (?r . ?\370) (?s . ?\271) (?t . ?\273) (?u . ?\373)
225 (?z . ?\276)
226 (?v . ?\242) ; v accent
227 (?~ . ?\242) ; v accent
228 (?. . ?\270) ; cedilla accent
229 (?\ . ?~) (space . ?~)))
230
231 ("latin-3" latin-iso8859-3
232 (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332)
233 (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372)
234 (?' . ?\264) (?\ . ?') (space . ?'))
235 (?` (?A . ?\300) (?E . ?\310) (?I . ?\314) (?O . ?\322) (?U . ?\331)
236 (?a . ?\340) (?e . ?\350) (?i . ?\354) (?o . ?\362) (?u . ?\371)
237 (?` . ?`) (?\ . ?`) (space . ?`))
238 (?^ (?A . ?\302) (?C . ?\306) (?E . ?\312) (?G . ?\330)
239 (?H . ?\246) (?I . ?\316) (?J . ?\254) (?O . ?\324)
240 (?S . ?\336) (?U . ?\333)
241 (?a . ?\342) (?c . ?\346) (?e . ?\352) (?g . ?\370) (?h . ?\266)
242 (?i . ?\356) (?j . ?\274) (?o . ?\364) (?s . ?\376) (?u . ?\373)
243 (?^ . ?^) (?\ . ?^) (space . \^))
244 (?\" (?A . ?\304) (?E . ?\313) (?I . ?\317) (?O . ?\326) (?U . ?\334)
245 (?a . ?\344) (?e . ?\353) (?i . ?\357) (?o . ?\366) (?u . ?\374)
246 (?s . ?\337)
247 (?\" . ?\250) (?\ . ?\") (space . ?\"))
248 (?. (?C . ?\305) (?G . ?\325) (?I . ?\251) (?Z . ?\257)
249 (?c . ?\345) (?g . ?\365) (?z . ?\277))
250 (?~ (?A . ?\303) (?C . ?\307) (?D . ?\320) (?G . ?\253) (?N . ?\321)
251 (?O . ?\325) (?S . ?\252) (?U . ?\335)
252 (?a . ?\343) (?c . ?\347) (?d . ?\360) (?g . ?\273) (?n . ?\361)
253 (?o . ?\365) (?s . ?\252) (?u . ?\375)
254 (?h . ?\261) (?$ . ?\245) (?` . ?\242)
255 (?~ . ?\270) (?\ . ?~) (space . ?~))
256 (?/ (?C . ?\305) (?G . ?\325) (?H . ?\241) (?I . ?\251) (?Z . ?\257)
257 (?c . ?\345) (?g . ?\365) (?h . ?\261) (?i . ?\271) (?z . ?\277)
258 (?r . ?\256) (?. . ?\377) (?# . ?\243) (?$ . ?\244)
259 (?/ . ?\260) (?\ . ?/) (space . ?/)))
260 )
202 "List of language-specific customizations for the ISO Accents mode. 261 "List of language-specific customizations for the ISO Accents mode.
203 262
204 Each element of the list is of the form 263 Each element of the list is of the form
205 264
206 (LANGUAGE 265 (LANGUAGE [CHARSET]
207 (PSEUDO-ACCENT MAPPINGS) 266 (PSEUDO-ACCENT MAPPINGS)
208 (PSEUDO-ACCENT MAPPINGS) 267 (PSEUDO-ACCENT MAPPINGS)
209 ...) 268 ...)
210 269
211 LANGUAGE is a string naming the language. 270 LANGUAGE is a string naming the language.
271 CHARSET (which may be omitted) is the symbol name
272 of the character set used in this language.
273 If CHARSET is omitted, latin-iso8859-1 is the default.
212 PSEUDO-ACCENT is a char specifying an accent key. 274 PSEUDO-ACCENT is a char specifying an accent key.
213 MAPPINGS are cons cells of the form (CHAR . ISO-CHAR). 275 MAPPINGS are cons cells of the form (CHAR . ISO-CHAR).
214 276
215 The net effect is that the key sequence PSEUDO-ACCENT CHAR is mapped 277 The net effect is that the key sequence PSEUDO-ACCENT CHAR is mapped
216 to ISO-CHAR on input.") 278 to ISO-CHAR on input.")
266 (prog1 (iso-read-event) 328 (prog1 (iso-read-event)
267 (delete-region (1- (point)) (point))))) 329 (delete-region (1- (point)) (point)))))
268 (entry (cdr (assq second-char list)))) 330 (entry (cdr (assq second-char list))))
269 (if entry 331 (if entry
270 ;; Found it: return the mapped char 332 ;; Found it: return the mapped char
271 (vector (iso-char-to-event entry)) 333 (vector
334 (iso-char-to-event
335 (if (and (boundp 'enable-multibyte-characters)
336 enable-multibyte-characters
337 (>= entry ?\200))
338 (+ iso-accents-insert-offset entry)
339 entry)))
272 ;; Otherwise, advance and schedule the second key for execution. 340 ;; Otherwise, advance and schedule the second key for execution.
273 (setq unread-command-events (cons (iso-char-to-event second-char) 341 (setq unread-command-events (cons (iso-char-list-to-event
342 (list second-char))
274 unread-command-events)) 343 unread-command-events))
275 (vector (iso-char-to-event first-char))))) 344 (vector (iso-char-to-event first-char)))))
276 345
277 ;; It is a matter of taste if you want the minor mode indicated 346 ;; It is a matter of taste if you want the minor mode indicated
278 ;; in the mode line... 347 ;; in the mode line...
279 ;; If so, uncomment the next four lines. 348 ;; If so, uncomment the next four lines.
280 ;; (or (assq 'iso-accents-mode minor-mode-alist) 349 ;; (or (assq 'iso-accents-mode minor-mode-alist)
281 ;; (setq minor-mode-alist 350 ;; (setq minor-mode-alist
282 ;; (append minor-mode-alist 351 ;; (append minor-mode-alist
283 ;; '((iso-accents-mode " ISO-Acc"))))) 352 ;; '((iso-accents-mode " ISO-Acc")))))
284 353
285 ;;;###autoload 354 ;;;###autoload
286 (defun iso-accents-mode (&optional arg) 355 (defun iso-accents-mode (&optional arg)
287 "Toggle ISO Accents mode, in which accents modify the following letter. 356 "Toggle ISO Accents mode, in which accents modify the following letter.
288 This permits easy insertion of accented characters according to ISO-8859-1. 357 This permits easy insertion of accented characters according to ISO-8859-1.
321 (defun iso-accents-customize (language) 390 (defun iso-accents-customize (language)
322 "Customize the ISO accents machinery for a particular language. 391 "Customize the ISO accents machinery for a particular language.
323 It selects the customization based on the specifications in the 392 It selects the customization based on the specifications in the
324 `iso-languages' variable." 393 `iso-languages' variable."
325 (interactive (list (completing-read "Language: " iso-languages nil t))) 394 (interactive (list (completing-read "Language: " iso-languages nil t)))
326 (let ((table (assoc language iso-languages)) 395 (let ((table (cdr (assoc language iso-languages)))
327 tail) 396 tail)
328 (if (not table) 397 (if (not table)
329 (error "Unknown language '%s'" language) 398 (error "Unknown language `%s'" language)
399 (setq iso-accents-insert-offset (- (iso-make-char
400 (if (symbolp (car table))
401 (car table)
402 'latin-iso8859-1))
403 128))
404 (if (symbolp (car table))
405 (setq table (cdr table)))
330 (setq iso-language language 406 (setq iso-language language
331 iso-accents-list (cdr table)) 407 iso-accents-list table)
332 (if key-translation-map 408 (if key-translation-map
333 (substitute-key-definition 409 (substitute-key-definition
334 'iso-accents-accent-key nil key-translation-map) 410 'iso-accents-accent-key nil key-translation-map)
335 (setq key-translation-map (make-sparse-keymap))) 411 (setq key-translation-map (make-sparse-keymap)))
336 ;; Set up translations for all the characters that are used as 412 ;; Set up translations for all the characters that are used as
419 (setq iso-accents-mode 495 (setq iso-accents-mode
420 (save-excursion 496 (save-excursion
421 (set-buffer (window-buffer minibuffer-scroll-window)) 497 (set-buffer (window-buffer minibuffer-scroll-window))
422 iso-accents-mode))) 498 iso-accents-mode)))
423 499
424 (add-hook 'minibuf-setup-hook 'iso-acc-minibuf-setup) 500 (if (boundp 'minibuffer-setup-hook)
501 (add-hook 'minibuffer-setup-hook 'iso-acc-minibuf-setup)
502 (add-hook 'minibuf-setup-hook 'iso-acc-minibuf-setup))
425 503
426 ;;; iso-acc.el ends here 504 ;;; iso-acc.el ends here