annotate lisp/psgml/iso-sgml.el @ 151:59463afc5666 r20-3b2

Import from CVS: tag r20-3b2
author cvs
date Mon, 13 Aug 2007 09:37:19 +0200
parents 131b0175ea99
children a2f645c6b9f8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 ;; iso-sgml.el --- display SGML entity references as ISO 8859-1 characters
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 ;; Copyright (C) 1994 Frederic Lepied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5 ;; Author: Frederic Lepied <lepied@cenaath.cena.dgac.fr>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 ;; Maintainer: lepied@cenaath.cena.dgac.fr
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 ;; Keywords: SGML, HTML, ISO, Latin, i18n
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 ;; Status: Works with emacs 19.24
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 ;; Created: 1994-06-21
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 ;; Last Modified By: Frederic Lepied [STERIA SIT] 69577103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 ;; Last Modified On: Wed Dec 7 10:14:41 1994
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ;; Update Count: 5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 ;; LCD Archive Entry:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 ;; iso-sgml|Frederic Lepied|lepied@cenaath.cena.dgac.fr|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 ;; Edit SGML or HTML buffers with ISO 8859-1 (Latin-1) display|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 ;; 10-May-1995|1.4|~/misc/iso-sgml.el.Z|
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 2
diff changeset
19 ;; $Id: iso-sgml.el,v 1.1.1.1 1996/12/18 22:43:36 steve Exp $
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 ;; This program is free software; you can redistribute it and/or modify
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 ;; it under the terms of the GNU General Public License as published by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 ;; the Free Software Foundation; either version 2, or (at your option)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 ;; any later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 ;; This program is distributed in the hope that it will be useful,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 ;; GNU General Public License for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 ;;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 ;; You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 ;; along with this program; if not, you can either send email to this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 ;; program's maintainer or write to: The Free Software Foundation,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 ;; Inc.; 675 Massachusetts Avenue; Cambridge, MA 02139, USA.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 ;; Commentary:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 ;; Based on iso-cvt.el from Michael Gschwind <mike@vlsivie.tuwien.ac.at>,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 ;; iso-sgml.el transparently displays entity references in SGML or HTML
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 ;; buffers as ISO 8859-1 (aka Latin-1) characters.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
40 ;; Modified for XEmacs 19.15 to include the proposed extensions to Latin-1
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
41 ;; by Steve Baur <steve@miranova.com>
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 ;; SEE ALSO:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 ;; iso-cvt.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 ;; If you are interested in questions related to using the ISO 8859-1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 ;; characters set (configuring emacs, Unix, etc. to use ISO), then you
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47 ;; can get the ISO 8859-1 FAQ via anonymous ftp from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 ;; ftp.vlsivie.tuwien.ac.at in /pub/bit/FAQ-ISO-8859-1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 ;; INSTALLATION:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 ;; add the following line to your .emacs :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 ;; (load "iso-sgml")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53 ;; If you want it to work with other modes change the value of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 ;; the variable isosgml-modes-list like this :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55 ;; (setq isosgml-modes-list '(my-mode))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 ;; Code:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 2
diff changeset
59 (defconst isosgml-version "$Id: iso-sgml.el,v 1.1.1.1 1996/12/18 22:43:36 steve Exp $"
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 "iso-sgml RCS version number")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 (defvar isosgml-modes-list '(html-mode html-helper-mode sgml-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 "*List of modes to translate between SGML or HTML entity references
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 and the ISO 8859-1 character set.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 (defun isosgml-translate-conventions (trans-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 "Use the translation table argument to translate the current buffer."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 (let ((beg (point-min-marker)) ; see the `(elisp)Narrowing' Info node
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 (end (point-max-marker)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 (progn
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 (widen)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 (goto-char (point-min))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 (let ((buffer-read-only nil) ; (inhibit-read-only t)?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77 (case-fold-search nil))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 (while trans-tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 (save-excursion
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80 (let ((trans-this (car trans-tab)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 (while (search-forward (car trans-this) nil t)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 (replace-match (car (cdr trans-this)) t t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 (setq trans-tab (cdr trans-tab))))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 (narrow-to-region beg end)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 (defvar sgml2iso-trans-tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ("&AElig\;" "Æ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 ("&Aacute\;" "Á")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 ("&Acirc\;" "Â")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 ("&Agrave\;" "À")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 ("&Atilde\;" "Ã")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 ("&Ccedil\;" "Ç")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 ("&Eacute\;" "É")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95 ("&Egrave\;" "È")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 ("&Euml\;" "Ë")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 ("&Iacute\;" "Í")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98 ("&Icirc\;" "Î")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 ("&Igrave\;" "Ì")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100 ("&Iuml\;" "Ï")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ("&Ntilde\;" "Ñ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 ("&Oacute\;" "Ó")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103 ("&Ocirc\;" "Ô")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ("&Ograve\;" "Ò")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 ("&Oslash\;" "Ø")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 ("&Uacute\;" "Ú")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 ("&Ugrave\;" "Ù")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108 ("&Yacute\;" "Ý")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 ("&aacute\;" "á")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110 ("&acirc\;" "â")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
111 ("&acute\;" "´")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 ("&aelig\;" "æ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113 ("&agrave\;" "à")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 ("&aring\;" "å")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 ("&atilde\;" "ã")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
116 ("&brvbar\;" "¦")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117 ("&ccedil\;" "ç")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
118 ("&cedil\;" "¸")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
119 ("&cent\;" "¢")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
120 ("&copy\;" "©")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
121 ("&curren\;" "¤")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
122 ("&deg\;" "°")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 ("&eacute\;" "é")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 ("&ecirc\;" "ê")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125 ("&egrave\;" "è")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126 ("&euml\;" "ë")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
127 ("&frac12\;" "½")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
128 ("&frac14\;" "¼")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
129 ("&frac34\;" "¾")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 ("&iacute\;" "í")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 ("&icirc\;" "î")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 ("&igrave\;" "ì")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
133 ("&iexcl\;" "¡")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
134 ("&iquest\;" "¿")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135 ("&iuml\;" "ï")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
136 ("&laquo\;" "«")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
137 ("&macr\;" "¯")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
138 ("&micro\;" "µ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
139 ("&middot\;" "·")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
140 ("&nbsp\;" " ")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
141 ("&not\;" "¬")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 ("&ntilde\;" "ñ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143 ("&oacute\;" "ó")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144 ("&ocirc\;" "ô")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 ("&ograve\;" "ò")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
146 ("&ordf\;" "ª")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
147 ("&ordm\;" "º")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148 ("&oslash\;" "ø")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 ("&otilde\;" "õ")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
150 ("&para\;" "¶")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
151 ("&pound\;" "£")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
152 ("&plusmn\;" "±")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
153 ("&laquo\;" "»")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
154 ("&reg\;" "®")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
155 ("&sect\;" "§")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
156 ("&shy\;" "­")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
157 ("&sup1\;" "¹")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
158 ("&sup2\;" "²")
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
159 ("&sup2\;" "³")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 ("&uacute\;" "ú")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161 ("&ucirc\;" "û")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 ("&ugrave\;" "ù")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
163 ("&uml\;" "¨")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 ("&yacute\;" "ý")
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
165 ("&yen\;" "¥")
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166 ("&Auml\;" "Ä")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ("&auml\;" "ä")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168 ("&Ouml\;" "Ö")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 ("&ouml\;" "ö")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 ("&Uuml\;" "Ü")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 ("&uuml\;" "ü")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172 ("&szlig\;" "ß")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173 ("&sect\;" "§")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 ("&para\;" "¶")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175 ("&copy\;" "©")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 ("&iexcl\;" "¡")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177 ("&iquest\;" "¿")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ("&cent\;" "¢")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179 ("&pound\;" "£")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ("&times\;" "×")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181 ("&plusmn\;" "±")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 ("&divide\;" "÷")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183 ("&not\;" "¬")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 ("&mu\;" "µ")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185 ("&Ae\;" "Ä")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 ("&ae\;" "ä")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187 ("&Oe\;" "Ö")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 ("&oe\;" "ö")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 ("&Ue\;" "Ü")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190 ("&ue\;" "ü")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 ("&sz\;" "ß")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192 )
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 "Translation table from SGML entity references to ISO 8859-1 characters.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 (defun fix-sgml2iso ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196 "Replace SGML entity references with ISO 8859-1 (aka Latin-1) characters."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 (if (member major-mode isosgml-modes-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199 (let ((buffer-modified-p (buffer-modified-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 (isosgml-translate-conventions sgml2iso-trans-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202 (set-buffer-modified-p buffer-modified-p)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 (defvar iso2sgml-trans-tab
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205 (mapcar (function (lambda (entity-char) ; (ENTITY CHAR)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 ;; Return (CHAR ENTITY)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207 (list (car (cdr entity-char))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208 (car entity-char))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 sgml2iso-trans-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210 "Translation table from ISO 8859-1 characters to SGML entity references.")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 (defun fix-iso2sgml ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 "Replace ISO 8859-1 (aka Latin-1) characters with SGML entity references."
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 (if (member major-mode isosgml-modes-list)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216 (let ((buffer-modified-p (buffer-modified-p)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 (unwind-protect
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218 (isosgml-translate-conventions iso2sgml-trans-tab)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 (set-buffer-modified-p buffer-modified-p)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222 (add-hook 'find-file-hooks 'fix-sgml2iso)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 (add-hook 'write-file-hooks 'fix-iso2sgml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 (add-hook 'after-save-hook 'fix-sgml2iso)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 (provide 'iso-sgml)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228 ;; iso-sgml.el ends here
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 ; $Log: iso-sgml.el,v $
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 2
diff changeset
231 ; Revision 1.1.1.1 1996/12/18 22:43:36 steve
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 2
diff changeset
232 ; XEmacs 20.0 -- Beta 30
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234 ; Revision 1.4 1995/05/10 06:19:41 lepied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 ; * protect code with unwind-protect to prevent errors
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 ; Revision 1.3 1994/12/07 09:08:07 lepied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238 ; Thanks to kevinr@ihs.com (Kevin Rodgers)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239 ; * replace regular expression search with normal one
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ; * cleanup interactive use
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 ; Revision 1.2 1994/11/24 06:49:08 lepied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 ; Integrated patch from kevinr@ihs.com (Kevin Rodgers) :
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 ; * iso-sgml.el (sgml2iso-trans-tab): Delete backslash (`\') from
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246 ; "&plusmn;" entity reference.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248 ; * iso-sgml.el (file header, library header (Keywords), LCD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 ; Archive Entry (description) [comment blocks]): Properly refer to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250 ; SGML entity references; uppercase acronyms (ISO, SGML, HTML);
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 ; capitalize Latin.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 ; (Commentary [comment block]): Rewrite as a complete sentence.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253 ; (sgml2iso-trans-tab, fix-sgml2iso [doc strings]): Properly refer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 ; to SGML entity references.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255 ; (iso2sgml-trans-tab, fix-iso2sgml [doc strings]): Properly refer
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256 ; to SGML entity references.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 ; * iso-sgml.el (iso2sgml-trans-tab): Initialize by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ; programmatically reversing elements of sgml2iso-trans-tab,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ; instead of hand-coding each element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 ;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262 ; Revision 1.1 1994/06/22 15:15:13 lepied
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263 ; Initial revision
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264 ;