annotate lisp/international/iso-acc.el @ 8475:77d5e055dce1

(PTY_TTY_NAME_SPRINTF): New definition. (sigsetmask): Add #undef. (SOLARIS2_4): Defined. Discard old contents of file. Instead, undef C_SWITCH_SYSTEM and const, so that we use GCC without -traditional. (HAVE_VFORK): Defined.
author Richard M. Stallman <rms@gnu.org>
date Sun, 07 Aug 1994 07:58:18 +0000
parents cc7cd83ccf3f
children ba689bf126fb
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
1 ;;; iso-acc.el -- minor mode providing electric accent keys
7300
cc7cd83ccf3f Update copyright.
Karl Heuer <kwzh@gnu.org>
parents: 6421
diff changeset
2 ;;; Copyright (C) 1993, 1994 Free Software Foundation, Inc.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
3
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
4 ;; Author: Johan Vromans <jv@mh.nl>
5040
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
5 ;; Version: 1.7 (modified)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
6 ;; Maintainer: FSF
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
7 ;; Keywords: i18n
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
8
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
9 ;; This file is part of GNU Emacs.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
11 ;; GNU Emacs is free software; you can redistribute it and/or modify
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; it under the terms of the GNU General Public License as published by
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13 ;; the Free Software Foundation; either version 2, or (at your option)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; any later version.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; GNU Emacs is distributed in the hope that it will be useful,
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; GNU General Public License for more details.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; You should have received a copy of the GNU General Public License
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22 ;; along with GNU Emacs; see the file COPYING. If not, write to
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
25 ;;; Commentary:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
26
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
27 ;; Function `iso-accents-mode' activates a minor mode
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
28 ;; (`iso-accents-minor-mode') in which typewriter "dead keys" are
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
29 ;; emulated. The purpose of this emulation is to provide a simple
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
30 ;; means for inserting accented characters according to the ISO-8859-1
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
31 ;; character set.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;; In `iso-accents-minor-mode', pseudo accent characters are used to
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; introduce accented keys. The pseudo-accent characterss are:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; ' (minute) -> grave accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; ` (backtick) -> acute accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;; " (second) -> diaeresis
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
39 ;; ^ (caret) -> circumflex
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
40 ;; ~ (tilde) -> tilde over the character
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
41 ;; / (slash) -> slash through the character.
5040
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
42 ;; Also: /A is A-with-ring and /E is AE ligature.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; The action taken depends on the key that follows the pseudo accent.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; In general:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
46 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
47 ;; pseudo-accent + appropriate letter -> accented letter
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; pseudo-accent + space -> pseudo-accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; pseudo-accent + pseudo-accent -> accent (if available)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
50 ;; pseudo-accent + other -> pseudo-accent + other
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
51 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
52 ;; If the pseudo-accent is followed by anything else than a
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53 ;; self-insert-command, the dead-key code is terminated, the
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;; pseudo-accent inserted 'as is' and the bell is rung to signal this.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55 ;;
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
56 ;; Function `iso-accents-mode' can be used to enable the iso accents
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
57 ;; minor mode, or disable it.
5101
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
58
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
59 ;; If you want only some of these characters to serve as accents,
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
60 ;; set iso-accents-enable to the list of characters that should be special.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ;;; Code:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 (provide 'iso-acc)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 (defvar iso-accents-list
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 '(((?' ?A) ?\301)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ((?' ?E) ?\311)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ((?' ?I) ?\315)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ((?' ?O) ?\323)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ((?' ?U) ?\332)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
72 ((?' ?Y) ?\335)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ((?' ?a) ?\341)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ((?' ?e) ?\351)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ((?' ?i) ?\355)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ((?' ?o) ?\363)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ((?' ?u) ?\372)
5059
44c915e72774 (iso-accents-list): Fix entries for 'y and ~c.
Richard M. Stallman <rms@gnu.org>
parents: 5040
diff changeset
78 ((?' ?y) ?\375)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ((?' ?') ?\264)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ((?' ? ) ?')
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ((?` ?A) ?\300)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ((?` ?E) ?\310)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ((?` ?I) ?\314)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ((?` ?O) ?\322)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ((?` ?U) ?\331)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ((?` ?a) ?\340)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ((?` ?e) ?\350)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ((?` ?i) ?\354)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ((?` ?o) ?\362)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ((?` ?u) ?\371)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ((?` ? ) ?`)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 ((?` ?`) ?`) ; no special code?
4922
60ef6d1946b0 (iso-accents-list): Fix typo in ^A code. Support ~< and ~>.
Richard M. Stallman <rms@gnu.org>
parents: 4921
diff changeset
93 ((?^ ?A) ?\302)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ((?^ ?E) ?\312)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 ((?^ ?I) ?\316)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ((?^ ?O) ?\324)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 ((?^ ?U) ?\333)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 ((?^ ?a) ?\342)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 ((?^ ?e) ?\352)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ((?^ ?i) ?\356)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 ((?^ ?o) ?\364)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ((?^ ?u) ?\373)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ((?^ ? ) ?^)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 ((?^ ?^) ?^) ; no special code?
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 ((?\" ?A) ?\304)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 ((?\" ?E) ?\313)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 ((?\" ?I) ?\317)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
108 ((?\" ?O) ?\326)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109 ((?\" ?U) ?\334)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
110 ((?\" ?a) ?\344)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
111 ((?\" ?e) ?\353)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 ((?\" ?i) ?\357)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113 ((?\" ?o) ?\366)
5060
0f70551a445a (iso-accents-list): Add "s.
Richard M. Stallman <rms@gnu.org>
parents: 5059
diff changeset
114 ((?\" ?s) ?\337)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 ((?\" ?u) ?\374)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
116 ((?\" ?y) ?\377)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ((?\" ? ) ?\")
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 ((?\" ?\") ?\250)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
119 ((?\~ ?A) ?\303)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
120 ((?\~ ?C) ?\307)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
121 ((?\~ ?D) ?\320)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
122 ((?\~ ?N) ?\321)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
123 ((?\~ ?O) ?\325)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
124 ((?\~ ?a) ?\343)
5059
44c915e72774 (iso-accents-list): Fix entries for 'y and ~c.
Richard M. Stallman <rms@gnu.org>
parents: 5040
diff changeset
125 ((?\~ ?c) ?\347)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
126 ((?\~ ?d) ?\360)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
127 ((?\~ ?n) ?\361)
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
128 ((?\~ ?o) ?\365)
4922
60ef6d1946b0 (iso-accents-list): Fix typo in ^A code. Support ~< and ~>.
Richard M. Stallman <rms@gnu.org>
parents: 4921
diff changeset
129 ((?\~ ?>) ?\273)
60ef6d1946b0 (iso-accents-list): Fix typo in ^A code. Support ~< and ~>.
Richard M. Stallman <rms@gnu.org>
parents: 4921
diff changeset
130 ((?\~ ?<) ?\253)
6421
db0bbe836298 (iso-accents-list): Add entries for unadorned accents.
Karl Heuer <kwzh@gnu.org>
parents: 5101
diff changeset
131 ((?\~ ?\ ) ?\~)
db0bbe836298 (iso-accents-list): Add entries for unadorned accents.
Karl Heuer <kwzh@gnu.org>
parents: 5101
diff changeset
132 ((?\~ ?\~) ?\270) ;; cedilla accent
5040
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
133 ((?\/ ?A) ?\305) ;; A-with-ring (Norwegian and Danish)
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
134 ((?\/ ?E) ?\306) ;; AE-ligature (Norwegian and Danish)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
135 ((?\/ ?O) ?\330)
5040
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
136 ((?\/ ?a) ?\345) ;; a-with-ring (Norwegian and Danish)
34ce5cc32eb8 (iso-accents-list): Added /A for A-with-ring
Richard M. Stallman <rms@gnu.org>
parents: 4924
diff changeset
137 ((?\/ ?e) ?\346) ;; ae-ligature (Norwegian and Danish)
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
138 ((?\/ ?o) ?\370)
6421
db0bbe836298 (iso-accents-list): Add entries for unadorned accents.
Karl Heuer <kwzh@gnu.org>
parents: 5101
diff changeset
139 ((?\/ ?\ ) ?\/)
db0bbe836298 (iso-accents-list): Add entries for unadorned accents.
Karl Heuer <kwzh@gnu.org>
parents: 5101
diff changeset
140 ((?\/ ?\/) ?\260) ;; ring accent (actually degree sign?)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
141 )
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
142 "Association list for ISO accent combinations.")
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
144 (defvar iso-accents-minor-mode nil
4924
fb527936ca61 (iso-accents-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4922
diff changeset
145 "*Non-nil enables ISO Accents mode.
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
146 Setting this variable makes it local to the current buffer.
4734
488d0b668380 Fix typo in previous change.
Richard M. Stallman <rms@gnu.org>
parents: 4733
diff changeset
147 See `iso-accents-mode'.")
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
148 (make-variable-buffer-local 'iso-accents-minor-mode)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
149
4877
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
150 (defun iso-accents-accent-key (prompt)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
151 "Modify the following character by adding an accent to it."
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
152 ;; Pick up the accent character.
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
153 (if iso-accents-minor-mode
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
154 (iso-accents-compose prompt)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
155 (char-to-string last-input-char)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
156
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
157 (defun iso-accents-compose-key (prompt)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
158 "Modify the following character by adding an accent to it."
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
159 ;; Pick up the accent character.
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
160 (let ((combined (iso-accents-compose prompt)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
161 (if unread-command-events
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
162 (let ((unread unread-command-events))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
163 (setq unread-command-events nil)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
164 (error "Characters %s and %s cannot be composed"
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
165 (single-key-description (aref combined 0))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
166 (single-key-description (car unread)))))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
167 combined))
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168
4877
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
169 (defun iso-accents-compose (prompt)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
170 (let* ((first-char last-input-char)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
171 ;; Wait for the second key and look up the combination.
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
172 (second-char (if (or prompt
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
173 (not (eq (key-binding "a")
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
174 'self-insert-command)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
175 (progn
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
176 (message "%s%c"
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
177 (or prompt "Compose with ")
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
178 first-char)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
179 (read-event))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
180 (insert first-char)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
181 (prog1 (read-event)
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
182 (delete-region (1- (point)) (point)))))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
183 (entry (assoc (list first-char second-char) iso-accents-list)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
184 (if entry
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
185 ;; Found it: delete the first character and insert the combination.
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
186 (concat (list (nth 1 entry)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
187 ;; Otherwise, advance and schedule the second key for execution.
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
188 (setq unread-command-events (list second-char))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
189 (vector first-char))))
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
190
5101
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
191 (defvar iso-accents-enable '(?' ?` ?^ ?\" ?~ ?/)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
192 "*List of accent keys that become prefixes in ISO Accents mode.
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
193 The default is (?' ?` ?^ ?\" ?~ ?/), which contains all the supported
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
194 accent keys. For certain languages, you might want to remove some of
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
195 those characters that are not actually used.")
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
196
4877
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
197 (or key-translation-map (setq key-translation-map (make-sparse-keymap)))
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
198 ;; For sequences starting with an accent character,
4c51d8a8b09f Define "dead keys" in key-translation-map, not in global-map.
Richard M. Stallman <rms@gnu.org>
parents: 4734
diff changeset
199 ;; use a function that tests iso-accents-minor-mode.
5101
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
200 (if (memq ?' iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
201 (define-key key-translation-map "'" 'iso-accents-accent-key))
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
202 (if (memq ?` iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
203 (define-key key-translation-map "`" 'iso-accents-accent-key))
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
204 (if (memq ?^ iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
205 (define-key key-translation-map "^" 'iso-accents-accent-key))
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
206 (if (memq ?\" iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
207 (define-key key-translation-map "\"" 'iso-accents-accent-key))
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
208 (if (memq ?~ iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
209 (define-key key-translation-map "~" 'iso-accents-accent-key))
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
210 (if (memq ?/ iso-accents-enable)
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
211 (define-key key-translation-map "/" 'iso-accents-accent-key))
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
212
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
213 ;; It is a matter of taste if you want the minor mode indicated
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
214 ;; in the mode line...
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
215 ;; If so, uncomment the next four lines.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
216 ;; (or (assq 'iso-accents-minor-mode minor-mode-map-alist)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
217 ;; (setq minor-mode-alist
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
218 ;; (append minor-mode-alist
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
219 ;; '((iso-accents-minor-mode " ISO-Acc")))))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
220
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
221 ;;;###autoload
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
222 (defun iso-accents-mode (&optional arg)
4924
fb527936ca61 (iso-accents-mode): Doc fix.
Richard M. Stallman <rms@gnu.org>
parents: 4922
diff changeset
223 "Toggle ISO Accents mode, in which accents modify the following letter.
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
224 This permits easy insertion of accented characters according to ISO-8859-1.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
225 When Iso-accents mode is enabled, accent character keys
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
226 \(`, ', \", ^, / and ~) do not self-insert; instead, they modify the following
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
227 letter key so that it inserts an ISO accented letter.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
228
5101
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
229 The variable `iso-accents-enable' specifies the list of characters to
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
230 enable as accents. If you don't need all of them, remove the ones you
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
231 don't need from that list.
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
232
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
233 Special combinations: ~c gives a c with cedilla,
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
234 ~d gives a d with dash.
5060
0f70551a445a (iso-accents-list): Add "s.
Richard M. Stallman <rms@gnu.org>
parents: 5059
diff changeset
235 \"s gives German sharp s.
0f70551a445a (iso-accents-list): Add "s.
Richard M. Stallman <rms@gnu.org>
parents: 5059
diff changeset
236 /a gives a with ring.
0f70551a445a (iso-accents-list): Add "s.
Richard M. Stallman <rms@gnu.org>
parents: 5059
diff changeset
237 /e gives an a-e ligature.
4922
60ef6d1946b0 (iso-accents-list): Fix typo in ^A code. Support ~< and ~>.
Richard M. Stallman <rms@gnu.org>
parents: 4921
diff changeset
238 ~< and ~> give guillemets.
4921
e96cc77d9a7c Support ~ and /. Support 'Y, 'y, "y.
Richard M. Stallman <rms@gnu.org>
parents: 4877
diff changeset
239
5101
c95efc1cf15b (iso-accents-enable): New variable.
Richard M. Stallman <rms@gnu.org>
parents: 5060
diff changeset
240 With an argument, a positive argument enables ISO Accents mode,
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
241 and a negative argument disables it."
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
242
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
243 (interactive "P")
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
244
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
245 (if (if arg
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
246 ;; Negative arg means switch it off.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
247 (<= (prefix-numeric-value arg) 0)
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
248 ;; No arg means toggle.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
249 iso-accents-minor-mode)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
250 (setq iso-accents-minor-mode nil)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
251
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
252 ;; Enable electric accents.
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
253 (setq iso-accents-minor-mode t)))
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
254
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
255 ;;; iso-acc.el ends here