annotate lisp/psgml/README.psgml @ 70:131b0175ea99 r20-0b30

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