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