annotate lisp/psgml/README.psgml @ 84:ac0620f6398e r20-0b92

Import from CVS: tag r20-0b92
author cvs
date Mon, 13 Aug 2007 09:08:29 +0200
parents c7528f8e288d
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
1 This is the READ ME file for psgml.el version 1.0 -*- 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
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 psgml-api.texi -- internals documentation
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 psgml-api.el -- Extra functions for the API
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 iso88591.map
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
19 Makefile.in
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 In addition the distribution contains the formatted versions of the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22 documentation files (psgml.info, ...). But the compiled elisp code is
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 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
24 PSGML will achieve usable speed.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
26 PSGML now comes with autoconf support. See INSTALL for generic
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
27 instructions. Run
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
28
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
29 sh configure
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
30 make
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
32 and possibly
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
33
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
34 make install
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 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
37 to configure, or use `make xemacs'.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
38
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
39 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
40 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
41 move the .elc files.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43 Send bug reports, comments and suggestions to lenst@lysator.liu.se.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
45 New in version 1.0
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
46
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
47 * Main changes
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
48
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
49 ** Support for general entities
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
50
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
51 ** Support for short reference
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
52
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
53 ** Support for catalog files
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
54
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
55 ** New mechanism for caching parsed DTD
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
56
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
57 ** Includes commands to list various aspects of the DTD
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
58
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
59 * Entity support
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
60
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
61 PSGML will recognize entity references (except in attribute values). If
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
62 the entity is a general text entity, PSGML will also parse the content
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
63 of the entity. To support this PSGML has a new entity manager with a
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
64 new mechanism for looking up entities (see belove).
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
65
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
66 Short references are also supported, for the short reference delimiters
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
67 from the concrete reference syntax.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
68
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
69 There are some new and changed commands to complete the entity support:
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
70
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
71 ** Command: `sgml-expand-entity-reference'
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
72
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
73 Insert the text of the entity referenced at point.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
74
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
75 ** Command: `sgml-expand-all-shortrefs'
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
76
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
77 Expand all short references in the buffer. Short references to text
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
78 entities are expanded to the replacement text of the entity, other
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
79 short references are expanded into general entity references. If
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
80 argument, `to-entity', is non-nil, or if called interactive with
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
81 numeric prefix argument, all short references are replaced by generally
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
82 entity references.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
83
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
84 ** Command: `sgml-normalize'
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
85
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
86 Changed to expand short references also. Normalize buffer by filling in
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
87 omitted tags and expanding empty tags. Argument `to-entity' controls
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
88 how short references are expanded as with `sgml-expand-all-shortrefs'.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
89
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
90 * Fontification
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
91
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
92 If `sgml-set-face' is true and the DTD has been activated, PSGML will
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
93 automatically set the face of markup in the buffer.
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
94
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
95 First the current line is parsed and fontified. If this would mean
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
96 parsing more than 500 chars, wait 1 second first.
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
97
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
98 The rest of the buffer is fontified after 6 seconds idle time.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
99
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
100 Fontification can be interrupted by any input event.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
101
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
102 The buffer can be fontified initially if `sgml-auto-activate-dtd' is
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
103 true.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
104
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
105 * New entity manager
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
106
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
107 The new entity manager will handle an entity reference thus:
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
108
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
109 ** If the entity has a system identifier, the entity manager will first
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
110 try and call the functions on `sgml-sysid-resolve-functions' with the
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
111 system identifier as argument, and if any function returns non-nil
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
112 assume that the function has handled the entity.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
113
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
114 ** If the entity has a system identifier and
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
115 `sgml-system-identifiers-are-preferred' is non-nil, the system
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
116 identifier will be used as a file name relative to the file containing
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
117 the entity declaration.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
118
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
119 ** Next the entity manager will try the catalog, and
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
120
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
121 ** if not found there use the `sgml-public-map'.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
122
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
123 ** Finally if the entity has not been found and it has a system
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
124 identifier, this will be used as a file name.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
125
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
126 Note: `sgml-system-path' is no longer used for entity lookup.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
127
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
128 The catalog files searched is given by the variable
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
129 `sgml-local-catalogs' and `sgml-catalog-files'. The
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
130 `sgml-catalog-files' variable is initialized from the environment
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
131 variable `SGML_CATALOG_FILES' (should be a colon separated list of
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
132 files). The `sgml-local-catalogs' variable is assumed to be set in a
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
133 files local variables.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
134
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
135 File names for external entities (e.g system identifiers) are relative
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
136 to the directory containing the file declaring the entity.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
137
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
138 The `sgml-public-map' is initialized from the environment variable
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
139 `SGML_PATH'.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
140
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
141 `sgml-system-path' defaults to nil.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
142
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
143 Supports most of sgmls substitutions for sgml-public-map. Supported:
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
144 %%, %N, %P, %S, %Y, %C, %L, %O, %T, %V. Unsupported: %D, %X, %A, %E,
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
145 %I, %R, %U. Note: that %D is and alias for %C in PSGML (historical
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
146 accident).
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
147
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
148 * New and changed options
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
149
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
150 ** `sgml-recompile-out-of-date-cdtd'
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
151
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
152 ** New options for insert-element:
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
153 `sgml-insert-missing-element-comment' and
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
154 `sgml-insert-end-tag-on-new-line'.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
155
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
156 ** `sgml-validate-files' and slight change of `sgml-validate-command'
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
157
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
158 The variable `sgml-validate-command' can now be a list of strings. The
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
159 strings can contain %-sequences that will be expanded: %b to buffer
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
160 file name, %s to SGML Declaration file, either the value of
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
161 sgml-declaration variable or SGML Declaration file for parent document
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
162 or DOCTYPE file or SGMLDECL from catalog. %d value of `sgml-doctype'.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
163
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
164 ** `sgml-set-face'
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
165
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
166 Now automatically sets faces for all visible text, with a delay of 1s.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
167
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
168 ** `sgml-exposed-tags'
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
169
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
170 The list of tag names that remain visible, despite `M-x
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
171 sgml-hide-tags'. Each name is a lowercase string, and start-tags and
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
172 end-tags must be listed individually.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
173
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
174 ** `sgml-auto-activate-dtd'
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
175
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
176 PSGML was behaving inconsistent when a new file was loaded. If the
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
177 variable `sgml-set-face' was true the DTD would automatically be
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
178 activated (loaded or parsed), but only if psgml-parse already loaded.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
179
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
180 Rather than let `sgml-set-face' decide if the DTD is activated, there
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
181 is now a distinct option for this. This option works even the first
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
182 time.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
183
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
184 If non-nil, loading a sgml-file will automatically try to activate its
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
185 DTD. Activation means either to parse the document type declaration or
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
186 to load a previously saved parsed DTD. The name of the activated DTD
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
187 will be shown in the mode line.
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
188
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
189 * Various
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
190
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
191 ** Tracing catalog lookup
70
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 To help debug entity lookup there is a new option
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
194 `sgml-trace-entity-lookup'. If this option is t messages will be logged
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
195 in *SGML LOG* buffer when external entities are looked up. These
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
196 messages shows entity, catalogs searched, and entry type in catalog
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
197 where entity was found.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
198
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
199 ** Translating between characters and entity references
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
200
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
201 Set the variable `sgml-display-char-list-filename' to a file that
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
202 contains mappings between all characters present in the presentation
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
203 character set, and their "standard replacement text" names, e.g. "å" ->
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
204 "[aring ]", e.t.c. The default value for this variable is
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
205 `iso88591.map'.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
206
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
207 Use the functions (also in the Modify menu)
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
208 `sgml-charent-to-display-char' and `sgml-display-char-to-charent' to
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
209 translate between entities and characters.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
210
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
211 ** Handling of missing DOCTYPE
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
212
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
213 If the document prolog does not contain a document type declaration,
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
214 PSGML will try to supply one on the form `<!DOCTYPE DocTypeName
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
215 SYSTEM>' If the variable `sgml-default-doctype-name' is defined this
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
216 will be used for the document type name, otherwise the GI of the first
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
217 start tag will be used. I.e., if the document starts with `<book>', a
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
218 document type declaration `<!DOCTYPE book SYSTEM>' will be assumed.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
219
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
220 ** Handling of tags for undefined elements
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
221
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
222 *** Start-tags for undefined elements will either be ignored, if
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
223 `sgml-ignore-undefined-elements' is `t', or assumed to be acceptable in
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
224 the current element and defined with `O O ANY'.
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
225
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
226 *** An end-tag for an element that is not currently open will be
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
227 ignored.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
228
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
229 ** Cleaned up Markup menu
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
230
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
231 The removed entries can be added with sgml-custom-markup:
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
232
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
233 (setq sgml-custom-markup
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
234 '(("<!entity ... >" "<!entity \r>\n")
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
235 ("<!attlist ... >" "<!attlist \r>\n")
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
236 ("<!element ... >" "<!element \r>\n")
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
237 ("<!doctype ...>" "<!doctype \r -- public or system --\n[\n]>\n")
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
238 ("Local variables comment" "<!--\nLocal variables:\n\rEnd:\n-->\n")
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
239 ("Comment" "<!-- \r -->\n") ))
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
240
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
241 ** New commands
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
242
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
243 Thanks to David Megginson the custom menus are now reachable from the
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
244 keyboard:
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
245
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
246 `C-c C-u C-d' (`sgml-custom-dtd')
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
247
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
248 `C-c C-u C-m' (`sgml-custom-markup')
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
249
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
250 * Changes to API
12
bcdc7deadc19 Import from CVS: tag r19-15b7
cvs
parents: 2
diff changeset
251
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
252 ** New hooks
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
253
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
254 *** `sgml-close-element-hook'
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
255
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
256 The hook run by `sgml-close-element'. These functions are invoked with
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
257 `sgml-current-tree' bound to the element just parsed.
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
258
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
259 *** `sgml-new-attribute-list-function'
70
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 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
262 attribute specification list. The default function prompts for the
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
263 required attributes.
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
264
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
265 *** `sgml-doctype-parsed-hook'
70
131b0175ea99 Import from CVS: tag r20-0b30
cvs
parents: 12
diff changeset
266
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
267 This hook is called after the doctype has been parsed. It can be used
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
268 to load any additional information into the DTD structure.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
269
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
270 Example: add description to element types
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
271
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
272 (defun set-help-info ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
273 (let ((help '(("para" "A Paragraph")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
274 ("q" "A Quotation")
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
275 ("date" "A Date")))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
276 (dtd (sgml-pstate-dtd sgml-buffer-parse-state)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
277 (loop for h in help do
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
278 (setf (sgml-eltype-appdata (sgml-lookup-eltype (first h) dtd)
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
279 'help-string)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
280 (second h)))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
281 (add-hook 'sgml-doctype-parsed-hook 'set-help-info)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
282 (defun sgml-help-for-element ()
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
283 (interactive)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
284 (let* ((el (sgml-find-element-of (point)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
285 (help (sgml-element-appdata el 'help-string)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
286 (and help
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
287 (message "%s" help))))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
288
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
289 *** sgml-sysid-resolve-functions
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
290
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
291 This variable should contain a list of functions. Each function should
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
292 take one argument, the system identifier of an entity. If the function
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
293 can handle that identifier, it should insert the text of the entity
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
294 into the current buffer at point and return t. If the system identifier
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
295 is not handled the function should return nil.
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
296
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
297 Example use: Support URLs as system identifiers
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
298
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
299 (defun sgml-url-sysid (sysid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
300 (cond ((string-match "^\\([a-z]+\\):" sysid) ; looks like url
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
301 (require 'url)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
302 (set-buffer (prog1 (current-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
303 (url-retrieve sysid)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
304 (insert-buffer url-working-buffer)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
305 t)))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
306 (add-hook 'sgml-sysid-resolve-functions 'sgml-url-sysid)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
307
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
308 ** New file psgml-api.el
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
309
78
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
310 This file contain API-functions that are not used by other parts of
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
311 psgml. Use `(require 'psgml-api)' to use the API functions (psgml-api
c7528f8e288d Import from CVS: tag r20-0b34
cvs
parents: 70
diff changeset
312 includes the rest of the psgml files).
2
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
313
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
314 Local variables:
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
315 mode: text
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
316 mode: outline
ac2d302a0011 Import from CVS: tag r19-15b2
cvs
parents: 0
diff changeset
317 end: