annotate lisp/international/iso-acc.el @ 4743:f05c414fe229

Add #undef HAVE_RES_INIT.
author Richard M. Stallman <rms@gnu.org>
date Sun, 19 Sep 1993 19:28:39 +0000
parents 488d0b668380
children 4c51d8a8b09f
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
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
2 ;;; Copyright (C) 1993 Free Software Foundation, Inc.
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>
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
5 ;; Version: 1.7
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
6
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
7 ;; This file is part of GNU Emacs.
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 ;; GNU Emacs is free software; you can redistribute it and/or modify
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
10 ;; 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
11 ;; the Free Software Foundation; either version 2, or (at your option)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
12 ;; any later version.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
13
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
14 ;; GNU Emacs is distributed in the hope that it will be useful,
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
15 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
16 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
17 ;; GNU General Public License for more details.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
18
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
19 ;; You should have received a copy of the GNU General Public License
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
20 ;; along with GNU Emacs; see the file COPYING. If not, write to
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
21 ;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
22
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
23 ;;; Commentary:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
24
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
25 ;; 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
26 ;; (`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
27 ;; 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
28 ;; 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
29 ;; character set.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
30 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
31 ;; In `iso-accents-minor-mode', pseudo accent characters are used to
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
32 ;; introduce accented keys. The pseudo-accent characterss are:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
33 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
34 ;; ' (minute) -> grave accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
35 ;; ` (backtick) -> acute accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
36 ;; " (second) -> diaeresis
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
37 ;; ^ (caret) -> circonflexe
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
38 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
39 ;; The action taken depends on the key that follows the pseudo accent.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
40 ;; In general:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
41 ;;
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
42 ;; pseudo-accent + appropriate letter -> accented letter
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
43 ;; pseudo-accent + space -> pseudo-accent
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
44 ;; pseudo-accent + pseudo-accent -> accent (if available)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
45 ;; pseudo-accent + other -> pseudo-accent + other
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 ;; If the pseudo-accent is followed by anything else than a
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
48 ;; self-insert-command, the dead-key code is terminated, the
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
49 ;; 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
50 ;;
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
51 ;; 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
52 ;; minor mode, or disable it.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
53
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
54 ;;; Code:
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
55
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
56 (provide 'iso-acc)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
57
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
58 (defvar iso-accents-list
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
59 '(((?' ?A) ?\301)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
60 ((?' ?E) ?\311)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
61 ((?' ?I) ?\315)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
62 ((?' ?O) ?\323)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
63 ((?' ?U) ?\332)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
64 ((?' ?a) ?\341)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
65 ((?' ?e) ?\351)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
66 ((?' ?i) ?\355)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
67 ((?' ?o) ?\363)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
68 ((?' ?u) ?\372)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
69 ((?' ?') ?\264)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
70 ((?' ? ) ?')
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
71 ((?` ?A) ?\300)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
72 ((?` ?E) ?\310)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
73 ((?` ?I) ?\314)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
74 ((?` ?O) ?\322)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
75 ((?` ?U) ?\331)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
76 ((?` ?a) ?\340)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
77 ((?` ?e) ?\350)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
78 ((?` ?i) ?\354)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
79 ((?` ?o) ?\362)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
80 ((?` ?u) ?\371)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
81 ((?` ? ) ?`)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
82 ((?` ?`) ?`) ; no special code?
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
83 ((?` ?A) ?\302)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
84 ((?^ ?E) ?\312)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
85 ((?^ ?I) ?\316)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
86 ((?^ ?O) ?\324)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
87 ((?^ ?U) ?\333)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
88 ((?^ ?a) ?\342)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
89 ((?^ ?e) ?\352)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
90 ((?^ ?i) ?\356)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
91 ((?^ ?o) ?\364)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
92 ((?^ ?u) ?\373)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
93 ((?^ ? ) ?^)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
94 ((?^ ?^) ?^) ; no special code?
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
95 ((?\" ?A) ?\304)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
96 ((?\" ?E) ?\313)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
97 ((?\" ?I) ?\317)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
98 ((?\" ?O) ?\326)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
99 ((?\" ?U) ?\334)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
100 ((?\" ?a) ?\344)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
101 ((?\" ?e) ?\353)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
102 ((?\" ?i) ?\357)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
103 ((?\" ?o) ?\366)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
104 ((?\" ?u) ?\374)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
105 ((?\" ? ) ?\")
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
106 ((?\" ?\") ?\250)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
107 )
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
108 "Association list for ISO accent combinations.")
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
109
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
110 (defun iso-accents-accent-key ()
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
111 "Modify the following character by adding an accent to it."
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
112 (interactive)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
113
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
114 ;; Pick up the accent character.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
115 (let ((first-char last-command-char))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
116
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
117 ;; Display it and backup.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
118 (insert first-char)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
119 (backward-char 1)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
120
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
121 ;; Wait for the second key and look up the combination in the list.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
122 (let* ((second-char (read-event))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
123 (entry (assoc (list first-char second-char) iso-accents-list)))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
124 (if entry
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
125 ;; Found it: delete the first character and insert the combination.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
126 (progn
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
127 (delete-char 1)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
128 (insert (car (cdr entry))))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
129
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
130 ;; Otherwise, advance and schedule the second key for execution.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
131 (forward-char 1)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
132 (setq unread-command-events (list second-char))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
133
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
134 ;; If it is not a self-insert-command, ring the terminal bell.
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
135 (or (eq (key-binding (make-vector 1 second-char)) 'self-insert-command)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
136 (beep 1))))))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
137
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
138 (defvar iso-accents-minor-mode nil
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
139 "*Non-nil enables ISO-accents mode.
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
140 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
141 See `iso-accents-mode'.")
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
142 (make-variable-buffer-local 'iso-accents-minor-mode)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
143
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
144 ;; A minor mode map `iso-accents-prefix-map' is used to activate the
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
145 ;; dead key handling depending on the value of iso-accents-minor-mode.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
146 (defvar iso-accents-prefix-map nil
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
147 "Keymap for ISO-accents minor mode.")
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
148
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
149 ;; Create the minor-mode keymap, if needed.
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
150 (or iso-accents-prefix-map
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
151 (progn
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
152 (setq iso-accents-prefix-map (make-sparse-keymap))
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
153 (define-key iso-accents-prefix-map "'" 'iso-accents-dead-key)
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
154 (define-key iso-accents-prefix-map "`" 'iso-accents-dead-key)
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
155 (define-key iso-accents-prefix-map "^" 'iso-accents-dead-key)
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
156 (define-key iso-accents-prefix-map "\"" 'iso-accents-dead-key)))
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
157
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
158 ;; Add the dead key minor mode map to the minor mode maps.
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
159 (or (assq 'iso-accents-minor-mode minor-mode-map-alist)
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
160 (setq minor-mode-map-alist
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
161 (cons (cons 'iso-accents-minor-mode iso-accents-prefix-map)
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
162 minor-mode-map-alist)))
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
163
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
164 ;; 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
165 ;; in the mode line...
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
166 ;; If so, uncomment the next four lines.
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
167 ;; (or (assq 'iso-accents-minor-mode minor-mode-map-alist)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
168 ;; (setq minor-mode-alist
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
169 ;; (append minor-mode-alist
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
170 ;; '((iso-accents-minor-mode " ISO-Acc")))))
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
171
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
172 ;;;###autoload
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
173 (defun iso-accents-mode (&optional arg)
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
174 "Toggle a minor 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
175 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
176 When Iso-accents mode is enabled, accent character keys
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
177 \(', \", ^ and ~) do not self-insert; instead, they modify the following
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
178 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
179
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
180 With an argument, a positive argument enables ISO-accents mode,
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
181 and a negative argument disables it."
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
182
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
183 (interactive "P")
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
184
4721
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
185 (if (if arg
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
186 ;; Negative arg means switch it off.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
187 (<= (prefix-numeric-value arg) 0)
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
188 ;; No arg means toggle.
d34c02ddea9f Fix lots of doc strings.
Richard M. Stallman <rms@gnu.org>
parents: 4720
diff changeset
189 iso-accents-minor-mode)
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
190 (setq iso-accents-minor-mode nil)
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
191
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
192 ;; Enable electric accents.
4733
4d378f483cf4 Set up keymap at load time.
Richard M. Stallman <rms@gnu.org>
parents: 4721
diff changeset
193 (setq iso-accents-minor-mode t)))
4720
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
194
797fe2b66800 Initial revision
Richard M. Stallman <rms@gnu.org>
parents:
diff changeset
195 ;;; iso-acc.el ends here