Mercurial > emacs
annotate lisp/international/iso-cvt.el @ 22966:77b190eb087b
(next-error): Doc fix.
(grep): Doc fix.
author | Richard M. Stallman <rms@gnu.org> |
---|---|
date | Sun, 09 Aug 1998 06:31:29 +0000 |
parents | d70738580fb4 |
children | aaa13b7caa88 |
rev | line source |
---|---|
18228 | 1 ;;; iso-cvt.-el -- translate ISO 8859-1 from/to various encodings |
13337 | 2 ;; This file was formerly called gm-lingo.el. |
3 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
4 ;; Copyright (C) 1993, 1994, 1995, 1996, 1998 Free Software Foundation, Inc. |
7260 | 5 |
6 ;; Author: Michael Gschwind <mike@vlsivie.tuwien.ac.at> | |
7 ;; Keywords: tex, iso, latin, i18n | |
8 | |
9 ;; This file is part of GNU Emacs. | |
10 | |
11 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
12 ;; it under the terms of the GNU General Public License as published by | |
13 ;; the Free Software Foundation; either version 2, or (at your option) | |
14 ;; any later version. | |
15 | |
16 ;; GNU Emacs is distributed in the hope that it will be useful, | |
17 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
18 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
19 ;; GNU General Public License for more details. | |
20 | |
21 ;; You should have received a copy of the GNU General Public License | |
14169 | 22 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
23 ;; Free Software Foundation, Inc., 59 Temple Place - Suite 330, | |
24 ;; Boston, MA 02111-1307, USA. | |
7260 | 25 |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
26 ;;; Commentary: |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
27 ;; This lisp code is a general framework for translating various |
18228 | 28 ;; representations of the same data. |
29 ;; among other things it can be used to translate TeX, HTML, and compressed | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
30 ;; files to ISO 8859-1. It can also be used to translate different charsets |
18228 | 31 ;; such as IBM PC, Macintosh or HP Roman8. |
32 ;; Note that many translations use the GNU recode tool to do the actual | |
33 ;; conversion. So you might want to install that tool to get the full | |
34 ;; benefit of iso-cvt.el | |
35 ; | |
7425
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
36 |
18228 | 37 ; TO DO: |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
38 ; Cover more cases for translation (There is an infinite number of ways to |
18228 | 39 ; represent accented characters in TeX) |
7260 | 40 |
18228 | 41 ;; SEE ALSO: |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
42 ; If you are interested in questions related to using the ISO 8859-1 |
18228 | 43 ; characters set (configuring emacs, Unix, etc. to use ISO), then you |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
44 ; can get the ISO 8859-1 FAQ via anonymous ftp from |
18228 | 45 ; ftp.vlsivie.tuwien.ac.at in /pub/bit/FAQ-ISO-8859-1 |
7260 | 46 |
47 ;;; Code: | |
48 | |
49 (provide 'iso-cvt) | |
18228 | 50 (require 'format) |
7260 | 51 |
52 (defvar iso-spanish-trans-tab | |
53 '( | |
54 ("~n" "ñ") | |
55 ("\([a-zA-Z]\)#" "\\1ñ") | |
56 ("~N" "Ñ") | |
57 ("\\([-a-zA-Z\"`]\\)\"u" "\\1ü") | |
58 ("\\([-a-zA-Z\"`]\\)\"U" "\\1Ü") | |
59 ("\\([-a-zA-Z]\\)'o" "\\1ó") | |
60 ("\\([-a-zA-Z]\\)'O" "\\Ó") | |
61 ("\\([-a-zA-Z]\\)'e" "\\1é") | |
62 ("\\([-a-zA-Z]\\)'E" "\\1É") | |
63 ("\\([-a-zA-Z]\\)'a" "\\1á") | |
64 ("\\([-a-zA-Z]\\)'A" "\\1A") | |
65 ("\\([-a-zA-Z]\\)'i" "\\1í") | |
66 ("\\([-a-zA-Z]\\)'I" "\\1Í") | |
67 ) | |
68 "Spanish translation table.") | |
69 | |
18228 | 70 (defun iso-translate-conventions (from to trans-tab) |
7850
b6f3dd2511bc
(iso-translate-conventions): Get rid of interactive spec.
Richard M. Stallman <rms@gnu.org>
parents:
7831
diff
changeset
|
71 "Use the translation table TRANS-TAB to translate the current buffer." |
7260 | 72 (save-excursion |
18228 | 73 (save-restriction |
74 (narrow-to-region from to) | |
75 (goto-char from) | |
76 (let ((work-tab trans-tab) | |
77 (buffer-read-only nil) | |
78 (case-fold-search nil)) | |
79 (while work-tab | |
80 (save-excursion | |
81 (let ((trans-this (car work-tab))) | |
82 (while (re-search-forward (car trans-this) nil t) | |
83 (replace-match (car (cdr trans-this)) t nil))) | |
84 (setq work-tab (cdr work-tab))))) | |
85 (point-max)))) | |
7260 | 86 |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
87 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
88 (defun iso-spanish (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
89 "Translate net conventions for Spanish to ISO 8859-1. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
90 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
91 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
92 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
93 (interactive "*r") |
18228 | 94 (iso-translate-conventions from to iso-spanish-trans-tab)) |
7260 | 95 |
96 (defvar iso-aggressive-german-trans-tab | |
97 '( | |
98 ("\"a" "ä") | |
99 ("\"A" "Ä") | |
100 ("\"o" "ö") | |
101 ("\"O" "Ö") | |
102 ("\"u" "ü") | |
103 ("\"U" "Ü") | |
104 ("\"s" "ß") | |
105 ("\\\\3" "ß") | |
106 ) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
107 "German translation table. |
10434
5cb0747f521f
(iso-aggressive-german-trans-tab): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
10081
diff
changeset
|
108 This table uses an aggressive translation approach and may erroneously |
5cb0747f521f
(iso-aggressive-german-trans-tab): Doc fix.
Karl Heuer <kwzh@gnu.org>
parents:
10081
diff
changeset
|
109 translate too much.") |
7260 | 110 |
111 (defvar iso-conservative-german-trans-tab | |
112 '( | |
113 ("\\([-a-zA-Z\"`]\\)\"a" "\\1ä") | |
114 ("\\([-a-zA-Z\"`]\\)\"A" "\\1Ä") | |
115 ("\\([-a-zA-Z\"`]\\)\"o" "\\1ö") | |
116 ("\\([-a-zA-Z\"`]\\)\"O" "\\1Ö") | |
117 ("\\([-a-zA-Z\"`]\\)\"u" "\\1ü") | |
118 ("\\([-a-zA-Z\"`]\\)\"U" "\\1Ü") | |
119 ("\\([-a-zA-Z\"`]\\)\"s" "\\1ß") | |
120 ("\\([-a-zA-Z\"`]\\)\\\\3" "\\1ß") | |
121 ) | |
122 "German translation table. | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
123 This table uses a conservative translation approach and may translate too |
7260 | 124 little.") |
125 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
126 (defvar iso-german-trans-tab iso-aggressive-german-trans-tab |
7260 | 127 "Currently active translation table for German.") |
128 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
129 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
130 (defun iso-german (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
131 "Translate net conventions for German to ISO 8859-1. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
132 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
133 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
134 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
135 (interactive "*r") |
18228 | 136 (iso-translate-conventions from to iso-german-trans-tab)) |
7260 | 137 |
138 (defvar iso-iso2tex-trans-tab | |
139 '( | |
140 ("ä" "{\\\\\"a}") | |
141 ("à" "{\\\\`a}") | |
142 ("á" "{\\\\'a}") | |
143 ("ã" "{\\\\~a}") | |
144 ("â" "{\\\\^a}") | |
145 ("ë" "{\\\\\"e}") | |
146 ("è" "{\\\\`e}") | |
147 ("é" "{\\\\'e}") | |
148 ("ê" "{\\\\^e}") | |
149 ("ï" "{\\\\\"\\\\i}") | |
150 ("ì" "{\\\\`\\\\i}") | |
151 ("í" "{\\\\'\\\\i}") | |
152 ("î" "{\\\\^\\\\i}") | |
153 ("ö" "{\\\\\"o}") | |
154 ("ò" "{\\\\`o}") | |
155 ("ó" "{\\\\'o}") | |
156 ("õ" "{\\\\~o}") | |
157 ("ô" "{\\\\^o}") | |
158 ("ü" "{\\\\\"u}") | |
159 ("ù" "{\\\\`u}") | |
160 ("ú" "{\\\\'u}") | |
161 ("û" "{\\\\^u}") | |
162 ("Ä" "{\\\\\"A}") | |
163 ("À" "{\\\\`A}") | |
164 ("Á" "{\\\\'A}") | |
165 ("Ã" "{\\\\~A}") | |
166 ("Â" "{\\\\^A}") | |
167 ("Ë" "{\\\\\"E}") | |
168 ("È" "{\\\\`E}") | |
169 ("É" "{\\\\'E}") | |
170 ("Ê" "{\\\\^E}") | |
171 ("Ï" "{\\\\\"I}") | |
172 ("Ì" "{\\\\`I}") | |
173 ("Í" "{\\\\'I}") | |
174 ("Î" "{\\\\^I}") | |
175 ("Ö" "{\\\\\"O}") | |
176 ("Ò" "{\\\\`O}") | |
177 ("Ó" "{\\\\'O}") | |
178 ("Õ" "{\\\\~O}") | |
179 ("Ô" "{\\\\^O}") | |
180 ("Ü" "{\\\\\"U}") | |
181 ("Ù" "{\\\\`U}") | |
182 ("Ú" "{\\\\'U}") | |
183 ("Û" "{\\\\^U}") | |
184 ("ñ" "{\\\\~n}") | |
185 ("Ñ" "{\\\\~N}") | |
186 ("ç" "{\\\\c c}") | |
187 ("Ç" "{\\\\c C}") | |
188 ("ß" "{\\\\ss}") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
189 ("\306" "{\\\\AE}") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
190 ("\346" "{\\\\ae}") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
191 ("\305" "{\\\\AA}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
192 ("\345" "{\\\\aa}") |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
193 ("\251" "{\\\\copyright}") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
194 ("£" "{\\\\pounds}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
195 ("¶" "{\\\\P}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
196 ("§" "{\\\\S}") |
7260 | 197 ("¿" "{?`}") |
198 ("¡" "{!`}") | |
199 ) | |
200 "Translation table for translating ISO 8859-1 characters to TeX sequences.") | |
201 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
202 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
203 (defun iso-iso2tex (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
204 "Translate ISO 8859-1 characters to TeX sequences. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
205 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
206 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
207 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
208 (interactive "*r") |
18228 | 209 (iso-translate-conventions from to iso-iso2tex-trans-tab)) |
7260 | 210 |
211 (defvar iso-tex2iso-trans-tab | |
212 '( | |
213 ("{\\\\\"a}" "ä") | |
214 ("{\\\\`a}" "à") | |
215 ("{\\\\'a}" "á") | |
216 ("{\\\\~a}" "ã") | |
217 ("{\\\\^a}" "â") | |
218 ("{\\\\\"e}" "ë") | |
219 ("{\\\\`e}" "è") | |
220 ("{\\\\'e}" "é") | |
221 ("{\\\\^e}" "ê") | |
222 ("{\\\\\"\\\\i}" "ï") | |
223 ("{\\\\`\\\\i}" "ì") | |
224 ("{\\\\'\\\\i}" "í") | |
225 ("{\\\\^\\\\i}" "î") | |
226 ("{\\\\\"i}" "ï") | |
227 ("{\\\\`i}" "ì") | |
228 ("{\\\\'i}" "í") | |
229 ("{\\\\^i}" "î") | |
230 ("{\\\\\"o}" "ö") | |
231 ("{\\\\`o}" "ò") | |
232 ("{\\\\'o}" "ó") | |
233 ("{\\\\~o}" "õ") | |
234 ("{\\\\^o}" "ô") | |
235 ("{\\\\\"u}" "ü") | |
236 ("{\\\\`u}" "ù") | |
237 ("{\\\\'u}" "ú") | |
238 ("{\\\\^u}" "û") | |
239 ("{\\\\\"A}" "Ä") | |
240 ("{\\\\`A}" "À") | |
241 ("{\\\\'A}" "Á") | |
242 ("{\\\\~A}" "Ã") | |
243 ("{\\\\^A}" "Â") | |
244 ("{\\\\\"E}" "Ë") | |
245 ("{\\\\`E}" "È") | |
246 ("{\\\\'E}" "É") | |
247 ("{\\\\^E}" "Ê") | |
248 ("{\\\\\"I}" "Ï") | |
249 ("{\\\\`I}" "Ì") | |
250 ("{\\\\'I}" "Í") | |
251 ("{\\\\^I}" "Î") | |
252 ("{\\\\\"O}" "Ö") | |
253 ("{\\\\`O}" "Ò") | |
254 ("{\\\\'O}" "Ó") | |
255 ("{\\\\~O}" "Õ") | |
256 ("{\\\\^O}" "Ô") | |
257 ("{\\\\\"U}" "Ü") | |
258 ("{\\\\`U}" "Ù") | |
259 ("{\\\\'U}" "Ú") | |
260 ("{\\\\^U}" "Û") | |
261 ("{\\\\~n}" "ñ") | |
262 ("{\\\\~N}" "Ñ") | |
263 ("{\\\\c c}" "ç") | |
264 ("{\\\\c C}" "Ç") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
265 ("\\\\\"a" "ä") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
266 ("\\\\`a" "à") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
267 ("\\\\'a" "á") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
268 ("\\\\~a" "ã") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
269 ("\\\\^a" "â") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
270 ("\\\\\"e" "ë") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
271 ("\\\\`e" "è") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
272 ("\\\\'e" "é") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
273 ("\\\\^e" "ê") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
274 ("\\\\\"\\\\i" "ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
275 ("\\\\`\\\\i" "ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
276 ("\\\\'\\\\i" "í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
277 ("\\\\^\\\\i" "î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
278 ("\\\\\"i" "ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
279 ("\\\\`i" "ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
280 ("\\\\'i" "í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
281 ("\\\\^i" "î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
282 ("\\\\\"o" "ö") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
283 ("\\\\`o" "ò") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
284 ("\\\\'o" "ó") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
285 ("\\\\~o" "õ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
286 ("\\\\^o" "ô") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
287 ("\\\\\"u" "ü") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
288 ("\\\\`u" "ù") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
289 ("\\\\'u" "ú") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
290 ("\\\\^u" "û") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
291 ("\\\\\"A" "Ä") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
292 ("\\\\`A" "À") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
293 ("\\\\'A" "Á") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
294 ("\\\\~A" "Ã") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
295 ("\\\\^A" "Â") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
296 ("\\\\\"E" "Ë") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
297 ("\\\\`E" "È") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
298 ("\\\\'E" "É") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
299 ("\\\\^E" "Ê") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
300 ("\\\\\"I" "Ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
301 ("\\\\`I" "Ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
302 ("\\\\'I" "Í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
303 ("\\\\^I" "Î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
304 ("\\\\\"O" "Ö") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
305 ("\\\\`O" "Ò") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
306 ("\\\\'O" "Ó") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
307 ("\\\\~O" "Õ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
308 ("\\\\^O" "Ô") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
309 ("\\\\\"U" "Ü") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
310 ("\\\\`U" "Ù") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
311 ("\\\\'U" "Ú") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
312 ("\\\\^U" "Û") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
313 ("\\\\~n" "ñ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
314 ("\\\\~N" "Ñ") |
7260 | 315 ("\\\\\"{a}" "ä") |
316 ("\\\\`{a}" "à") | |
317 ("\\\\'{a}" "á") | |
318 ("\\\\~{a}" "ã") | |
319 ("\\\\^{a}" "â") | |
320 ("\\\\\"{e}" "ë") | |
321 ("\\\\`{e}" "è") | |
322 ("\\\\'{e}" "é") | |
323 ("\\\\^{e}" "ê") | |
324 ("\\\\\"{\\\\i}" "ï") | |
325 ("\\\\`{\\\\i}" "ì") | |
326 ("\\\\'{\\\\i}" "í") | |
327 ("\\\\^{\\\\i}" "î") | |
328 ("\\\\\"{i}" "ï") | |
329 ("\\\\`{i}" "ì") | |
330 ("\\\\'{i}" "í") | |
331 ("\\\\^{i}" "î") | |
332 ("\\\\\"{o}" "ö") | |
333 ("\\\\`{o}" "ò") | |
334 ("\\\\'{o}" "ó") | |
335 ("\\\\~{o}" "õ") | |
336 ("\\\\^{o}" "ô") | |
337 ("\\\\\"{u}" "ü") | |
338 ("\\\\`{u}" "ù") | |
339 ("\\\\'{u}" "ú") | |
340 ("\\\\^{u}" "û") | |
341 ("\\\\\"{A}" "Ä") | |
342 ("\\\\`{A}" "À") | |
343 ("\\\\'{A}" "Á") | |
344 ("\\\\~{A}" "Ã") | |
345 ("\\\\^{A}" "Â") | |
346 ("\\\\\"{E}" "Ë") | |
347 ("\\\\`{E}" "È") | |
348 ("\\\\'{E}" "É") | |
349 ("\\\\^{E}" "Ê") | |
350 ("\\\\\"{I}" "Ï") | |
351 ("\\\\`{I}" "Ì") | |
352 ("\\\\'{I}" "Í") | |
353 ("\\\\^{I}" "Î") | |
354 ("\\\\\"{O}" "Ö") | |
355 ("\\\\`{O}" "Ò") | |
356 ("\\\\'{O}" "Ó") | |
357 ("\\\\~{O}" "Õ") | |
358 ("\\\\^{O}" "Ô") | |
359 ("\\\\\"{U}" "Ü") | |
360 ("\\\\`{U}" "Ù") | |
361 ("\\\\'{U}" "Ú") | |
362 ("\\\\^{U}" "Û") | |
363 ("\\\\~{n}" "ñ") | |
364 ("\\\\~{N}" "Ñ") | |
365 ("\\\\c{c}" "ç") | |
366 ("\\\\c{C}" "Ç") | |
367 ("{\\\\ss}" "ß") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
368 ("{\\\\AE}" "\306") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
369 ("{\\\\ae}" "\346") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
370 ("{\\\\AA}" "\305") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
371 ("{\\\\aa}" "\345") |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
372 ("{\\\\copyright}" "\251") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
373 ("\\\\copyright{}" "\251") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
374 ("{\\\\pounds}" "£" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
375 ("{\\\\P}" "¶" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
376 ("{\\\\S}" "§" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
377 ("\\\\pounds{}" "£" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
378 ("\\\\P{}" "¶" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
379 ("\\\\S{}" "§" ) |
8538
94145efe2ad8
(iso-tex2iso-trans-tab): Put the sequences with braces
Richard M. Stallman <rms@gnu.org>
parents:
8433
diff
changeset
|
380 ("{\\?`}" "¿") |
94145efe2ad8
(iso-tex2iso-trans-tab): Put the sequences with braces
Richard M. Stallman <rms@gnu.org>
parents:
8433
diff
changeset
|
381 ("{!`}" "¡") |
94145efe2ad8
(iso-tex2iso-trans-tab): Put the sequences with braces
Richard M. Stallman <rms@gnu.org>
parents:
8433
diff
changeset
|
382 ("\\?`" "¿") |
7260 | 383 ("!`" "¡") |
384 ) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
385 "Translation table for translating TeX sequences to ISO 8859-1 characters. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
386 This table is not exhaustive (and due to TeX's power can never be). It only |
7260 | 387 contains commonly used sequences.") |
388 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
389 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
390 (defun iso-tex2iso (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
391 "Translate TeX sequences to ISO 8859-1 characters. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
392 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
393 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
394 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
395 (interactive "*r") |
18228 | 396 (iso-translate-conventions from to iso-tex2iso-trans-tab)) |
7260 | 397 |
398 (defvar iso-gtex2iso-trans-tab | |
399 '( | |
400 ("{\\\\\"a}" "ä") | |
401 ("{\\\\`a}" "à") | |
402 ("{\\\\'a}" "á") | |
403 ("{\\\\~a}" "ã") | |
404 ("{\\\\^a}" "â") | |
405 ("{\\\\\"e}" "ë") | |
406 ("{\\\\`e}" "è") | |
407 ("{\\\\'e}" "é") | |
408 ("{\\\\^e}" "ê") | |
409 ("{\\\\\"\\\\i}" "ï") | |
410 ("{\\\\`\\\\i}" "ì") | |
411 ("{\\\\'\\\\i}" "í") | |
412 ("{\\\\^\\\\i}" "î") | |
413 ("{\\\\\"i}" "ï") | |
414 ("{\\\\`i}" "ì") | |
415 ("{\\\\'i}" "í") | |
416 ("{\\\\^i}" "î") | |
417 ("{\\\\\"o}" "ö") | |
418 ("{\\\\`o}" "ò") | |
419 ("{\\\\'o}" "ó") | |
420 ("{\\\\~o}" "õ") | |
421 ("{\\\\^o}" "ô") | |
422 ("{\\\\\"u}" "ü") | |
423 ("{\\\\`u}" "ù") | |
424 ("{\\\\'u}" "ú") | |
425 ("{\\\\^u}" "û") | |
426 ("{\\\\\"A}" "Ä") | |
427 ("{\\\\`A}" "À") | |
428 ("{\\\\'A}" "Á") | |
429 ("{\\\\~A}" "Ã") | |
430 ("{\\\\^A}" "Â") | |
431 ("{\\\\\"E}" "Ë") | |
432 ("{\\\\`E}" "È") | |
433 ("{\\\\'E}" "É") | |
434 ("{\\\\^E}" "Ê") | |
435 ("{\\\\\"I}" "Ï") | |
436 ("{\\\\`I}" "Ì") | |
437 ("{\\\\'I}" "Í") | |
438 ("{\\\\^I}" "Î") | |
439 ("{\\\\\"O}" "Ö") | |
440 ("{\\\\`O}" "Ò") | |
441 ("{\\\\'O}" "Ó") | |
442 ("{\\\\~O}" "Õ") | |
443 ("{\\\\^O}" "Ô") | |
444 ("{\\\\\"U}" "Ü") | |
445 ("{\\\\`U}" "Ù") | |
446 ("{\\\\'U}" "Ú") | |
447 ("{\\\\^U}" "Û") | |
448 ("{\\\\~n}" "ñ") | |
449 ("{\\\\~N}" "Ñ") | |
450 ("{\\\\c c}" "ç") | |
451 ("{\\\\c C}" "Ç") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
452 ("\\\\\"a" "ä") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
453 ("\\\\`a" "à") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
454 ("\\\\'a" "á") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
455 ("\\\\~a" "ã") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
456 ("\\\\^a" "â") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
457 ("\\\\\"e" "ë") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
458 ("\\\\`e" "è") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
459 ("\\\\'e" "é") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
460 ("\\\\^e" "ê") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
461 ("\\\\\"\\\\i" "ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
462 ("\\\\`\\\\i" "ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
463 ("\\\\'\\\\i" "í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
464 ("\\\\^\\\\i" "î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
465 ("\\\\\"i" "ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
466 ("\\\\`i" "ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
467 ("\\\\'i" "í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
468 ("\\\\^i" "î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
469 ("\\\\\"o" "ö") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
470 ("\\\\`o" "ò") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
471 ("\\\\'o" "ó") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
472 ("\\\\~o" "õ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
473 ("\\\\^o" "ô") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
474 ("\\\\\"u" "ü") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
475 ("\\\\`u" "ù") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
476 ("\\\\'u" "ú") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
477 ("\\\\^u" "û") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
478 ("\\\\\"A" "Ä") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
479 ("\\\\`A" "À") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
480 ("\\\\'A" "Á") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
481 ("\\\\~A" "Ã") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
482 ("\\\\^A" "Â") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
483 ("\\\\\"E" "Ë") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
484 ("\\\\`E" "È") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
485 ("\\\\'E" "É") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
486 ("\\\\^E" "Ê") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
487 ("\\\\\"I" "Ï") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
488 ("\\\\`I" "Ì") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
489 ("\\\\'I" "Í") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
490 ("\\\\^I" "Î") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
491 ("\\\\\"O" "Ö") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
492 ("\\\\`O" "Ò") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
493 ("\\\\'O" "Ó") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
494 ("\\\\~O" "Õ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
495 ("\\\\^O" "Ô") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
496 ("\\\\\"U" "Ü") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
497 ("\\\\`U" "Ù") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
498 ("\\\\'U" "Ú") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
499 ("\\\\^U" "Û") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
500 ("\\\\~n" "ñ") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
501 ("\\\\~N" "Ñ") |
7260 | 502 ("\\\\\"{a}" "ä") |
503 ("\\\\`{a}" "à") | |
504 ("\\\\'{a}" "á") | |
505 ("\\\\~{a}" "ã") | |
506 ("\\\\^{a}" "â") | |
507 ("\\\\\"{e}" "ë") | |
508 ("\\\\`{e}" "è") | |
509 ("\\\\'{e}" "é") | |
510 ("\\\\^{e}" "ê") | |
511 ("\\\\\"{\\\\i}" "ï") | |
512 ("\\\\`{\\\\i}" "ì") | |
513 ("\\\\'{\\\\i}" "í") | |
514 ("\\\\^{\\\\i}" "î") | |
515 ("\\\\\"{i}" "ï") | |
516 ("\\\\`{i}" "ì") | |
517 ("\\\\'{i}" "í") | |
518 ("\\\\^{i}" "î") | |
519 ("\\\\\"{o}" "ö") | |
520 ("\\\\`{o}" "ò") | |
521 ("\\\\'{o}" "ó") | |
522 ("\\\\~{o}" "õ") | |
523 ("\\\\^{o}" "ô") | |
524 ("\\\\\"{u}" "ü") | |
525 ("\\\\`{u}" "ù") | |
526 ("\\\\'{u}" "ú") | |
527 ("\\\\^{u}" "û") | |
528 ("\\\\\"{A}" "Ä") | |
529 ("\\\\`{A}" "À") | |
530 ("\\\\'{A}" "Á") | |
531 ("\\\\~{A}" "Ã") | |
532 ("\\\\^{A}" "Â") | |
533 ("\\\\\"{E}" "Ë") | |
534 ("\\\\`{E}" "È") | |
535 ("\\\\'{E}" "É") | |
536 ("\\\\^{E}" "Ê") | |
537 ("\\\\\"{I}" "Ï") | |
538 ("\\\\`{I}" "Ì") | |
539 ("\\\\'{I}" "Í") | |
540 ("\\\\^{I}" "Î") | |
541 ("\\\\\"{O}" "Ö") | |
542 ("\\\\`{O}" "Ò") | |
543 ("\\\\'{O}" "Ó") | |
544 ("\\\\~{O}" "Õ") | |
545 ("\\\\^{O}" "Ô") | |
546 ("\\\\\"{U}" "Ü") | |
547 ("\\\\`{U}" "Ù") | |
548 ("\\\\'{U}" "Ú") | |
549 ("\\\\^{U}" "Û") | |
550 ("\\\\~{n}" "ñ") | |
551 ("\\\\~{N}" "Ñ") | |
552 ("\\\\c{c}" "ç") | |
553 ("\\\\c{C}" "Ç") | |
554 ("{\\\\ss}" "ß") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
555 ("{\\\\AE}" "\306") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
556 ("{\\\\ae}" "\346") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
557 ("{\\\\AA}" "\305") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
558 ("{\\\\aa}" "\345") |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
559 ("{\\\\copyright}" "\251") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
560 ("\\\\copyright{}" "\251") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
561 ("{\\\\pounds}" "£" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
562 ("{\\\\P}" "¶" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
563 ("{\\\\S}" "§" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
564 ("\\\\pounds{}" "£" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
565 ("\\\\P{}" "¶" ) |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
566 ("\\\\S{}" "§" ) |
7260 | 567 ("?`" "¿") |
568 ("!`" "¡") | |
569 ("{?`}" "¿") | |
570 ("{!`}" "¡") | |
7425
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
571 ("\"a" "ä") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
572 ("\"A" "Ä") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
573 ("\"o" "ö") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
574 ("\"O" "Ö") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
575 ("\"u" "ü") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
576 ("\"U" "Ü") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
577 ("\"s" "ß") |
eb4b69bf2d4e
(iso-gtex2iso-trans-tab): Redorder this list.
Richard M. Stallman <rms@gnu.org>
parents:
7260
diff
changeset
|
578 ("\\\\3" "ß") |
7260 | 579 ) |
580 "Translation table for translating German TeX sequences to ISO 8859-1. | |
581 This table is not exhaustive (and due to TeX's power can never be). It only | |
582 contains commonly used sequences.") | |
583 | |
584 (defvar iso-iso2gtex-trans-tab | |
585 '( | |
586 ("ä" "\"a") | |
587 ("à" "{\\\\`a}") | |
588 ("á" "{\\\\'a}") | |
589 ("ã" "{\\\\~a}") | |
590 ("â" "{\\\\^a}") | |
591 ("ë" "{\\\\\"e}") | |
592 ("è" "{\\\\`e}") | |
593 ("é" "{\\\\'e}") | |
594 ("ê" "{\\\\^e}") | |
595 ("ï" "{\\\\\"\\\\i}") | |
596 ("ì" "{\\\\`\\\\i}") | |
597 ("í" "{\\\\'\\\\i}") | |
598 ("î" "{\\\\^\\\\i}") | |
599 ("ö" "\"o") | |
600 ("ò" "{\\\\`o}") | |
601 ("ó" "{\\\\'o}") | |
602 ("õ" "{\\\\~o}") | |
603 ("ô" "{\\\\^o}") | |
604 ("ü" "\"u") | |
605 ("ù" "{\\\\`u}") | |
606 ("ú" "{\\\\'u}") | |
607 ("û" "{\\\\^u}") | |
608 ("Ä" "\"A") | |
609 ("À" "{\\\\`A}") | |
610 ("Á" "{\\\\'A}") | |
611 ("Ã" "{\\\\~A}") | |
612 ("Â" "{\\\\^A}") | |
613 ("Ë" "{\\\\\"E}") | |
614 ("È" "{\\\\`E}") | |
615 ("É" "{\\\\'E}") | |
616 ("Ê" "{\\\\^E}") | |
617 ("Ï" "{\\\\\"I}") | |
618 ("Ì" "{\\\\`I}") | |
619 ("Í" "{\\\\'I}") | |
620 ("Î" "{\\\\^I}") | |
621 ("Ö" "\"O") | |
622 ("Ò" "{\\\\`O}") | |
623 ("Ó" "{\\\\'O}") | |
624 ("Õ" "{\\\\~O}") | |
625 ("Ô" "{\\\\^O}") | |
626 ("Ü" "\"U") | |
627 ("Ù" "{\\\\`U}") | |
628 ("Ú" "{\\\\'U}") | |
629 ("Û" "{\\\\^U}") | |
630 ("ñ" "{\\\\~n}") | |
631 ("Ñ" "{\\\\~N}") | |
632 ("ç" "{\\\\c c}") | |
633 ("Ç" "{\\\\c C}") | |
634 ("ß" "\"s") | |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
635 ("\306" "{\\\\AE}") |
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
636 ("\346" "{\\\\ae}") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
637 ("\305" "{\\\\AA}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
638 ("\345" "{\\\\aa}") |
7861
8996abee8718
(iso-iso2tex-trans-tab): Change a few characters.
Richard M. Stallman <rms@gnu.org>
parents:
7850
diff
changeset
|
639 ("\251" "{\\\\copyright}") |
10081
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
640 ("£" "{\\\\pounds}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
641 ("¶" "{\\\\P}") |
5e4ef35c904b
Handle pilcrow, paragraph and pound signs.
Richard M. Stallman <rms@gnu.org>
parents:
8538
diff
changeset
|
642 ("§" "{\\\\S}") |
7260 | 643 ("¿" "{?`}") |
644 ("¡" "{!`}") | |
645 ) | |
646 "Translation table for translating ISO 8859-1 characters to German TeX.") | |
647 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
648 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
649 (defun iso-gtex2iso (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
650 "Translate German TeX sequences to ISO 8859-1 characters. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
651 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
652 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
653 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
654 (interactive "*r") |
18228 | 655 (iso-translate-conventions from to iso-gtex2iso-trans-tab)) |
7260 | 656 |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
657 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
658 (defun iso-iso2gtex (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
659 "Translate ISO 8859-1 characters to German TeX sequences. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
660 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
661 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
662 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
663 (interactive "*r") |
18228 | 664 (iso-translate-conventions from to iso-iso2gtex-trans-tab)) |
665 | |
666 (defvar iso-iso2duden-trans-tab | |
667 '(("ä" "ae") | |
668 ("Ä" "Ae") | |
669 ("ö" "oe") | |
670 ("Ö" "Oe") | |
671 ("ü" "ue") | |
672 ("Ü" "Ue") | |
673 ("ß" "ss"))) | |
674 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
675 ;;;###autoload |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
676 (defun iso-iso2duden (from to &optional buffer) |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
677 "Translate ISO 8859-1 characters to German TeX sequences. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
678 The region between FROM and TO is translated using the table TRANS-TAB. |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
679 Optional arg BUFFER is ignored (so that the function can can be used in |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
680 `format-alist')." |
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
681 (interactive "*r") |
18228 | 682 (iso-translate-conventions from to iso-iso2duden-trans-tab)) |
7260 | 683 |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
684 ;;;###autoload |
18228 | 685 (defun iso-cvt-read-only () |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
686 "Warn that format is read-only." |
18228 | 687 (interactive) |
688 (error "This format is read-only; specify another format for writing")) | |
689 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
690 ;;;###autoload |
18228 | 691 (defun iso-cvt-write-only () |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
692 "Warn that format is write-only." |
18228 | 693 (interactive) |
694 (error "This format is write-only")) | |
695 | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
696 ;;;###autoload |
18228 | 697 (defun iso-cvt-define-menu () |
698 "Add submenus to the Files menu, to convert to and from various formats." | |
699 (interactive) | |
700 | |
701 (define-key menu-bar-files-menu [load-as-separator] '("--")) | |
702 | |
703 (define-key menu-bar-files-menu [load-as] '("Load As..." . load-as)) | |
704 (defvar load-as-menu-map (make-sparse-keymap "Load As...")) | |
705 (fset 'load-as load-as-menu-map) | |
706 | |
707 ;;(define-key menu-bar-files-menu [insert-as] '("Insert As..." . insert-as)) | |
708 (defvar insert-as-menu-map (make-sparse-keymap "Insert As...")) | |
709 (fset 'insert-as insert-as-menu-map) | |
7260 | 710 |
18228 | 711 (define-key menu-bar-files-menu [write-as] '("Write As..." . write-as)) |
712 (defvar write-as-menu-map (make-sparse-keymap "Write As...")) | |
713 (fset 'write-as write-as-menu-map) | |
714 | |
715 (define-key menu-bar-files-menu [translate-separator] '("--")) | |
716 | |
717 (define-key menu-bar-files-menu [translate-to] '("Translate to..." . translate-to)) | |
718 (defvar translate-to-menu-map (make-sparse-keymap "Translate to...")) | |
719 (fset 'translate-to translate-to-menu-map) | |
720 | |
721 (define-key menu-bar-files-menu [translate-from] '("Translate from..." . translate-from)) | |
722 (defvar translate-from-menu-map (make-sparse-keymap "Translate from...")) | |
723 (fset 'translate-from translate-from-menu-map) | |
7260 | 724 |
18228 | 725 (let ((file-types (reverse format-alist)) |
726 name | |
727 str-name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
728 (while file-types |
18228 | 729 (setq name (car (car file-types)) |
730 str-name (car (cdr (car file-types))) | |
731 file-types (cdr file-types)) | |
732 (if (stringp str-name) | |
733 (progn | |
734 (define-key load-as-menu-map (vector name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
735 (cons str-name |
18228 | 736 (list 'lambda '(file) (list 'interactive (format "FFind file (as %s): " name)) |
737 (list 'format-find-file 'file (list 'quote name))))) | |
738 (define-key insert-as-menu-map (vector name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
739 (cons str-name |
18228 | 740 (list 'lambda '(file) (list 'interactive (format "FInsert file (as %s): " name)) |
741 (list 'format-insert-file 'file (list 'quote name))))) | |
742 (define-key write-as-menu-map (vector name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
743 (cons str-name |
18228 | 744 (list 'lambda '(file) (list 'interactive (format "FWrite file (as %s): " name)) |
745 (list 'format-write-file 'file (list 'quote (list name)))))) | |
746 (define-key translate-to-menu-map (vector name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
747 (cons str-name |
18228 | 748 (list 'lambda '() '(interactive) |
749 (list 'format-encode-buffer (list 'quote name))))) | |
750 (define-key translate-from-menu-map (vector name) | |
22911
d70738580fb4
(iso-spanish, iso-german, iso-iso2tex,
Dave Love <fx@gnu.org>
parents:
20987
diff
changeset
|
751 (cons str-name |
18228 | 752 (list 'lambda '() '(interactive) |
753 (list 'format-decode-buffer (list 'quote (list name)))))) | |
754 ))))) | |
7260 | 755 |
756 ;;; iso-cvt.el ends here |