diff options
| author | Richard M. Stallman | 1997-05-10 01:43:18 +0000 |
|---|---|---|
| committer | Richard M. Stallman | 1997-05-10 01:43:18 +0000 |
| commit | 6ccc68a265a23bf428ac4cb95eafbf1fcdedee01 (patch) | |
| tree | 4dd84b96ce6b40ce2085b077394ebe0a3ce26a0d | |
| parent | b3e78233cd5edce59105239de75d9df8f28afde7 (diff) | |
| download | emacs-6ccc68a265a23bf428ac4cb95eafbf1fcdedee01.tar.gz emacs-6ccc68a265a23bf428ac4cb95eafbf1fcdedee01.zip | |
(iso-languages): Add charset spec to some elements.
(iso-accents-compose): Add iso-accents-insert-offset to the code.
(iso-accents-insert-offset): New variable.
(iso-accents-customize): Set iso-accents-insert-offset
according to data from iso-languages.
| -rw-r--r-- | lisp/international/iso-acc.el | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/lisp/international/iso-acc.el b/lisp/international/iso-acc.el index 6d484b39c20..20faafdc4bf 100644 --- a/lisp/international/iso-acc.el +++ b/lisp/international/iso-acc.el | |||
| @@ -64,6 +64,9 @@ | |||
| 64 | 64 | ||
| 65 | (provide 'iso-acc) | 65 | (provide 'iso-acc) |
| 66 | 66 | ||
| 67 | (defvar iso-accents-insert-offset quoted-insert-character-offset | ||
| 68 | "*Offset added by ISO Accents mode to character codes 0200 and above.") | ||
| 69 | |||
| 67 | (defvar iso-languages | 70 | (defvar iso-languages |
| 68 | '(("catalan" | 71 | '(("catalan" |
| 69 | ;; Note this includes some extra characters used in Spanish, | 72 | ;; Note this includes some extra characters used in Spanish, |
| @@ -126,7 +129,7 @@ | |||
| 126 | (?\/ (?A . ?\305) (?E . ?\306) (?O . ?\330) (?a . ?\345) (?e . ?\346) | 129 | (?\/ (?A . ?\305) (?E . ?\306) (?O . ?\330) (?a . ?\345) (?e . ?\346) |
| 127 | (?o . ?\370) (?\/ . ?\260) (?\ . ?\/))) | 130 | (?o . ?\370) (?\/ . ?\260) (?\ . ?\/))) |
| 128 | 131 | ||
| 129 | ("latin-2" | 132 | ("latin-2" latin-iso8859-2 |
| 130 | (?' (?A . ?\301) (?C . ?\306) (?D . ?\320) (?E . ?\311) (?I . ?\315) | 133 | (?' (?A . ?\301) (?C . ?\306) (?D . ?\320) (?E . ?\311) (?I . ?\315) |
| 131 | (?L . ?\305) (?N . ?\321) (?O . ?\323) (?R . ?\300) (?S . ?\246) | 134 | (?L . ?\305) (?N . ?\321) (?O . ?\323) (?R . ?\300) (?S . ?\246) |
| 132 | (?U . ?\332) (?Y . ?\335) (?Z . ?\254) (?a . ?\341) (?c . ?\346) | 135 | (?U . ?\332) (?Y . ?\335) (?Z . ?\254) (?a . ?\341) (?c . ?\346) |
| @@ -153,7 +156,7 @@ | |||
| 153 | (?\. . ?\270) ; cedilla accent | 156 | (?\. . ?\270) ; cedilla accent |
| 154 | (?\ . ?\~))) | 157 | (?\ . ?\~))) |
| 155 | 158 | ||
| 156 | ("latin-3" | 159 | ("latin-3" latin-iso8859-3 |
| 157 | (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332) | 160 | (?' (?A . ?\301) (?E . ?\311) (?I . ?\315) (?O . ?\323) (?U . ?\332) |
| 158 | (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372) | 161 | (?a . ?\341) (?e . ?\351) (?i . ?\355) (?o . ?\363) (?u . ?\372) |
| 159 | (?' . ?\264) (?\ . ?')) | 162 | (?' . ?\264) (?\ . ?')) |
| @@ -198,12 +201,15 @@ | |||
| 198 | 201 | ||
| 199 | Each element of the list is of the form | 202 | Each element of the list is of the form |
| 200 | 203 | ||
| 201 | (LANGUAGE | 204 | (LANGUAGE [CHARSET] |
| 202 | (PSEUDO-ACCENT MAPPINGS) | 205 | (PSEUDO-ACCENT MAPPINGS) |
| 203 | (PSEUDO-ACCENT MAPPINGS) | 206 | (PSEUDO-ACCENT MAPPINGS) |
| 204 | ...) | 207 | ...) |
| 205 | 208 | ||
| 206 | LANGUAGE is a string naming the language. | 209 | LANGUAGE is a string naming the language. |
| 210 | CHARSET (which may be omitted) is the symbol name | ||
| 211 | of the character set used in this language. | ||
| 212 | If CHARSET is omitted, latin-iso8859-1 is the default. | ||
| 207 | PSEUDO-ACCENT is a char specifying an accent key. | 213 | PSEUDO-ACCENT is a char specifying an accent key. |
| 208 | MAPPINGS are cons cells of the form (CHAR . ISO-CHAR). | 214 | MAPPINGS are cons cells of the form (CHAR . ISO-CHAR). |
| 209 | 215 | ||
| @@ -263,7 +269,13 @@ the language you choose).") | |||
| 263 | (entry (cdr (assq second-char list)))) | 269 | (entry (cdr (assq second-char list)))) |
| 264 | (if entry | 270 | (if entry |
| 265 | ;; Found it: return the mapped char | 271 | ;; Found it: return the mapped char |
| 266 | (vector entry) | 272 | (if (and enable-multibyte-characters |
| 273 | (>= entry ?\200)) | ||
| 274 | (let ((char (+ iso-accents-insert-offset entry))) | ||
| 275 | (setq unread-command-events | ||
| 276 | (cons (list char) unread-command-events)) | ||
| 277 | (vector ?\C-q)) | ||
| 278 | (vector entry)) | ||
| 267 | ;; Otherwise, advance and schedule the second key for execution. | 279 | ;; Otherwise, advance and schedule the second key for execution. |
| 268 | (setq unread-command-events | 280 | (setq unread-command-events |
| 269 | (cons (list second-char) unread-command-events)) | 281 | (cons (list second-char) unread-command-events)) |
| @@ -318,12 +330,18 @@ and a negative argument disables it." | |||
| 318 | It selects the customization based on the specifications in the | 330 | It selects the customization based on the specifications in the |
| 319 | `iso-languages' variable." | 331 | `iso-languages' variable." |
| 320 | (interactive (list (completing-read "Language: " iso-languages nil t))) | 332 | (interactive (list (completing-read "Language: " iso-languages nil t))) |
| 321 | (let ((table (assoc language iso-languages)) | 333 | (let ((table (cdr (assoc language iso-languages))) |
| 322 | all-accents tail) | 334 | all-accents tail) |
| 323 | (if (not table) | 335 | (if (not table) |
| 324 | (error "Unknown language '%s'" language) | 336 | (error "Unknown language `%s'" language) |
| 337 | (setq iso-accents-insert-offset (- (make-char (if (symbolp (car table)) | ||
| 338 | (car table) | ||
| 339 | 'latin-iso8859-1)) | ||
| 340 | 128)) | ||
| 341 | (if (symbolp (car table)) | ||
| 342 | (setq table (cdr table))) | ||
| 325 | (setq iso-language language | 343 | (setq iso-language language |
| 326 | iso-accents-list (cdr table)) | 344 | iso-accents-list table) |
| 327 | (if key-translation-map | 345 | (if key-translation-map |
| 328 | (substitute-key-definition | 346 | (substitute-key-definition |
| 329 | 'iso-accents-accent-key nil key-translation-map) | 347 | 'iso-accents-accent-key nil key-translation-map) |