annotate lisp/psgml/README.psgml @ 0:376386a54a3c r19-14

Import from CVS: tag r19-14
author cvs
date Mon, 13 Aug 2007 08:45:50 +0200
parents
children ac2d302a0011
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 This is the READ ME file for psgml.el version 1a9. -*- text -*-
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3 PSGML is a major mode for editing SGML documents. It works with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 GNU Emacs 19.19 and later or with Lucid Emacs 19.9.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 This distribution should contain the following source files:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 psgml.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 psgml.texi
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 psgml-other.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10 psgml-lucid.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 psgml-edit.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 psgml-parse.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 psgml-dtd.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 psgml-info.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15 psgml-charent.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 psgml-debug.el -- some functions used in development
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 psgml-api.texi -- internals documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 psgml-api.el -- Extra functions for the API
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 fs.el -- Example use of psgml to format a SGML file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20 style.el -- example style file for fs.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 catalog.sgml -- example SGML-file for fs.el and style.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 iso88591.map
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 In addition the distribution contains the formatted versions of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 documentation files (psgml.info, ...). But the compiled elisp code is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 no longer supplied. You will have to byte compile the files before
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 PSGML will achive usable speed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 If you are not using Lucid Emacs or XEmacs you should compile:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 psgml.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 psgml-other.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 psgml-edit.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 psgml-parse.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 psgml-dtd.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 psgml-info.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36 psgml-charent.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 If you on the other hand are using Lucid Emacs or XEmacs you should
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 compile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 psgml.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 psgml-lucid.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 psgml-edit.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 psgml-parse.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 psgml-dtd.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45 psgml-info.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
46 psgml-charent.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
47
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
48 Additionally the following can be compiled, they are not normaly used
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
49 by PSGML:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
50 psgml-api.el -- Extra functions for the API
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
51 fs.el -- Example use of psgml to format a SGML file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
52 psgml-debug.el -- some functions used in development
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
53
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
54 Send bug reports, comments and suggestions to lenst@lysator.liu.se.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
55
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
56 New in version 1.0a9
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 * XEmacs may have problem if sgml-set-face is t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60 I tried with the latest version on a sun4 Solaris 2 machine and PSGML
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 would always parse to the end of the buffer even if I typed something.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 There seem to be a problem with the input-pending-p function. I don't
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 know if this is specific fo Solaris. Emacs on Solaris has problems
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 with signal handling.
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 * New options for insert-element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 ** sgml-insert-missing-element-comment
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69 ** sgml-insert-end-tag-on-new-line
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 * psgml-api:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 ** sgml-map-content: new optional argument. If the argument ENTITY-FUN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73 is specified it should be a function with one argument. The function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 will be called for data entity references instead of the entity text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 beeing passed to the DATA-FUN. The argument is the entity referenced.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 Use `sgml-entity-name', `sgml-entity-type' etc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 Version 1.0a8 has only bugfixes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 New in version 1.0a7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 * Better CATALOG parsing
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 ** Will handle SGMLDECL, etc..
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 ** New option: sgml-system-identifiers-are-preferred
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 If nil PSGML will look up external entities by searching the catalogs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 in `sgml-local-catalogs' and `sgml-catalog-files' and only if the entity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91 is not found in will a given system identifer be used. If the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
92 is non-nil and a system identifer is given, the system identifier will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
93 be used for the entity. If no system identifier is given the catalogs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
94 will searched.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
95
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
96 * File names for external entities (e.g system identifiers) are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
97 relative to the directory containing the file declaring of the entity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
98
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
99 * Changes to how the DTD is found
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
100
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
101 ** If the variable sgml-doctype is set, it should be the name of a file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
102 containing the DOCTYPE declaration to use.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
103
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
104 ** The variable sgml-parent-document is used when the current file
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
105 is part of a bigger document, and the variable describes how the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
106 current files content fits into the element hierarchy. The variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
107 should have the form
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
108
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
109 (parent-file context-element* top-element (has-seen-element*)?)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
110
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
111 *** parent-file (string) is the name of the file contatining the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
112 document entity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
113
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
114 *** context-element (string) is used to set up exceptions and short
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
115 reference map. Good candidates for these elements are the elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
116 open when the entity pointing to the current file is used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
117
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
118 *** top-element (string) is the top level element in the current file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
119 The file should contain one instance of this element, unless the last
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
120 (lisp) element of sgml-parent-document is a list. If it is a list, the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
121 top level of the file should follow the content model of top-element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
122
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
123 *** has-seen-element (string) element satisfied in the content model
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
124 of top-element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
125
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
126
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
127 * sgml-validate
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
128 The variable sgml-validate-command can now be a list of strings. The
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
129 strings can contain %-sequences that will be expanded:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
130 %b to buffer file name,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
131 %s to SGML Declaration file, either the value of sgml-declaration
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
132 variable or SGML Declaration file for parent document or DOCTYPE file or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
133 SGMLDECL from catalog.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
134 %d value of sgml-doctype.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
135
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
136
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
137 * Hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
138
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
139 ** sgml-new-attribute-list-function
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
140 This hook is run when a new element is inserted to construct the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
141 attribute specification list. The default function prompts for the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
142 required attributes.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
143
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
144
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
145 * API
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
146
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
147 ** New file psgml-api.el
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
148
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
149 This file contain API-functions that are not used by other parts of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
150 psgml. Use (require 'psgml-api) to use the API functions (psgml-api
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
151 includes the rest of the psgml files).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
152
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
153 The new functions in psgml-api is two functions to travers the element
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
154 structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
155
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
156 *** (sgml-map-content element element-function data-function pi-function)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
157
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
158 Call element-function with every child of element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
159 Call data-function with all the data in element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
160 Don't modify the buffer in these functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
161
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
162 *** (sgml-map-element-modify function element)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
163
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
164 Call function on every sub element of element, allows the function to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
165 modify the buffer (e.g. add/modify attributes of the elements).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
166
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
167 ** Example of API use: fs.el -- a simple style sheet driven formatter.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
168
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
169 Try fs.el with the catalog.sgml file. The style.el is the style sheet
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
170 for catalog.sgml. The command to format current buffer is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
171 `M-x style-format'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
172
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
173
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
174 New in version 1.0 a6
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
175
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
176 * Entity manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
177
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
178 ** Use system id as file name, if there is no %S in sgml-public-map.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
179
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
180 ** Finds PUBLIC entries before DOCTYPE and ENTITY in catalog files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
181
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
182 * Better error recovery for out of context data and tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
183
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
184 * New command: sgml-general-dtd-info
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
185
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
186 * Disables auto-fill in the prolog
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
187
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
188 * Insert element leaves point at the end of the element,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
189 it used to leave point at the beginning of the element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
190
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
191 * sgml-hide-tags/attributes is better at handling minimized tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
192
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
193 * New options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
194 ** sgml-validate-files and slight change of sgml-validate-command.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
195 ** sgml-recompile-out-of-date-cdtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
196
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
197 * Now saving attribute specification list in parse tree
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
198 Faster sgml-element-attval, but more memory used.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
199
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
200 * Long menus that are split into submenus now show the range of
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
201 choices in the different submenus.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
202
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
203 The option `sgml-range-indicator-max-length' determines how many
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
204 characters from the first and the last choice to show.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
205
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
206 * Private abbrev table
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
207
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
208
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
209 New in version 1.0 a5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
210
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
211 * New menu structure
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
212 Perhaps there is to many top-level menus now. Any suggestions how to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
213 organize the menus?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
214
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
215 * Some new functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
216
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
217 ** Information from the DTD (used to be nefarious.el)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
218
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
219 *** sgml-describe-element-type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
220
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
221 *** sgml-describe-entity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
222
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
223 *** sgml-list-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
224 Will list all elements and the attributes declared for the element.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
225
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
226 *** sgml-list-attributes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
227 Will list all attributes declared and the elements that use them.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
228
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
229 *** sgml-list-terminals
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
230 Will list all elements that can contain data.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
231
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
232 *** sgml-list-occur-in-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
233 Will list all element types and where it can occur.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
234
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
235 *** sgml-list-content-elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
236 Will list all element types and the element types that can occur
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
237 in its content.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
238
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
239
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
240 ** Translating between characters and entity references
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
241
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
242 Set the variable `sgml-display-char-list-filename' to a file file that
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
243 contains mappings between all characters present in the presentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
244 character set, and their "standard replacement text" names, e.g. "å"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
245 -> "[aring ]", e.t.c.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
246
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
247 The default value for this variable is `iso88591.map'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
248
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
249 The use the functions (also in the Modify menu)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
250
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
251 sgml-charent-to-display-char
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
252 sgml-display-char-to-charent
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
253
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
254 to translate between entities and characters.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
255
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
256
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
257
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
258 * Two major bugs fixed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
259 ** DTD using undeclared elements was improperly saved
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
260 ** Bug in using a precompiled DTD and local element, attlist or usemap
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
261 declaration.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
262
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
263
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
264
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
265 New in version 1.0 a4
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
266
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
267 * If the document prolog does not contain a document type declaration,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
268 PSGML will try to supply one on the form `<!DOCTYPE DocTypeName
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269 SYSTEM>' If the variable `sgml-default-doctype-name' is defined this
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 will be used for the document type name, otherwise the GI of the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
271 start tag will be used. I.e., if the document starts with `<book>', a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 document type declaration `<!DOCTYPE book SYSTEM>' will be assumed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 * Compiled DTDs are now associated with external `Document Type
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 Declaration Subset' entitys. You will have to create a catalog with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 entries for all the DTDs that should be compiled. This should make
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
278 it, in most cases, unnecessary to make saved dtds or to set the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 `sgml-default-dtd-file', at the expense of having to maintain the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 catalog file.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 ** Options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 `sgml-ecat-files' List of compiled dtd catalog files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 Default: ("ECAT" "~/sgml/ECAT" "/usr/local/lib/sgml/ECAT")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 `sgml-local-ecat-files' This can be set as a buffer local variable to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288 a list of catalogs to be searched before `sgml-ecat-files'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
289
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290 ** Catalog format
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
291
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
292 The catalog is similar to the catalog used to resolve public
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
293 identifiers. There are two types of entries:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
294
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
295 PUBLIC pubid pents? cfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296 and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
297 FILE file pents? cfile
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
298
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 where pubid is a public identifier (as a minimum literal), pents is a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 optional list of parameter entities and values, file is the file name
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 of a DTD file and cfile is the name of the complied DTD. The syntax
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 for pents is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 `[' (name literal)* `]'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 Example:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
308 PUBLIC "-//lenst//dtd My DTD//en" cdtd/bar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309 FILE "bar.dtd" cdtd/bar
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
310
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
311 To better handle DTDs with options, like TEI and HTML 2.0/+ it is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
312 possible to have several entries for the same DTD with different
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
313 parameter entity settings. The parameters are listed between `[' and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
314 `]' before the file name of the compiled dtd.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
315
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
316 FILE "~/sgml/htmlplus.dtd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
317 [ HTML.emph "INCLUDE" ] "~/sgml/htmlplus.ced"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
318
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
319 PUBLIC "-//Text Encoding Initiative//DTD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
320 P3 3.6.1: Main TEI document type declaration//EN"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
321 [ TEI.prose 'INCLUDE' TEI.analysis 'INCLUDE' ] "tei2an.cdtd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
322
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
323 PUBLIC "-//Text Encoding Initiative//DTD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
324 P3 3.6.1: Main TEI document type declaration//EN"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
325 [ TEI.prose 'INCLUDE' TEI.verse 'INCLUDE' ] "tei2verse.cdtd"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
326
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
327 The entries will be searched in order and the first matching will be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
328 used. Put more specific entries before less specific. Matching is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
329 done by matching pubid or file and checking that all the listed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
330 parameters are defined with the listed values.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
331
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
332
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
333
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
334 ** Example: setting up for editing HTML
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
335
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
336 If you have the files for the html.dtd in ~/sgml.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
337 Put in ~/sgml/CATALOG:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
338 PUBLIC "-//IETF//DTD HTML//EN" html.dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
339 PUBLIC "-//IETF//DTD HTML//EN//2.0" html.dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
340 PUBLIC "-//IETF//DTD HTML Level 1//EN//2.0" html-1.dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
341 PUBLIC "-//IETF//ENTITIES Added Latin 1 for HTML//EN" ISOlat1.sgml
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
342 DOCTYPE HTML html.dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
343
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
344 Put in ~/sgml/ECAT:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
345 FILE html.dtd [ HTML.Recommended "INCLUDE" ] cdtd/html-r
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
346 FILE html.dtd cdtd/html
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
347
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
348 Put ~/sgml/CATALOG in sgml-catalog-files and ~/sgml/ECAT in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
349 sgml-ecat-files.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
350
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
351 Now it should be possible to edit html files if you put them in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
352 sgml-mode. The file must either start with a proper DOCTYPE or with a
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
353 <html> tag. To be abel to start with empty files and to edit files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
354 not starting with <html> you can create a html-mode that sets the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
355 default document type name:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
356
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
357 (defun html-mode ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
358 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
359 (sgml-mode)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
360 (make-local-variable 'sgml-declaration)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
361 (make-local-variable 'sgml-default-doctype-name)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
362 (setq sgml-declaration "~/sgml/html.decl"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
363 sgml-default-doctype-name "html"
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
364 sgml-always-quote-attributes t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
365 sgml-indent-step 2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
366 sgml-indent-data t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
367 sgml-minimize-attributes nil
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
368 sgml-omittag t
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
369 sgml-shortag t ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
370
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
371
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
372 * Handling of tags for undefined elements
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
373
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
374 ** Start-tags for undefined elements will either be ignored, if
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
375 `sgml-ignore-undefined-elements' is t, or assumed to be acceptabled in
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
376 the current element and defined with `O O ANY'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
377
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
378 ** An end-tag for an element that is not currently open will be ignored.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
379
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
380
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
381 * I have (as an experiment) turned off all warnings. Warnings are only
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
382 given if the sgml-next-trouble-spot is used or while parsing the DTD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
383
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
384
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
385 * Entity manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
386
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
387 ** sgml-system-path is no longer used for entity lookup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
388
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
389 ** PSGML will recognize that a catalog file has been changed
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
390
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
391
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
392 News in version 1.0 a3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
393
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
394 * Change in user options
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
395
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
396 ** sgml-live-element-indicator no longer buffer local
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
397
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
398 ** sgml-save-options only saves:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
399 (sgml-parent-document sgml-omittag sgml-shorttag
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
400 sgml-minimize-attributes sgml-always-quote-attributes sgml-indent-step
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
401 sgml-indent-data sgml-default-dtd-file sgml-exposed-tags)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
402 and saves all of them, even if they have no buffer local value
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
403
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
404 ** Options menu split in to two menus
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
405
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
406 * Cleaned up Markup menu
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
407 The removed entries can be added with sgml-custom-markup:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
408
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
409 (setq sgml-custom-markup
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
410 '(
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
411 ("<!entity ... >" "<!entity \r>\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
412 ("<!attlist ... >" "<!attlist \r>\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
413 ("<!element ... >" "<!element \r>\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
414 ("<!doctype ...>" "<!doctype \r -- public or system --\n[\n]>\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
415 ("Local variables comment" "<!--\nLocal variables:\n\rEnd:\n-->\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
416 ("Comment" "<!-- \r -->\n")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
417 ))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
418
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
419
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
420 * Some bug fixes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
421 Including new default for sgml-catalog-files is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
422 "CATALOG" and "/usr/local/lib/sgml/CATALOG".
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
423
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
424 * Some tuning
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
425
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
426
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
427 News in version 1.0 a2
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
428
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
429 * Support for short references
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
430
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
431 ** Command: sgml-expand-all-shortrefs
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
432 Expand all short references in the buffer. Short references to text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
433 entities are expanded to the replacement text of the entity, other
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
434 short references are expanded into general entity references. If
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
435 argument, TO-ENTITY, is non-nil, or if called interactive with numeric
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
436 prefix argument, all short references are replaced by generaly entity
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
437 references.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
438
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
439 ** sgml-normalize: expand short references also
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
440 Normalize buffer by filling in omitted tags and expanding empty tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
441 Argument TO-ENTITY controls how short references are expanded as with
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
442 `sgml-expand-all-shortrefs'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
443
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
444
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
445 * Variable: sgml-auto-activate-dtd
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
446
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
447 PSGML was behaving inconsistent when a new file was loaded. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
448 variable `sgml-set-face' was true the DTD would automatically be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
449 activated (loaded or parsed), but only if psgml-parse already loaded.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
450
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
451 Rather than let `sgml-set-face' decide if the DTD is activated, there
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
452 is now a distinct option for this. This option works even the first
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
453 time.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
454
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
455 If non-nil, loading a sgml-file will automatically try to activate its DTD.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
456 Activation means either to parse the document type declaration or to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
457 load a previously saved parsed DTD. The name of the activated DTD
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
458 will be shown in the mode line.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
459
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
460
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
461 * face setting
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
462 If `sgml-set-face' is true and the DTD has been activated, PSGML will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
463 automatically set the face of markup in the buffer. This is done by
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
464 parsing, with error messages turned off, as much as possible after
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
465 every command. The parsing is interrupted by input and is almost
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
466 transparent.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
467
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
468 * Local catalog files
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
469 Variabel `sgml-local-catalogs'
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
470 A list of SGML entity catalogs to be searched first when parsing the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
471 This is used in addtion to `sgml-catalog-files', and `sgml-public-map'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
472 This variable is automatically local to the buffer.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
473
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
474 * New commands
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
475 Thanks to David Megginson the custom menus are now reacable from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
476 keyboard:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
477 ** C-c C-u C-d (sgml-custom-dtd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
478 ** C-c C-u C-m (sgml-custom-markup)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
479
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
480 * New command: sgml-expand-entity-reference
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
481 Insert the text of the entity referenced at point.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
482
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
483 * sgml-validate-command is now a format string
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
484
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
485
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
486 News in version 1.0 a1
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
487
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
488 * A lot of internal changes
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
489
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
490 * Support for general entities
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
491
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
492 * New entity manager
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
493
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
494 The new entity manager will handle an entity thus:
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
495
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
496 1. If the entity has a system identifier, the entity manager will
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
497 first try and call the functions on sgml-sysid-resolve-functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
498 with the system identifier as argument, and if any function returns
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
499 non-nil assume that the function has handled the entity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
500 2. Next the entity manager will try the catalogue, and
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
501 3. if not found there use the sgml-public-map.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
502
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
503 The catalogue files searched is given by the variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
504 sgml-catalog-files (I suppose it would be confusing to call it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
505 sgml-catalogue-files.) This variable is initialised from the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
506 environment variable SGML_CATALOG_FILES (should be a colon separated
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
507 list of files).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
508
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
509 The sgml-public-map is initialised from the environment variable
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
510 SGML_PATH.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
511
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
512 sgml-system-path defaults to nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
513
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
514 Supports most of sgmls substitutions for sgml-public-map.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
515 Supported: %%, %N, %P, %S, %Y, %C, %L, %O, %T, %V
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
516 Unsupported: %D, %X, %A, %E, %I, %R, %U
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
517 Note: that %D is and alias for %C in PSGML (historical accident).
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
518
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
519
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
520 * Hooks
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
521
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
522 ** sgml-close-element-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
523 The hook run by `sgml-close-element'.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
524 These functions are invoked with `sgml-current-tree' bound to the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
525 element just parsed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
526
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
527 ** sgml-doctype-parsed-hook
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
528 This hook is called after the doctype has been parsed.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
529 It can be used to load any additional information into the DTD structure.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
530
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
531 Example: add description to element types
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
532 (defun set-help-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
533 (let ((help '(("para" "A Paragraph")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
534 ("q" "A Quotation")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
535 ("date" "A Date")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
536 (dtd (sgml-pstate-dtd sgml-buffer-parse-state)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
537 (loop for h in help do
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
538 (setf (sgml-eltype-appdata (sgml-lookup-eltype (first h) dtd)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
539 'help-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
540 (second h)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
541 (add-hook 'sgml-doctype-parsed-hook 'set-help-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
542
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
543 (defun sgml-help-for-element ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
544 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
545 (let* ((el (sgml-find-element-of (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
546 (help (sgml-element-appdata el 'help-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
547 (and help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
548 (message "%s" help))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
549
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
550
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
551 ** sgml-sysid-resolve-functions
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
552 This variable should contain a list of functions.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
553 Each function should take one argument, the system identifier of an entity.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
554 If the function can handle that identifier, it should insert the text
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
555 of the entity into the current buffer at point and return t. If the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
556 system identifier is not handled the function should return nil.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
557
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
558 Example use: Support URLs as system identifiers
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
559 (defun sgml-url-sysid (sysid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
560 (cond ((string-match "^\\([a-z]+\\):" sysid) ; looks like url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
561 (require 'url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
562 (set-buffer (prog1 (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
563 (url-retrieve sysid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
564 (insert-buffer url-working-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
565 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
566 (add-hook 'sgml-sysid-resolve-functions 'sgml-url-sysid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
567
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
568
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
569 * sgml-set-face Now automatically sets faces for all visible text,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
570 with a delay of 1s.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
571
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
572 * sgml-exposed-tags
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
573 The list of tag names that remain visible, despite M-x sgml-hide-tags.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
574 Each name is a lowercase string, and start-tags and end-tags must be
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
575 listed individually.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
576
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
577 `sgml-exposed-tags' is local to each buffer in which it has been set;
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
578 use `setq-default' to set it to a value that is shared among buffers.