./psgml-1.4.0/ChangeLog0000640000076500000240000010062312016756307013052 0ustar dialout2012-08-27 Florian v. Savigny * psgml-debug.el, psgml-dtd.el: Changed name of sgml-reduce-, to sgml-reduce-comma, as the , seemed to cause a Lisp reader error. * psgml-debug.el, psgml-dtd.el, psgml-lucid.el, psgml-parse.el, psgml.el: Changed all backquote, comma, and comma-at constructs with surrounding parentheses to new-style constructs, whether fatal ('foo) or non-fatal (' foo). * psgml-parse.el, psgml.el: Removed fatal (make-local-hook ...) statements, which were redundant anyway, since the following (add-hook ...) statements all submit the optional 'local' argument. 2005-03-02 Lennart Staflin * psgml.el (sgml-mode-map): bind C-c C-s to new comman sgml-show-structure. Update autoloads. * psgml-edit.el (sgml-show-structure): new command (sgml-show-structure-insert, sgml-show-struct-element-p) (sgml-structure-elements): new functions 2005-02-27 Lennart Staflin * psgml.el (sgml-content-indent-function): moved (sgml-attribute-indent-function): moved * psgml-edit.el (sgml-show-context): use new option sgml-show-context-function. (sgml-show-context-standard, sgml-show-context-backslash): new functions for sgml-show-context-function (sgml-right-menu): new command for use on a mouse button * psgml.el (sgml-mode-map): bind C-c C-t to sgml-show-current-element-type (sgml-show-context-function): new option * psgml-edit.el (sgml-show-current-element-type): new command * psgml.el (sgml-mode-map): change C-c C-p to sgml-load-doctype * psgml-parse.el (sgml-load-doctype): make interactive, this is a more useful command than sgml-parse-prolog. * psgml-info.el (sgml-describe-dtd): rename sgml-general-dtd-info to sgml-describe-dtd. Keep old name as alias. * psgml-other.el (sgml-set-face-for): added face setting for content * psgml-parse.el (sgml--pi-element-handler): use sgml-parse-s not sgml-skip-ps. 2005-02-24 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): call sgml--pi-psgml-handler with end point of PI. (sgml--pi-psgml-handler): Take end point, and narrow buffer before parsing. 2005-02-17 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): apply sgml-general-case to sgml-default-doctype-name. 2005-02-09 Lennart Staflin * psgml.el (sgml-debug): remove sgml-log-message remove log related keybinding/menu entry * psgml-parse.el (sgml-compile-dtd, sgml-check-entities) (sgml-log-warning, sgml-error): remove sgml-log-message (sgml-entity-stack): new func * psgml-ids.el: New file (From: Jean-Daniel.Fekete) * psgml-edit.el: ID/IDREF patch (From: Jean-Daniel.Fekete) * psgml-maint.el: ID/IDREF patch (From: Jean-Daniel.Fekete) * psgml-parse.el: ID/IDREF patch (From: Jean-Daniel.Fekete) 2003-06-09 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): added some error checking for the has-seen-elements. 2003-03-28 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): new handling of processing instruction. (sgml--pi-psgml-handler): new func (sgml--pi-element-handler): new func. handles (sgml-psgml-pi-enable-outside-dtd): new variable. controls when is evaluated. 2003-03-27 Lennart Staflin * psgml-parse.el: fix wrong file name in error trace 2003-03-25 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): Modified to use unibyte-char-to-multibyte if enable-multibyte-characters. I hope this is correct. 2003-03-25 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): Modified to use unibyte-char-to-multibyte if enable-multibyte-characters. I hope this is correct. 2003-02-12 Lennart Staflin * psgml-parse.el (sgml-setup-doctype): add Predefined Entities for XML. 2003-01-24 Lennart Staflin * psgml-parse.el (sgml-do-move): undo wrong optimization, fix problem with non working exclusions. 2002-12-13 Lennart Staflin * Version 1.3.1 released 2002-09-19 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): Check if sgml-dtd-info is nil before trying to use it. 2002-08-13 Lennart Staflin * psgml-edit.el (sgml-edit-attrib-abort): new command (sgml-edit-attrib-mode-map): abort on key C-c C-k (sgml-attribute-buffer): include abort key in header line and use substitute-command-keys. (sgml-edit-attributes): move setting mode to sgml-attribute-buffer. * psgml-parse.el (sgml-open-element): add optional net-enabled parameter. (sgml-do-start-tag): use new parameter on sgml-open-element. Fixes bug with NET (tc17). * psgml-edit.el (sgml-edit-attrib-field-start, sgml-edit-attrib-clear, sgml-attribute-buffer, sgml-edit-attrib-specification-list): change sgml-category to category. Fix bug with edit attributes. (sgml-change-element-name): insert TAGC before finding new element object. Fix bug with change element name not copying attributes. 2002-05-08 Lennart Staflin * Version 1.3.0 released * psgml.el (sgml-default-nonsticky): moved from psgml-other.el 2002-05-07 Lennart Staflin * psgml-maint.el (psgml-common-files): add psgml-sysdep (psgml-find-source-dir): fix version 2002-04-26 Lennart Staflin * psgml.el (sgml-mode): make adding to text-property-default-nonsticky conditional on sgml-default-nonsticky to work with Emacs < 21. 2002-04-25 Lennart Staflin fixing merge of Dave Love's patch. 2002-02-08 Dave Love [Merging from 1.2.4 branch /lenst] Changes for various things: Useful DTD-less XML editing; avoiding CL at runtime; some Emacs portability; Mule-related fixes, particularly for non-ASCII names in DTD. * psgml-maint.el (psgml-find-source-dir): Fix version number. * psgml-info.el (sgml-set-difference, sgml-union): New functions. (sgml-eltype-refrenced-elements): Use them and also use add-to-list instead of pushnew. * psgml-dtd.el: Doc and message fixes. (sgml-write-dtd): Use sgml-set-buffer-multibyte and bind coding-system-for-write around write-region. (sgml-merge-attlists): Use copy-sequence, not copy-list. * psgml-edit.el: Require cl when compiling. Don't set byte-compile-warnings. (sgml-quote-attribute-value, sgml-tag-regexp) (sgml-edit-attrib-next): Use documented way of including `-' in regexp range. (sgml-change-start-tag, sgml-insert-attribute) (sgml-make-attrib-menu, sgml-menu-ask): Fix to work without a DTD. (sgml-edit-attrib-next, sgml-tag-regexp): Maybe allow non-ASCII. (sgml--all-possible-elements): Kludge for DTD-less case. (sgml-make-character-reference): Take care over multibyteness. Maybe deal with unicodes. (sgml-edit-attrib-specification-list, sgml-edit-attrib-default) (sgml-edit-attrib-default, sgml-edit-attrib-clear) (sgml-edit-attrib-field-start, sgml-attribute-buffer): Use property name `sgml-category', not `category', which is special in Emacs. [backed out //lenst] (sgml-operate-on-tags): Use sgml-restore-buffer-modified-p. * psgml-lucid.el (sgml-insert): Use property name `sgml-category', not `category'. [backed out //lenst] * psgml.el: Require cl only when compiling. Doc fixes. (sgml-mode): Set text-property-default-nonsticky. In Emacs, use which-fun-mode hook instead of trying to modify mode-line-format. : Maybe allow non-ASCII. (sgml-mode-map): Define unconditionally. [backed out //lenst] (sgml-running-lucid): Defconst, not defvar. (sgml-have-re-char-clases): New constant. (sgml-markup-faces): Default to font-lock faces if available. (sgml-start-tag-regex, sgml-close-angle): Allow non-ASCII if possible. (sgml-angle-distance, sgml-slash-distance): Defvar, not defconst, since it's a user variable. (sgml-restore-buffer-modified-p): New alias. (sgml-parse-colon-path): Use parse-colon-path, if available. [backed out, parse-colon-path is for directories //lenst] (sgml-command-post, sgml-mode): Assume make-local-hook exists. * psgml-parse.el: Doc and message fixes. (sgml-dtd-less): New buffer-local variable. (sgml-eltype-name, sgml-eltype-defined, sgml-eltype-token) (sgml-token-eltype, sgml-eltype-mixed, sgml-check-name) (sgml-element-etag-optional, sgml-element-mixed, sgml-parse-name): Avoid unnecessary compiler macros. (sgml-read-element-type, sgml-read-element-name): DTRT for non-nil sgml-dtd-less. (sgml-push-to-entity): Obey sgml-warn-about-undefined-entities. Don't make the buffer unibyte here. Ensure an old one is multibyte. (sgml-parse-prolog): Set sgml-dtd-less. (sgml-attdecl-default-value): Avoid caddr. (sgml-entity-marked-undefined-p): Avoid cddddr. Avoid (CL runtime) setter for nthcdr. (sgml-load-dtd): Avoid mapcan. (sgml-bdtd-load): Set buffer unibyte. (sgml-bdtd-merge): Don't set buffer unibyte here. (sgml-set-active-dtd-indicator): Set which-func-mode. (sgml-merge-eltypes): Use copy-sequence, not copy-list. (sgml-open-element-hook, sgml-close-element-hook) (sgml-map-eltypes): Remove redundant level of lambda. (sgml-entity-case, sgml-general-case): Moved before sgml-entity-case use. (sgml-update-display): Call force-mode-line-update. (sgml-parse-attribute-specification-list): Use sgml-dtd-less. * psgml-other.el (sgml-insert): Use plist-get rather than CL runtime's getf. (sgml-use-text-properties): Default to t. (sgml-with-modification-state): New macro. (sgml-default-nonsticky): New constant. (sgml-set-face-for): Use sgml-with-modification-state, sgml-default-nonsticky. (sgml-clear-faces): Avoid CL runtime. (next-overlay-at): Remove as consequence of above. * psgml-fs.el: Require cl and ps-print when compiling. (fs-do-style, fs-do-style, fs-do-style): Use plist-get rather than CL runtime's getf. (fs-element-with-id): Use compare-strings, not equalp. * psgml-dtd.el, psgml-charent.el, psgml-api.el, psgml-info.el: Require cl when compiling. * psgml-debug.el: Require cl, elp and edebug when compiling. 2002-04-19 Lennart Staflin * Version 1.2.5 released 2002-03-17 Lennart Staflin * psgml-api.el (sgml-map-content): don't try to map empty elements, no point and the code doesn't work for that case. 2002-02-13 Lennart Staflin * psgml.el (sgml-auto-insert-required-elements): doc fix. (sgml-balanced-tag-edit): doc fix. * psgml-edit.el (sgml-edit-attrib-default): don't make text read-only (sgml-insert-tag): doc fix. 2002-02-09 Lennart Staflin * psgml.el: Explicitly setup prefix keys (sgml-prefix-f-map): new var (sgml-prefix-u-map): new var 2002-02-08 Lennart Staflin * psgml-parse.el (sgml-set-buffer-multibyte): support setting to default (sgml-compile-dtd): removed sgml-set-buffer-multibyte, this is done by sgml-write-dtd (sgml-push-to-entity): reset buffer to default multibyte support * psgml-dtd.el (sgml-write-dtd): fixes for multibyte handling 2001-12-20 Lennart Staflin * psgml.el (sgml-xml-validate-command): new option. Default for sgml-validate-command in XML mode. (xml-mode): use sgml-xml-validate-command. (xml-mode): remove conditional. Always set sgml-declaration to sgml-xml-declaration. 2001-12-18 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Don't write-protect the "#DEFAULT" marker. (sgml-extract-attribute-value): strip any remains of "#DEFAULT". (sgml-edit-attrib-next): if point is before the attribute value, move to beginning of line to avoid skipping this attribute. 2001-12-16 Lennart Staflin * Version 1.2.4 released 2001-12-16 Lennart Staflin * psgml-info.el (sgml-eltype-refrenced-elements): use built-in function copy-sequence 2001-12-14 Lennart Staflin * psgml-parse.el (sgml-set-buffer-multibyte): Mule/multibyte patch from Yasushi Abe. (sgml-compile-dtd): dito. (sgml-bdtd-merge): dito. (sgml-push-to-entity): dito. (sgml-do-entity-ref): fix sgml-warn-about-undefined-entities behviour. 2001-12-06 Lennart Staflin * psgml-parse.el (sgml-update-display): take max-pos of top-tree not current-tree as that is not always defined at that point. 2001-11-09 Lennart Staflin * Version 1.2.3 released * psgml.el (sgml-running-lucid): make sure it gets defined during compilation. 2001-11-04 Lennart Staflin * psgml-other.el, psgml-parse.el, psgml-debug.el, psgml-edit.el: Fix the obsolete variable `before-change-function' and `after-change-function', which are no longer used by Emacs. 2001-02-10 Adrian Aichner * psgml-dtd.el: Fix typos. * psgml-edit.el: Ditto. * psgml-fs.el: Ditto. * psgml-info.el: Ditto. * psgml-parse.el: Ditto. * psgml.el: Ditto. Wed Feb 28 00:02:45 2001 Lennart Staflin * psgml-fs.el (fs-split-tokens): new helper function for use in style sheets. 2001-02-28 Lennart Staflin * psgml-other.el (sgml-split-long-menus): new (sgml-popup-menu): use above (sgml-popup-multi-menu): use above Wed Feb 21 23:30:07 2001 Lennart Staflin * psgml-parse.el (sgml-parse-to): remove debug code 2001-02-20 Lennart Staflin * psgml-dtd.el (sgml-check-content): check case of declared content name. (sgml-parse-exception): fix misspelled function name (sgml-declare-entity): Fix wrong case on symbols (sgml-parse-entity-type): for consistency, don't downcase entity type name (sgml-parse-entity-type): Remove case check and intern for notation name. Notation name will be stored as a string. * psgml-parse.el (sgml-push-to-entity): remove debugging code (sgml-set-initial-state): Change to use change hooks Fri Feb 9 01:06:27 2001 Lennart Staflin * Version 1.2.2 released * psgml.el (sgml-mode-map): Bind (meta control h) instead of ESC C-h, avoids redefining M-BS Thu Feb 8 20:08:47 2001 Lennart Staflin * psgml-info.el: Add provide psgml-info Sun Oct 22 17:29:53 2000 Marc-Antoine Parent * patch from Marc-Antoine Parent * psgml-edit.el (sgml-read-attribute-value): include the element name, thus: Value for {attribute name} in {element name} ({type} {Default}): 2000-10-11 Lennart Staflin * psgml-edit.el (sgml-indent-line): new strategy for identifying elements 2000-09-06 Lennart Staflin * psgml-api.el (sgml-map-content): Use sgml-with-parser-syntax-ro * psgml-parse.el (sgml-find-start-point): renamed to sgml-goto-start-point, to indicate that this actually changes the point and buffer. And should always be called inside sgml-with-parser-syntax. (sgml-with-parser-syntax-ro): As sgml-with-parser-syntax also handle restoring buffer modification state. (sgml-last-buffer): New state variable (sgml-with-parser-syntax): set sgml-last-buffer (sgml-mainbuf-point): new function (sgml-max-pos-in-tree): new function (sgml-update-display): don't call sgml-find-start-point, use sgml-max-pos-in-tree to figure out if there is much to parse. (sgml-parse-to): calls sgml-parser-loop directly no sgml-parse-continue. (sgml-parse-continue): use sgml-with-parser-syntax-ro and set-buffer to sgml-last-buffer. 2000-08-24 Lennart Staflin * psgml.el (sgml-insert-defaulted-attributes): new option * psgml-edit.el (sgml-insert-attributes): check new option * psgml-fs.el (style-format): set ps-left-header to include a style-sheet specified title and the filename. (for ps-print-buffer) (fs-special-styles): New special style 'title' for setting title. (fs-do-style): handle title style (fs-element-content): make element argument optional, defaults to current element. 2000-08-08 Lennart Staflin * psgml-edit.el (sgml-insert-element): Fix bug with empty element. Thu Aug 3 07:52:46 2000 Lennart Staflin * psgml-edit.el (sgml-insert-element): Fix bug when inserting element at end of buffer. 2000-08-03 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Fix missing space for unspecified required attributes. 2000-06-05 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): use buffer-substring-no-properties . 2000-05-31 Lennart Staflin * psgml-api.el (sgml-parse-data): Don't call sgml-parse-loop directly, use sgml-parse-continue. Sat May 27 00:04:31 2000 Lennart Staflin * psgml-edit.el (sgml-attr-clean-and-insert): new command. Used to automatically remove #DEFAULT when a character is typed. (sgml-attr-default-keymap): keymap used as only for #DEFAULT in attribute editing. Mon Apr 24 09:55:14 2000 Lennart Staflin * psgml-edit.el (sgml-complete): Transform case on inserted names using sgml-general-insert-case or sgml-entity-insert-case. Sun Apr 16 16:07:55 2000 Lennart Staflin * psgml-edit.el (sgml-indent-line): compute indentation from context, not element under point. Did this change once before but had to back it out. This time take care of omitted end-tags by choosing parent element as context, if point is at the very end of the element. Don't do special attribute indenting for elements that occur in data context. (sgml-fill-region): Fix giving up to early. (sgml-do-fill): indent tags of subelements in element context * psgml-info.el (sgml-describe-element-type): Use sgml-princ-names for occurs in section. 2000-03-22 Lennart Staflin * psgml-edit.el (sgml-change-element-name): Add end-tag event if original element is empty. (hmm this isn't quite right). Also use sgml-find-context-of to find element, because -element-of gives the element of the following char. Tue Jan 4 19:51:03 2000 Lennart Staflin * psgml-parse.el (sgml-with-parser-syntax): Restore current buffer before restoring syntax table. Tue Dec 21 20:50:31 1999 Lennart Staflin * psgml-other.el (sgml-set-face-for): set rear-nonsticky for face when sgml-use-text-properties is true. (Suggested by Dirk Frömbgen) Sat Dec 18 18:55:02 1999 Lennart Staflin * psgml-charent.el (sgml-charent-to-display-char): use buffer-substring-no-properties to allow for using text properties for fontification. 1999-11-02 Tim Bradshaw * psgml-edit.el (sgml-doctype-insert): made it not loop when it gets a bogus nil 1999-12-16 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): restore buffer modified after parsing. To allow using text properties for fontification. (sgml-parse-continue): dito. (sgml-parse-to): call sgml-parse-continue instead of calling sgml-parser-loop directly. 1999-12-15 Lennart Staflin * psgml.el: autoload for sgml-do-set-option 1999-12-03 Lennart Staflin * psgml.el (sgml-mode-syntax-table): new variable (sgml-mode): use sgml-mode-syntax-table 1999-11-29 Lennart Staflin * psgml.el (sgml-validate-error-regexps): Also recognize warnings (:W:) in output from nsgmls. 1999-11-11 Lennart Staflin * psgml-parse.el (sgml-parse-to): Let sgml-with-parser-syntax wrap a bigger chunk of the code to make sure the syntax table is set up before any buffer changes. Tue Nov 9 16:25:53 1999 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): use sgml-general-case on names from modifier. Mon Nov 8 22:13:12 1999 Lennart Staflin * psgml-info.el (sgml-eltype-refrenced-elements): Copy sequence before sorting destructively. (sgml-describe-element-type): Include exceptions in info display. Thu Nov 4 19:07:09 1999 Lennart Staflin * psgml-parse.el (sgml-note-change-at): If in XML mode and previous char is /, back up one char. This allows for the /> delimiter to be recognized even if the start tag has been previously parsed as an improperly ended tag. * psgml-edit.el (sgml-last-element): don't use sgml-last-element for XML (there is not omitted tags to account for). 1999-10-21 Lennart Staflin * psgml-parse.el (sgml-push-to-entity): restore the (erase-buffer) that had been commented out. This is needed for the case when sgml-try-merge-compiled-dtd fails and leaves junk in the buffer. 1999-10-19 Lennart Staflin * Version 1.2.1 released 1999-10-14 Lennart Staflin * psgml-parse.el (sgml-log-entity-stack): don't use sgml-pop-entity, just loop thru the entity stack and print out the files. (sgml-load-ecat): bind sgml-xml-p while parsing catalog 1999-10-13 Lennart Staflin * psgml-parse.el (sgml-current-file): New variable, holds the name of file name (if any) of the entity beeing parsed in the buffer. (sgml-parse-warning): New func. Log a parser warning, a warning including information about where the error occured. Mostly for DTD parsing. (sgml-log-entity-stack): new factored function. (*) Replaces some sgml-parse-error and sgml-log-warning with sgml-parse-warning. (sgml-parse-catalog-buffer): bind sgml-xml-p while parsing catalog Sun Oct 10 15:53:12 1999 Lennart Staflin * Version 1.2 released Wed Oct 6 00:43:37 1999 Lennart Staflin * Version 1.1.7 released * psgml-parse.el (sgml-push-to-entity): carry XML-ness to parsed text entities. * psgml-charent.el (sgml-display-char-list-filename): new default is "iso8859.map" in the same directory where psgml is installed. Wed Sep 22 19:34:08 1999 Lennart Staflin * psgml-edit.el: Apply sgml-general-case to attribute name for interactive sgml-insert-attribute. Don't test for non empty asl in sgml-edit-attrib. A lot of changes in handling text attributes when in attribute edit mode. Sat Aug 14 22:34:59 1999 Lennart Staflin * psgml-edit.el (sgml-tag-regexp): Recognize XMLs empty tags. 1998-11-16 Lennart Staflin * psgml.el (sgml-set-local-variable): insert "mode: xml" for xml-mode and "mode: sgml" otherwise * psgml-edit.el (sgml-add-element-to-element): add end-tag to empty xml-elements before inserting an element 1998-11-15 Lennart Staflin * Version 1.1.6 released * psgml-parse.el (sgml-char-int): from XEmacs (sgml-read-octet): modified for XEmacs (sgml-read-peek): dito. (sgml-read-number): dito. * psgml.el (sgml-option-value-indicator): moved here. (sgml-mode): activate-menubar-hook can't be local in XEmacs and sgml-build-custom-menus need to be after the easy-menu-adds. 1998-11-14 Lennart Staflin * psgml.el, psgml-edit.el: Fix from David Megginson to some regexps for _: in names. (sgml-build-custom-menus): Do not call easy-menu-change with empty menu. * psgml-edit.el (sgml-do-set-option): Don't modify the *Help* buffer directly, call sgml-append-to-help-buffer. Fixes problem with read-only buffer. (sgml-append-to-help-buffer): new func. * psgml.el (sgml-main-menu): Options handling changed after suggestion and code from Matthias Clasen (sgml-update-all-options-menus): new func. called by activate-menubar-hook Thu Nov 5 20:59:08 1998 Lennart Staflin * psgml-parse.el (sgml-parse-processing-instruction): removed let of sgml-markup-start. Was probably wrong solution to problem with sgml-markup-start beeing nil. Added in-declaration parameter. If in a declaration, no fontification should be done. (sgml-parse-prolog): do not call sgml-skip-ds, rather call parse-s, parse-pi as this is what "other prolog" contains. 1998-10-31 Lennart Staflin * Version 1.1.5 released * psgml-parse.el (sgml-declared-value-notation): change 'notation to 'NOTATION Sat Oct 31 20:00:22 1998 Lennart Staflin * psgml-parse.el (sgml-cache-catalog): Use file-truename for file-attributes, to get modification time from real file and not from symlink. * psgml.el (xml-mode): Do not build a syntax table (sgml-dtd-menu): moved Custom DTD's to submenu (sgml-markup-menu): moved Custom Markup to submenu (sgml-build-custom-menus): Make submenus for Custom DTD and Markup * psgml-parse.el (xml-parser-syntax): build special syntax table for XML. (sgml-with-parser-syntax): Use sgml-parser-syntax or xml-parser-syntax depending on sgml-xml-p Wed Oct 28 23:15:38 1998 Lennart Staflin * psgml-parse.el (sgml-read-element-type): use let (completion-ignore-case sgml-namecase-general) Sat Oct 24 13:13:48 1998 Lennart Staflin * psgml.el (sgml-build-custom-menus): Construct sub-menus for custom DTD and custom Markup insert, only if easy-menu-filter-return is not defined otherwise use the :filter facility to build menu when needed. * psgml-edit.el (sgml-what-element): Guard call to sgml-deref-shortmap 1998-10-20 Lennart Staflin * psgml-edit.el (sgml-edit-external-entity): fix from Matthias Clasen * psgml.el (sgml-validate-error-regexps): modify regexp to work in Emacs 20.3 1998-09-30 Lennart Staflin * Version 1.1.4 release Mon Aug 31 21:53:45 1998 Lennart Staflin * psgml-parse.el (sgml-bdtd-load): Increase version number (sgml-read-dtd): Increase version number * psgml-dtd.el (sgml-write-dtd): Increase version number Sat Aug 15 18:58:25 1998 Lennart Staflin * psgml-edit.el (sgml-complete): add completion of #-reserved words Fri Jul 3 18:14:21 1998 Lennart Staflin * Version 1.1.3 * Makefile.in: Call install with only one source file. Fri Jul 3 17:54:06 1998 Lennart Staflin * psgml-edit.el (sgml-complete): ignore case * psgml-parse.el (sgml-push-to-entity): use setf to set sgml-entity-marked-undefined-p. (setf sgml-entity-marked-undefined-p): define setf method Tue Jun 30 22:06:20 1998 Lennart Staflin * psgml-edit.el (sgml-do-set-option): Added file-list and file-or-nil types contributed by Matthias Clasen Tue Jun 30 21:48:39 1998 Lennart Staflin * psgml.el (sgml-mode-map): C-c C-i calls sgml-add-element-to-element * psgml-edit.el (sgml-add-element-to-element): New command. Wed Jun 24 23:23:38 1998 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Fixed another victim of the case change. (sgml-change-element-name): fix bug with empty XML element Mon Jun 22 19:58:43 1998 Lennart Staflin * psgml.el (psgml-version): Version 1.1.2 * Installed patch from Matthias Clasen . Adding notation to entities and a sgml-notation-handlers variable used by sgml-edit-external-entity. * psgml-edit.el (sgml-indent-line): Previous change of sgml-indent-line did not work well with OMITTAG. Restore old functionallity. Fri Jun 19 18:54:27 1998 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): changed case of default value type, here and in many other functions. (sgml-translate-attribute-specification-list): changed case for declared value * psgml-parse.el (sgml-parse-attribute-specification-list): changed case of default value type 1998-06-16 Dave Love * psgml-edit.el (sgml-read-element-name, sgml-read-attribute-value, sgml-insert-attribute, sgml-custom-markup): Use sgml-namecase-general to set completion-ignore-case. 1998-06-16 Dave Love * psgml-parse.el (sgml-push-to-entity): Don't use save-excursion around insert-file-contents -- may break in Emacs 20.3. Fri Jun 19 10:40:53 1998 Lennart Staflin * psgml-dtd.el (sgml-check-declared-value): upcase NOTATION * psgml-parse.el (sgml-read-element-name): bind completion-ignore-case as suggested by Mark Eichin. Also present element names in the insert case. Tue Jun 16 00:31:03 1998 Lennart Staflin * psgml.el (sgml-command-post): added ignore-errors * psgml-parse.el (sgml-get-delim-string): new func. (sgml-delim): changed to macro. (sgml-do-usemap): upcase #EMPTY (sgml-parse-xml-comment): set markup type * psgml-dtd.el (sgml-validate-default-value-rn): upcase keywords (sgml-declare-entity): remove case fiddling * psgml-parse.el (sgml-check-case): remove case fiddling -- retain check. * psgml-dtd.el (sgml-validate-declared-value): upcase attribute types (sgml-check-default-value): remove case fiddling -- reserved names should be in upper case. * psgml-parse.el (sgml-push-to-entity): use syntax table from current buffer in entity buffer and not the sgml-parser-syntax as XML will use another syntax table. Wed Jun 10 23:28:42 1998 Lennart Staflin * psgml-parse.el (sgml-catalog-lookup): Take additional catalogs in right order. Thu May 14 20:02:42 1998 Lennart Staflin * Version 1.1.1 * psgml.el (psgml-version): new version 1.1.1 * psgml-dtd.el (sgml-parse-character-reference): upcase funchar names. * psgml-edit.el (sgml-indent-line): compute indentation from context, not element under point. Removed special handling of start-tag and document context. Extra indentation if in markup. * psgml-parse.el (sgml-parse-external): use upper case keywords. (sgml-check-case): use upper case instead of lower case. Wed May 13 06:13:05 1998 Lennart Staflin * psgml-parse.el (sgml-do-marked-section): Change keyword strings to upper case. (sgml-general-case): Use Upcase instead of Downcase. (sgml-parse-markup-declaration): upcase keywords. Sat Mar 14 21:31:09 1998 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): Added recognition of PSGML NOFILL. (sgml-parse-catalog-buffer): add catalog as a noname entry (sgml-catalog-lookup): handle catalog entries Thu Mar 12 00:04:52 1998 Lennart Staflin * psgml-parse.el (sgml-current-element-name): make buffer local Wed Mar 11 22:11:01 1998 Lennart Staflin * psgml-edit.el (sgml-insert-start-tag): extended meaning of NET paramenter to insert XML-TAGCE if XML. (sgml-change-start-tag): keep XML-TAGCE * psgml-parse.el (sgml-read-element-name): use completing read on all defined element types if in an ANY context. (sgml-check-tag-close): removed check for XML-TAGCE (sgml-do-start-tag): added check for XML-TAGCE (sgml-element-empty): In XML no special handling of elements with declared content of EMPTY, but use conref to signal empty element tag. * psgml-dtd.el (sgml-merge-attlists): reverse the list Tue Mar 10 20:13:11 1998 Lennart Staflin * psgml.el: Merged David Megginson's latest xml modifications. Sat Nov 15 20:50:35 1997 Lennart Staflin * psgml-parse.el (sgml-parse-attribute-value-specification): New func. (sgml-parse-attribute-specification-list): use new func. This changes an error to a warning to make better error recovery when illegal characters occurs in starttag. Sun Aug 17 20:22:28 1997 Lennart Staflin * psgml-parse.el (sgml-cache-catalog): remove file-truename. This made relative filenames refer to the wrong directory if the catalog file was a symlink. Thu Jul 24 22:36:15 1997 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): fixed bug in handling sgml-parent-document. Mon May 19 18:43:32 1997 Lennart Staflin * psgml-edit.el (sgml-expand-entity-reference): changed to allow point to be within entity referens, not only at start of ref. As suggested by Matthias Clasen. (sgml-edit-external-entity): new command contributed by Matthias Clasen * psgml-charent.el (sgml-charent-to-display-char): fix bug in regexp. Sat Mar 15 19:20:57 1997 Lennart Staflin * psgml-parse.el (sgml-check-tag-close): change sgml-error to sgml-log-warning Sun Jan 12 19:15:32 1997 Lennart Staflin * psgml.el (psgml-version): bump version Fri Nov 22 20:29:44 1996 Lennart Staflin * psgml.el (sgml-parse-colon-path): use path-separator if available. ./psgml-1.4.0/ChangeLog~0000640000076500000240000010033212016750013013231 0ustar dialout2012-08-27 Florian v. Savigny * psgml-debug.el, psgml-dtd.el: Changed name of sgml-reduce-, to sgml-reduce-comma, as the , seemed to be responsible for a Lisp reader error. * psgml-debug.el, psgml-dtd.el, psgml-lucid.el, psgml-parse.el, psgml.el: Changed all backquote, comma, and comma-at constructs with surrounding parentheses to new-style constructs, whether fatal ('foo) or non-fatal (' foo). 2005-03-02 Lennart Staflin * psgml.el (sgml-mode-map): bind C-c C-s to new comman sgml-show-structure. Update autoloads. * psgml-edit.el (sgml-show-structure): new command (sgml-show-structure-insert, sgml-show-struct-element-p) (sgml-structure-elements): new functions 2005-02-27 Lennart Staflin * psgml.el (sgml-content-indent-function): moved (sgml-attribute-indent-function): moved * psgml-edit.el (sgml-show-context): use new option sgml-show-context-function. (sgml-show-context-standard, sgml-show-context-backslash): new functions for sgml-show-context-function (sgml-right-menu): new command for use on a mouse button * psgml.el (sgml-mode-map): bind C-c C-t to sgml-show-current-element-type (sgml-show-context-function): new option * psgml-edit.el (sgml-show-current-element-type): new command * psgml.el (sgml-mode-map): change C-c C-p to sgml-load-doctype * psgml-parse.el (sgml-load-doctype): make interactive, this is a more useful command than sgml-parse-prolog. * psgml-info.el (sgml-describe-dtd): rename sgml-general-dtd-info to sgml-describe-dtd. Keep old name as alias. * psgml-other.el (sgml-set-face-for): added face setting for content * psgml-parse.el (sgml--pi-element-handler): use sgml-parse-s not sgml-skip-ps. 2005-02-24 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): call sgml--pi-psgml-handler with end point of PI. (sgml--pi-psgml-handler): Take end point, and narrow buffer before parsing. 2005-02-17 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): apply sgml-general-case to sgml-default-doctype-name. 2005-02-09 Lennart Staflin * psgml.el (sgml-debug): remove sgml-log-message remove log related keybinding/menu entry * psgml-parse.el (sgml-compile-dtd, sgml-check-entities) (sgml-log-warning, sgml-error): remove sgml-log-message (sgml-entity-stack): new func * psgml-ids.el: New file (From: Jean-Daniel.Fekete) * psgml-edit.el: ID/IDREF patch (From: Jean-Daniel.Fekete) * psgml-maint.el: ID/IDREF patch (From: Jean-Daniel.Fekete) * psgml-parse.el: ID/IDREF patch (From: Jean-Daniel.Fekete) 2003-06-09 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): added some error checking for the has-seen-elements. 2003-03-28 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): new handling of processing instruction. (sgml--pi-psgml-handler): new func (sgml--pi-element-handler): new func. handles (sgml-psgml-pi-enable-outside-dtd): new variable. controls when is evaluated. 2003-03-27 Lennart Staflin * psgml-parse.el: fix wrong file name in error trace 2003-03-25 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): Modified to use unibyte-char-to-multibyte if enable-multibyte-characters. I hope this is correct. 2003-03-25 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): Modified to use unibyte-char-to-multibyte if enable-multibyte-characters. I hope this is correct. 2003-02-12 Lennart Staflin * psgml-parse.el (sgml-setup-doctype): add Predefined Entities for XML. 2003-01-24 Lennart Staflin * psgml-parse.el (sgml-do-move): undo wrong optimization, fix problem with non working exclusions. 2002-12-13 Lennart Staflin * Version 1.3.1 released 2002-09-19 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): Check if sgml-dtd-info is nil before trying to use it. 2002-08-13 Lennart Staflin * psgml-edit.el (sgml-edit-attrib-abort): new command (sgml-edit-attrib-mode-map): abort on key C-c C-k (sgml-attribute-buffer): include abort key in header line and use substitute-command-keys. (sgml-edit-attributes): move setting mode to sgml-attribute-buffer. * psgml-parse.el (sgml-open-element): add optional net-enabled parameter. (sgml-do-start-tag): use new parameter on sgml-open-element. Fixes bug with NET (tc17). * psgml-edit.el (sgml-edit-attrib-field-start, sgml-edit-attrib-clear, sgml-attribute-buffer, sgml-edit-attrib-specification-list): change sgml-category to category. Fix bug with edit attributes. (sgml-change-element-name): insert TAGC before finding new element object. Fix bug with change element name not copying attributes. 2002-05-08 Lennart Staflin * Version 1.3.0 released * psgml.el (sgml-default-nonsticky): moved from psgml-other.el 2002-05-07 Lennart Staflin * psgml-maint.el (psgml-common-files): add psgml-sysdep (psgml-find-source-dir): fix version 2002-04-26 Lennart Staflin * psgml.el (sgml-mode): make adding to text-property-default-nonsticky conditional on sgml-default-nonsticky to work with Emacs < 21. 2002-04-25 Lennart Staflin fixing merge of Dave Love's patch. 2002-02-08 Dave Love [Merging from 1.2.4 branch /lenst] Changes for various things: Useful DTD-less XML editing; avoiding CL at runtime; some Emacs portability; Mule-related fixes, particularly for non-ASCII names in DTD. * psgml-maint.el (psgml-find-source-dir): Fix version number. * psgml-info.el (sgml-set-difference, sgml-union): New functions. (sgml-eltype-refrenced-elements): Use them and also use add-to-list instead of pushnew. * psgml-dtd.el: Doc and message fixes. (sgml-write-dtd): Use sgml-set-buffer-multibyte and bind coding-system-for-write around write-region. (sgml-merge-attlists): Use copy-sequence, not copy-list. * psgml-edit.el: Require cl when compiling. Don't set byte-compile-warnings. (sgml-quote-attribute-value, sgml-tag-regexp) (sgml-edit-attrib-next): Use documented way of including `-' in regexp range. (sgml-change-start-tag, sgml-insert-attribute) (sgml-make-attrib-menu, sgml-menu-ask): Fix to work without a DTD. (sgml-edit-attrib-next, sgml-tag-regexp): Maybe allow non-ASCII. (sgml--all-possible-elements): Kludge for DTD-less case. (sgml-make-character-reference): Take care over multibyteness. Maybe deal with unicodes. (sgml-edit-attrib-specification-list, sgml-edit-attrib-default) (sgml-edit-attrib-default, sgml-edit-attrib-clear) (sgml-edit-attrib-field-start, sgml-attribute-buffer): Use property name `sgml-category', not `category', which is special in Emacs. [backed out //lenst] (sgml-operate-on-tags): Use sgml-restore-buffer-modified-p. * psgml-lucid.el (sgml-insert): Use property name `sgml-category', not `category'. [backed out //lenst] * psgml.el: Require cl only when compiling. Doc fixes. (sgml-mode): Set text-property-default-nonsticky. In Emacs, use which-fun-mode hook instead of trying to modify mode-line-format. : Maybe allow non-ASCII. (sgml-mode-map): Define unconditionally. [backed out //lenst] (sgml-running-lucid): Defconst, not defvar. (sgml-have-re-char-clases): New constant. (sgml-markup-faces): Default to font-lock faces if available. (sgml-start-tag-regex, sgml-close-angle): Allow non-ASCII if possible. (sgml-angle-distance, sgml-slash-distance): Defvar, not defconst, since it's a user variable. (sgml-restore-buffer-modified-p): New alias. (sgml-parse-colon-path): Use parse-colon-path, if available. [backed out, parse-colon-path is for directories //lenst] (sgml-command-post, sgml-mode): Assume make-local-hook exists. * psgml-parse.el: Doc and message fixes. (sgml-dtd-less): New buffer-local variable. (sgml-eltype-name, sgml-eltype-defined, sgml-eltype-token) (sgml-token-eltype, sgml-eltype-mixed, sgml-check-name) (sgml-element-etag-optional, sgml-element-mixed, sgml-parse-name): Avoid unnecessary compiler macros. (sgml-read-element-type, sgml-read-element-name): DTRT for non-nil sgml-dtd-less. (sgml-push-to-entity): Obey sgml-warn-about-undefined-entities. Don't make the buffer unibyte here. Ensure an old one is multibyte. (sgml-parse-prolog): Set sgml-dtd-less. (sgml-attdecl-default-value): Avoid caddr. (sgml-entity-marked-undefined-p): Avoid cddddr. Avoid (CL runtime) setter for nthcdr. (sgml-load-dtd): Avoid mapcan. (sgml-bdtd-load): Set buffer unibyte. (sgml-bdtd-merge): Don't set buffer unibyte here. (sgml-set-active-dtd-indicator): Set which-func-mode. (sgml-merge-eltypes): Use copy-sequence, not copy-list. (sgml-open-element-hook, sgml-close-element-hook) (sgml-map-eltypes): Remove redundant level of lambda. (sgml-entity-case, sgml-general-case): Moved before sgml-entity-case use. (sgml-update-display): Call force-mode-line-update. (sgml-parse-attribute-specification-list): Use sgml-dtd-less. * psgml-other.el (sgml-insert): Use plist-get rather than CL runtime's getf. (sgml-use-text-properties): Default to t. (sgml-with-modification-state): New macro. (sgml-default-nonsticky): New constant. (sgml-set-face-for): Use sgml-with-modification-state, sgml-default-nonsticky. (sgml-clear-faces): Avoid CL runtime. (next-overlay-at): Remove as consequence of above. * psgml-fs.el: Require cl and ps-print when compiling. (fs-do-style, fs-do-style, fs-do-style): Use plist-get rather than CL runtime's getf. (fs-element-with-id): Use compare-strings, not equalp. * psgml-dtd.el, psgml-charent.el, psgml-api.el, psgml-info.el: Require cl when compiling. * psgml-debug.el: Require cl, elp and edebug when compiling. 2002-04-19 Lennart Staflin * Version 1.2.5 released 2002-03-17 Lennart Staflin * psgml-api.el (sgml-map-content): don't try to map empty elements, no point and the code doesn't work for that case. 2002-02-13 Lennart Staflin * psgml.el (sgml-auto-insert-required-elements): doc fix. (sgml-balanced-tag-edit): doc fix. * psgml-edit.el (sgml-edit-attrib-default): don't make text read-only (sgml-insert-tag): doc fix. 2002-02-09 Lennart Staflin * psgml.el: Explicitly setup prefix keys (sgml-prefix-f-map): new var (sgml-prefix-u-map): new var 2002-02-08 Lennart Staflin * psgml-parse.el (sgml-set-buffer-multibyte): support setting to default (sgml-compile-dtd): removed sgml-set-buffer-multibyte, this is done by sgml-write-dtd (sgml-push-to-entity): reset buffer to default multibyte support * psgml-dtd.el (sgml-write-dtd): fixes for multibyte handling 2001-12-20 Lennart Staflin * psgml.el (sgml-xml-validate-command): new option. Default for sgml-validate-command in XML mode. (xml-mode): use sgml-xml-validate-command. (xml-mode): remove conditional. Always set sgml-declaration to sgml-xml-declaration. 2001-12-18 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Don't write-protect the "#DEFAULT" marker. (sgml-extract-attribute-value): strip any remains of "#DEFAULT". (sgml-edit-attrib-next): if point is before the attribute value, move to beginning of line to avoid skipping this attribute. 2001-12-16 Lennart Staflin * Version 1.2.4 released 2001-12-16 Lennart Staflin * psgml-info.el (sgml-eltype-refrenced-elements): use built-in function copy-sequence 2001-12-14 Lennart Staflin * psgml-parse.el (sgml-set-buffer-multibyte): Mule/multibyte patch from Yasushi Abe. (sgml-compile-dtd): dito. (sgml-bdtd-merge): dito. (sgml-push-to-entity): dito. (sgml-do-entity-ref): fix sgml-warn-about-undefined-entities behviour. 2001-12-06 Lennart Staflin * psgml-parse.el (sgml-update-display): take max-pos of top-tree not current-tree as that is not always defined at that point. 2001-11-09 Lennart Staflin * Version 1.2.3 released * psgml.el (sgml-running-lucid): make sure it gets defined during compilation. 2001-11-04 Lennart Staflin * psgml-other.el, psgml-parse.el, psgml-debug.el, psgml-edit.el: Fix the obsolete variable `before-change-function' and `after-change-function', which are no longer used by Emacs. 2001-02-10 Adrian Aichner * psgml-dtd.el: Fix typos. * psgml-edit.el: Ditto. * psgml-fs.el: Ditto. * psgml-info.el: Ditto. * psgml-parse.el: Ditto. * psgml.el: Ditto. Wed Feb 28 00:02:45 2001 Lennart Staflin * psgml-fs.el (fs-split-tokens): new helper function for use in style sheets. 2001-02-28 Lennart Staflin * psgml-other.el (sgml-split-long-menus): new (sgml-popup-menu): use above (sgml-popup-multi-menu): use above Wed Feb 21 23:30:07 2001 Lennart Staflin * psgml-parse.el (sgml-parse-to): remove debug code 2001-02-20 Lennart Staflin * psgml-dtd.el (sgml-check-content): check case of declared content name. (sgml-parse-exception): fix misspelled function name (sgml-declare-entity): Fix wrong case on symbols (sgml-parse-entity-type): for consistency, don't downcase entity type name (sgml-parse-entity-type): Remove case check and intern for notation name. Notation name will be stored as a string. * psgml-parse.el (sgml-push-to-entity): remove debugging code (sgml-set-initial-state): Change to use change hooks Fri Feb 9 01:06:27 2001 Lennart Staflin * Version 1.2.2 released * psgml.el (sgml-mode-map): Bind (meta control h) instead of ESC C-h, avoids redefining M-BS Thu Feb 8 20:08:47 2001 Lennart Staflin * psgml-info.el: Add provide psgml-info Sun Oct 22 17:29:53 2000 Marc-Antoine Parent * patch from Marc-Antoine Parent * psgml-edit.el (sgml-read-attribute-value): include the element name, thus: Value for {attribute name} in {element name} ({type} {Default}): 2000-10-11 Lennart Staflin * psgml-edit.el (sgml-indent-line): new strategy for identifying elements 2000-09-06 Lennart Staflin * psgml-api.el (sgml-map-content): Use sgml-with-parser-syntax-ro * psgml-parse.el (sgml-find-start-point): renamed to sgml-goto-start-point, to indicate that this actually changes the point and buffer. And should always be called inside sgml-with-parser-syntax. (sgml-with-parser-syntax-ro): As sgml-with-parser-syntax also handle restoring buffer modification state. (sgml-last-buffer): New state variable (sgml-with-parser-syntax): set sgml-last-buffer (sgml-mainbuf-point): new function (sgml-max-pos-in-tree): new function (sgml-update-display): don't call sgml-find-start-point, use sgml-max-pos-in-tree to figure out if there is much to parse. (sgml-parse-to): calls sgml-parser-loop directly no sgml-parse-continue. (sgml-parse-continue): use sgml-with-parser-syntax-ro and set-buffer to sgml-last-buffer. 2000-08-24 Lennart Staflin * psgml.el (sgml-insert-defaulted-attributes): new option * psgml-edit.el (sgml-insert-attributes): check new option * psgml-fs.el (style-format): set ps-left-header to include a style-sheet specified title and the filename. (for ps-print-buffer) (fs-special-styles): New special style 'title' for setting title. (fs-do-style): handle title style (fs-element-content): make element argument optional, defaults to current element. 2000-08-08 Lennart Staflin * psgml-edit.el (sgml-insert-element): Fix bug with empty element. Thu Aug 3 07:52:46 2000 Lennart Staflin * psgml-edit.el (sgml-insert-element): Fix bug when inserting element at end of buffer. 2000-08-03 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Fix missing space for unspecified required attributes. 2000-06-05 Lennart Staflin * psgml-dtd.el (sgml-parse-parameter-literal): use buffer-substring-no-properties . 2000-05-31 Lennart Staflin * psgml-api.el (sgml-parse-data): Don't call sgml-parse-loop directly, use sgml-parse-continue. Sat May 27 00:04:31 2000 Lennart Staflin * psgml-edit.el (sgml-attr-clean-and-insert): new command. Used to automatically remove #DEFAULT when a character is typed. (sgml-attr-default-keymap): keymap used as only for #DEFAULT in attribute editing. Mon Apr 24 09:55:14 2000 Lennart Staflin * psgml-edit.el (sgml-complete): Transform case on inserted names using sgml-general-insert-case or sgml-entity-insert-case. Sun Apr 16 16:07:55 2000 Lennart Staflin * psgml-edit.el (sgml-indent-line): compute indentation from context, not element under point. Did this change once before but had to back it out. This time take care of omitted end-tags by choosing parent element as context, if point is at the very end of the element. Don't do special attribute indenting for elements that occur in data context. (sgml-fill-region): Fix giving up to early. (sgml-do-fill): indent tags of subelements in element context * psgml-info.el (sgml-describe-element-type): Use sgml-princ-names for occurs in section. 2000-03-22 Lennart Staflin * psgml-edit.el (sgml-change-element-name): Add end-tag event if original element is empty. (hmm this isn't quite right). Also use sgml-find-context-of to find element, because -element-of gives the element of the following char. Tue Jan 4 19:51:03 2000 Lennart Staflin * psgml-parse.el (sgml-with-parser-syntax): Restore current buffer before restoring syntax table. Tue Dec 21 20:50:31 1999 Lennart Staflin * psgml-other.el (sgml-set-face-for): set rear-nonsticky for face when sgml-use-text-properties is true. (Suggested by Dirk Frömbgen) Sat Dec 18 18:55:02 1999 Lennart Staflin * psgml-charent.el (sgml-charent-to-display-char): use buffer-substring-no-properties to allow for using text properties for fontification. 1999-11-02 Tim Bradshaw * psgml-edit.el (sgml-doctype-insert): made it not loop when it gets a bogus nil 1999-12-16 Lennart Staflin * psgml-parse.el (sgml-parse-prolog): restore buffer modified after parsing. To allow using text properties for fontification. (sgml-parse-continue): dito. (sgml-parse-to): call sgml-parse-continue instead of calling sgml-parser-loop directly. 1999-12-15 Lennart Staflin * psgml.el: autoload for sgml-do-set-option 1999-12-03 Lennart Staflin * psgml.el (sgml-mode-syntax-table): new variable (sgml-mode): use sgml-mode-syntax-table 1999-11-29 Lennart Staflin * psgml.el (sgml-validate-error-regexps): Also recognize warnings (:W:) in output from nsgmls. 1999-11-11 Lennart Staflin * psgml-parse.el (sgml-parse-to): Let sgml-with-parser-syntax wrap a bigger chunk of the code to make sure the syntax table is set up before any buffer changes. Tue Nov 9 16:25:53 1999 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): use sgml-general-case on names from modifier. Mon Nov 8 22:13:12 1999 Lennart Staflin * psgml-info.el (sgml-eltype-refrenced-elements): Copy sequence before sorting destructively. (sgml-describe-element-type): Include exceptions in info display. Thu Nov 4 19:07:09 1999 Lennart Staflin * psgml-parse.el (sgml-note-change-at): If in XML mode and previous char is /, back up one char. This allows for the /> delimiter to be recognized even if the start tag has been previously parsed as an improperly ended tag. * psgml-edit.el (sgml-last-element): don't use sgml-last-element for XML (there is not omitted tags to account for). 1999-10-21 Lennart Staflin * psgml-parse.el (sgml-push-to-entity): restore the (erase-buffer) that had been commented out. This is needed for the case when sgml-try-merge-compiled-dtd fails and leaves junk in the buffer. 1999-10-19 Lennart Staflin * Version 1.2.1 released 1999-10-14 Lennart Staflin * psgml-parse.el (sgml-log-entity-stack): don't use sgml-pop-entity, just loop thru the entity stack and print out the files. (sgml-load-ecat): bind sgml-xml-p while parsing catalog 1999-10-13 Lennart Staflin * psgml-parse.el (sgml-current-file): New variable, holds the name of file name (if any) of the entity beeing parsed in the buffer. (sgml-parse-warning): New func. Log a parser warning, a warning including information about where the error occured. Mostly for DTD parsing. (sgml-log-entity-stack): new factored function. (*) Replaces some sgml-parse-error and sgml-log-warning with sgml-parse-warning. (sgml-parse-catalog-buffer): bind sgml-xml-p while parsing catalog Sun Oct 10 15:53:12 1999 Lennart Staflin * Version 1.2 released Wed Oct 6 00:43:37 1999 Lennart Staflin * Version 1.1.7 released * psgml-parse.el (sgml-push-to-entity): carry XML-ness to parsed text entities. * psgml-charent.el (sgml-display-char-list-filename): new default is "iso8859.map" in the same directory where psgml is installed. Wed Sep 22 19:34:08 1999 Lennart Staflin * psgml-edit.el: Apply sgml-general-case to attribute name for interactive sgml-insert-attribute. Don't test for non empty asl in sgml-edit-attrib. A lot of changes in handling text attributes when in attribute edit mode. Sat Aug 14 22:34:59 1999 Lennart Staflin * psgml-edit.el (sgml-tag-regexp): Recognize XMLs empty tags. 1998-11-16 Lennart Staflin * psgml.el (sgml-set-local-variable): insert "mode: xml" for xml-mode and "mode: sgml" otherwise * psgml-edit.el (sgml-add-element-to-element): add end-tag to empty xml-elements before inserting an element 1998-11-15 Lennart Staflin * Version 1.1.6 released * psgml-parse.el (sgml-char-int): from XEmacs (sgml-read-octet): modified for XEmacs (sgml-read-peek): dito. (sgml-read-number): dito. * psgml.el (sgml-option-value-indicator): moved here. (sgml-mode): activate-menubar-hook can't be local in XEmacs and sgml-build-custom-menus need to be after the easy-menu-adds. 1998-11-14 Lennart Staflin * psgml.el, psgml-edit.el: Fix from David Megginson to some regexps for _: in names. (sgml-build-custom-menus): Do not call easy-menu-change with empty menu. * psgml-edit.el (sgml-do-set-option): Don't modify the *Help* buffer directly, call sgml-append-to-help-buffer. Fixes problem with read-only buffer. (sgml-append-to-help-buffer): new func. * psgml.el (sgml-main-menu): Options handling changed after suggestion and code from Matthias Clasen (sgml-update-all-options-menus): new func. called by activate-menubar-hook Thu Nov 5 20:59:08 1998 Lennart Staflin * psgml-parse.el (sgml-parse-processing-instruction): removed let of sgml-markup-start. Was probably wrong solution to problem with sgml-markup-start beeing nil. Added in-declaration parameter. If in a declaration, no fontification should be done. (sgml-parse-prolog): do not call sgml-skip-ds, rather call parse-s, parse-pi as this is what "other prolog" contains. 1998-10-31 Lennart Staflin * Version 1.1.5 released * psgml-parse.el (sgml-declared-value-notation): change 'notation to 'NOTATION Sat Oct 31 20:00:22 1998 Lennart Staflin * psgml-parse.el (sgml-cache-catalog): Use file-truename for file-attributes, to get modification time from real file and not from symlink. * psgml.el (xml-mode): Do not build a syntax table (sgml-dtd-menu): moved Custom DTD's to submenu (sgml-markup-menu): moved Custom Markup to submenu (sgml-build-custom-menus): Make submenus for Custom DTD and Markup * psgml-parse.el (xml-parser-syntax): build special syntax table for XML. (sgml-with-parser-syntax): Use sgml-parser-syntax or xml-parser-syntax depending on sgml-xml-p Wed Oct 28 23:15:38 1998 Lennart Staflin * psgml-parse.el (sgml-read-element-type): use let (completion-ignore-case sgml-namecase-general) Sat Oct 24 13:13:48 1998 Lennart Staflin * psgml.el (sgml-build-custom-menus): Construct sub-menus for custom DTD and custom Markup insert, only if easy-menu-filter-return is not defined otherwise use the :filter facility to build menu when needed. * psgml-edit.el (sgml-what-element): Guard call to sgml-deref-shortmap 1998-10-20 Lennart Staflin * psgml-edit.el (sgml-edit-external-entity): fix from Matthias Clasen * psgml.el (sgml-validate-error-regexps): modify regexp to work in Emacs 20.3 1998-09-30 Lennart Staflin * Version 1.1.4 release Mon Aug 31 21:53:45 1998 Lennart Staflin * psgml-parse.el (sgml-bdtd-load): Increase version number (sgml-read-dtd): Increase version number * psgml-dtd.el (sgml-write-dtd): Increase version number Sat Aug 15 18:58:25 1998 Lennart Staflin * psgml-edit.el (sgml-complete): add completion of #-reserved words Fri Jul 3 18:14:21 1998 Lennart Staflin * Version 1.1.3 * Makefile.in: Call install with only one source file. Fri Jul 3 17:54:06 1998 Lennart Staflin * psgml-edit.el (sgml-complete): ignore case * psgml-parse.el (sgml-push-to-entity): use setf to set sgml-entity-marked-undefined-p. (setf sgml-entity-marked-undefined-p): define setf method Tue Jun 30 22:06:20 1998 Lennart Staflin * psgml-edit.el (sgml-do-set-option): Added file-list and file-or-nil types contributed by Matthias Clasen Tue Jun 30 21:48:39 1998 Lennart Staflin * psgml.el (sgml-mode-map): C-c C-i calls sgml-add-element-to-element * psgml-edit.el (sgml-add-element-to-element): New command. Wed Jun 24 23:23:38 1998 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): Fixed another victim of the case change. (sgml-change-element-name): fix bug with empty XML element Mon Jun 22 19:58:43 1998 Lennart Staflin * psgml.el (psgml-version): Version 1.1.2 * Installed patch from Matthias Clasen . Adding notation to entities and a sgml-notation-handlers variable used by sgml-edit-external-entity. * psgml-edit.el (sgml-indent-line): Previous change of sgml-indent-line did not work well with OMITTAG. Restore old functionallity. Fri Jun 19 18:54:27 1998 Lennart Staflin * psgml-edit.el (sgml-attribute-buffer): changed case of default value type, here and in many other functions. (sgml-translate-attribute-specification-list): changed case for declared value * psgml-parse.el (sgml-parse-attribute-specification-list): changed case of default value type 1998-06-16 Dave Love * psgml-edit.el (sgml-read-element-name, sgml-read-attribute-value, sgml-insert-attribute, sgml-custom-markup): Use sgml-namecase-general to set completion-ignore-case. 1998-06-16 Dave Love * psgml-parse.el (sgml-push-to-entity): Don't use save-excursion around insert-file-contents -- may break in Emacs 20.3. Fri Jun 19 10:40:53 1998 Lennart Staflin * psgml-dtd.el (sgml-check-declared-value): upcase NOTATION * psgml-parse.el (sgml-read-element-name): bind completion-ignore-case as suggested by Mark Eichin. Also present element names in the insert case. Tue Jun 16 00:31:03 1998 Lennart Staflin * psgml.el (sgml-command-post): added ignore-errors * psgml-parse.el (sgml-get-delim-string): new func. (sgml-delim): changed to macro. (sgml-do-usemap): upcase #EMPTY (sgml-parse-xml-comment): set markup type * psgml-dtd.el (sgml-validate-default-value-rn): upcase keywords (sgml-declare-entity): remove case fiddling * psgml-parse.el (sgml-check-case): remove case fiddling -- retain check. * psgml-dtd.el (sgml-validate-declared-value): upcase attribute types (sgml-check-default-value): remove case fiddling -- reserved names should be in upper case. * psgml-parse.el (sgml-push-to-entity): use syntax table from current buffer in entity buffer and not the sgml-parser-syntax as XML will use another syntax table. Wed Jun 10 23:28:42 1998 Lennart Staflin * psgml-parse.el (sgml-catalog-lookup): Take additional catalogs in right order. Thu May 14 20:02:42 1998 Lennart Staflin * Version 1.1.1 * psgml.el (psgml-version): new version 1.1.1 * psgml-dtd.el (sgml-parse-character-reference): upcase funchar names. * psgml-edit.el (sgml-indent-line): compute indentation from context, not element under point. Removed special handling of start-tag and document context. Extra indentation if in markup. * psgml-parse.el (sgml-parse-external): use upper case keywords. (sgml-check-case): use upper case instead of lower case. Wed May 13 06:13:05 1998 Lennart Staflin * psgml-parse.el (sgml-do-marked-section): Change keyword strings to upper case. (sgml-general-case): Use Upcase instead of Downcase. (sgml-parse-markup-declaration): upcase keywords. Sat Mar 14 21:31:09 1998 Lennart Staflin * psgml-parse.el (sgml-do-processing-instruction): Added recognition of PSGML NOFILL. (sgml-parse-catalog-buffer): add catalog as a noname entry (sgml-catalog-lookup): handle catalog entries Thu Mar 12 00:04:52 1998 Lennart Staflin * psgml-parse.el (sgml-current-element-name): make buffer local Wed Mar 11 22:11:01 1998 Lennart Staflin * psgml-edit.el (sgml-insert-start-tag): extended meaning of NET paramenter to insert XML-TAGCE if XML. (sgml-change-start-tag): keep XML-TAGCE * psgml-parse.el (sgml-read-element-name): use completing read on all defined element types if in an ANY context. (sgml-check-tag-close): removed check for XML-TAGCE (sgml-do-start-tag): added check for XML-TAGCE (sgml-element-empty): In XML no special handling of elements with declared content of EMPTY, but use conref to signal empty element tag. * psgml-dtd.el (sgml-merge-attlists): reverse the list Tue Mar 10 20:13:11 1998 Lennart Staflin * psgml.el: Merged David Megginson's latest xml modifications. Sat Nov 15 20:50:35 1997 Lennart Staflin * psgml-parse.el (sgml-parse-attribute-value-specification): New func. (sgml-parse-attribute-specification-list): use new func. This changes an error to a warning to make better error recovery when illegal characters occurs in starttag. Sun Aug 17 20:22:28 1997 Lennart Staflin * psgml-parse.el (sgml-cache-catalog): remove file-truename. This made relative filenames refer to the wrong directory if the catalog file was a symlink. Thu Jul 24 22:36:15 1997 Lennart Staflin * psgml-parse.el (sgml-modify-dtd): fixed bug in handling sgml-parent-document. Mon May 19 18:43:32 1997 Lennart Staflin * psgml-edit.el (sgml-expand-entity-reference): changed to allow point to be within entity referens, not only at start of ref. As suggested by Matthias Clasen. (sgml-edit-external-entity): new command contributed by Matthias Clasen * psgml-charent.el (sgml-charent-to-display-char): fix bug in regexp. Sat Mar 15 19:20:57 1997 Lennart Staflin * psgml-parse.el (sgml-check-tag-close): change sgml-error to sgml-log-warning Sun Jan 12 19:15:32 1997 Lennart Staflin * psgml.el (psgml-version): bump version Fri Nov 22 20:29:44 1996 Lennart Staflin * psgml.el (sgml-parse-colon-path): use path-separator if available. ./psgml-1.4.0/INSTALL0000750000076500000240000001705110212356414012324 0ustar dialoutBasic Installation ================== These are generic installation instructions. The `configure' shell script attempts to guess correct values for various system-dependent variables used during compilation. It uses those values to create a `Makefile' in each directory of the package. It may also create one or more `.h' files containing system-dependent definitions. Finally, it creates a shell script `config.status' that you can run in the future to recreate the current configuration, a file `config.cache' that saves the results of its tests to speed up reconfiguring, and a file `config.log' containing compiler output (useful mainly for debugging `configure'). If you need to do unusual things to compile the package, please try to figure out how `configure' could check whether to do them, and mail diffs or instructions to the address given in the `README' so they can be considered for the next release. If at some point `config.cache' contains results you don't want to keep, you may remove or edit it. The file `configure.in' is used to create `configure' by a program called `autoconf'. You only need `configure.in' if you want to change it or regenerate `configure' using a newer version of `autoconf'. The simplest way to compile this package is: 1. `cd' to the directory containing the package's source code and type `./configure' to configure the package for your system. If you're using `csh' on an old version of System V, you might need to type `sh ./configure' instead to prevent `csh' from trying to execute `configure' itself. Running `configure' takes awhile. While running, it prints some messages telling which features it is checking for. 2. Type `make' to compile the package. 3. Optionally, type `make check' to run any self-tests that come with the package. 4. Type `make install' to install the programs and any data files and documentation. 5. You can remove the program binaries and object files from the source code directory by typing `make clean'. To also remove the files that `configure' created (so you can compile the package for a different kind of computer), type `make distclean'. There is also a `make maintainer-clean' target, but that is intended mainly for the package's developers. If you use it, you may have to get all sorts of other programs in order to regenerate files that came with the distribution. Compilers and Options ===================== Some systems require unusual options for compilation or linking that the `configure' script does not know about. You can give `configure' initial values for variables by setting them in the environment. Using a Bourne-compatible shell, you can do that on the command line like this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure Or on systems that have the `env' program, you can do it like this: env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure Compiling For Multiple Architectures ==================================== You can compile the package for more than one kind of computer at the same time, by placing the object files for each architecture in their own directory. To do this, you must use a version of `make' that supports the `VPATH' variable, such as GNU `make'. `cd' to the directory where you want the object files and executables to go and run the `configure' script. `configure' automatically checks for the source code in the directory that `configure' is in and in `..'. If you have to use a `make' that does not supports the `VPATH' variable, you have to compile the package for one architecture at a time in the source code directory. After you have installed the package for one architecture, use `make distclean' before reconfiguring for another architecture. Installation Names ================== By default, `make install' will install the package's files in `/usr/local/bin', `/usr/local/man', etc. You can specify an installation prefix other than `/usr/local' by giving `configure' the option `--prefix=PATH'. You can specify separate installation prefixes for architecture-specific files and architecture-independent files. If you give `configure' the option `--exec-prefix=PATH', the package will use PATH as the prefix for installing programs and libraries. Documentation and other data files will still use the regular prefix. In addition, if you use an unusual directory layout you can give options like `--bindir=PATH' to specify different values for particular kinds of files. Run `configure --help' for a list of the directories you can set and what kinds of files go in them. If the package supports it, you can cause programs to be installed with an extra prefix or suffix on their names by giving `configure' the option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. Optional Features ================= Some packages pay attention to `--enable-FEATURE' options to `configure', where FEATURE indicates an optional part of the package. They may also pay attention to `--with-PACKAGE' options, where PACKAGE is something like `gnu-as' or `x' (for the X Window System). The `README' should mention any `--enable-' and `--with-' options that the package recognizes. For packages that use the X Window System, `configure' can usually find the X include and library files automatically, but if it doesn't, you can use the `configure' options `--x-includes=DIR' and `--x-libraries=DIR' to specify their locations. Specifying the System Type ========================== There may be some features `configure' can not figure out automatically, but needs to determine by the type of host the package will run on. Usually `configure' can figure that out, but if it prints a message saying it can not guess the host type, give it the `--host=TYPE' option. TYPE can either be a short name for the system type, such as `sun4', or a canonical name with three fields: CPU-COMPANY-SYSTEM See the file `config.sub' for the possible values of each field. If `config.sub' isn't included in this package, then this package doesn't need to know the host type. If you are building compiler tools for cross-compiling, you can also use the `--target=TYPE' option to select the type of system they will produce code for and the `--build=TYPE' option to select the type of system on which you are compiling the package. Sharing Defaults ================ If you want to set default values for `configure' scripts to share, you can create a site shell script called `config.site' that gives default values for variables like `CC', `cache_file', and `prefix'. `configure' looks for `PREFIX/share/config.site' if it exists, then `PREFIX/etc/config.site' if it exists. Or, you can set the `CONFIG_SITE' environment variable to the location of the site script. A warning: not all `configure' scripts look for a site script. Operation Controls ================== `configure' recognizes the following options to control how it operates. `--cache-file=FILE' Use and save the results of the tests in FILE instead of `./config.cache'. Set FILE to `/dev/null' to disable caching, for debugging `configure'. `--help' Print a summary of the options to `configure', and exit. `--quiet' `--silent' `-q' Do not print messages saying which checks are being made. `--srcdir=DIR' Look for the package's source code in directory DIR. Usually `configure' can determine that directory automatically. `--version' Print the version of Autoconf used to generate the `configure' script, and exit. `configure' also accepts some other, not widely useful, options. ./psgml-1.4.0/Makefile0000750000076500000240000000244210212356414012731 0ustar dialout# Generated automatically from Makefile.in by configure. # Makefile.in # # Makefile for the GNU Emacs lisp library, PSGML prefix = /usr/local datadir = ${prefix}/share lispdir = $(datadir)/emacs/site-lisp srcdir = . EMACS = emacs XEMACS = xemacs FLAGS = -batch -q -no-site-file -l ./psgml-maint.el INSTALL = /usr/bin/install -c INSTALL_DATA = ${INSTALL} -m 644 SHELL = /bin/sh compile: $(EMACS) $(FLAGS) -f psgml-compile-files all: rm -f *.elc ; $(EMACS) $(FLAGS) -f psgml-compile-files install: compile installdirs $(SHELL) mkinstalldirs $(lispdir) for p in *.elc; do \ echo " $(INSTALL_DATA) $$p $(lispdir)/$$p"; \ $(INSTALL_DATA) $$p $(lispdir)/$$p; \ done $(INSTALL_DATA) iso88591.map $(lispdir) installdirs: $(srcdir)/mkinstalldirs $(psgmldir) install-info: $(INSTALL_DATA) psgml.info $(infodir) $(INSTALL_DATA) psgml-api.info $(infodir) if $(SHELL) -c 'install-info --version' \ >/dev/null 2>&1; then \ install-info --info-dir=$(infodir) psgml.info; \ install-info --info-dir=$(infodir) psgml-api.info; \ else true; fi xemacs: $(MAKE) EMACS=xemacs all install-xemacs: $(MAKE) EMACS=xemacs install # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Makefile.in ends here ./psgml-1.4.0/Makefile.in0000750000076500000240000000227610212356414013343 0ustar dialout# Makefile.in # # Makefile for the GNU Emacs lisp library, PSGML prefix = @prefix@ datadir = @datadir@ lispdir = @lispdir@ infodir = @infodir@ srcdir = @srcdir@ @SET_MAKE@ EMACS = @EMACS@ XEMACS = xemacs VPATH = @srcdir@ FLAGS = -batch -q -no-site-file -l ./psgml-maint.el INSTALL = @INSTALL@ INSTALL_DATA = @INSTALL_DATA@ SHELL = /bin/sh compile: $(EMACS) $(FLAGS) -f psgml-compile-files all: rm -f *.elc ; $(EMACS) $(FLAGS) -f psgml-compile-files install: compile $(SHELL) mkinstalldirs $(lispdir) for p in *.elc; do \ echo " $(INSTALL_DATA) $$p $(lispdir)/$$p"; \ $(INSTALL_DATA) $$p $(lispdir)/$$p; \ done $(INSTALL_DATA) iso88591.map $(lispdir) install-info: $(INSTALL_DATA) psgml.info $(infodir) $(INSTALL_DATA) psgml-api.info $(infodir) if $(SHELL) -c 'install-info --version' \ >/dev/null 2>&1; then \ install-info --info-dir=$(infodir) psgml.info; \ install-info --info-dir=$(infodir) psgml-api.info; \ else true; fi xemacs: $(MAKE) EMACS=xemacs all install-xemacs: $(MAKE) EMACS=xemacs install # Tell versions [3.59,3.63) of GNU make not to export all variables. # Otherwise a system limit (for SysV at least) may be exceeded. .NOEXPORT: # Makefile.in ends here ./psgml-1.4.0/README.psgml0000640000076500000240000000161710212356414013273 0ustar dialoutThis is the READ ME file for psgml.el version 1.3.2. -*- outline -*- This is an ALPHA release. * User interface changes ** Rename sgml-general-dtd-info to sgml-describe-dtd. Keep old name as alias. ** Made menus compact, only one top level menu. ** Added new function sgml-show-structure (C-c C-s) (May need latest emacs version (22)) ** Changed C-c C-t to sgml-show-current-element-type New more comprehensive information display. ** New mouse menu, sgml-right-menu on S-mouse-3 If invoked on a start-tag will include entries to manipulate the tag/element, including setting attributes. If invoked in content it will be a menu of valid elements. ** The process instruction Not new, but now documented and improved. Must be placed in the DTD. ./psgml-1.4.0/configure0000750000076500000240000010252510212356414013200 0ustar dialout#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated automatically using autoconf version 2.13 # Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. # # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # Defaults: ac_help= ac_default_prefix=/usr/local # Any additions from configure.in: # Initialize some variables set by options. # The variables have the same names as the options, with # dashes changed to underlines. build=NONE cache_file=./config.cache exec_prefix=NONE host=NONE no_create= nonopt=NONE no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= target=NONE verbose= x_includes=NONE x_libraries=NONE bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datadir='${prefix}/share' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${prefix}/info' mandir='${prefix}/man' # Initialize some other variables. subdirs= MFLAGS= MAKEFLAGS= SHELL=${CONFIG_SHELL-/bin/sh} # Maximum number of lines to put in a shell here document. ac_max_here_lines=12 ac_prev= for ac_option do # If the previous option needs an argument, assign it. if test -n "$ac_prev"; then eval "$ac_prev=\$ac_option" ac_prev= continue fi case "$ac_option" in -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; *) ac_optarg= ;; esac # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir="$ac_optarg" ;; -build | --build | --buil | --bui | --bu) ac_prev=build ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build="$ac_optarg" ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file="$ac_optarg" ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir="$ac_optarg" ;; -disable-* | --disable-*) ac_feature=`echo $ac_option|sed -e 's/-*disable-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` eval "enable_${ac_feature}=no" ;; -enable-* | --enable-*) ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } fi ac_feature=`echo $ac_feature| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "enable_${ac_feature}='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix="$ac_optarg" ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he) # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat << EOF Usage: configure [options] [host] Options: [defaults in brackets after descriptions] Configuration: --cache-file=FILE cache test results in FILE --help print this message --no-create do not create output files --quiet, --silent do not print \`checking...' messages --version print the version of autoconf that created configure Directory and file names: --prefix=PREFIX install architecture-independent files in PREFIX [$ac_default_prefix] --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX [same as prefix] --bindir=DIR user executables in DIR [EPREFIX/bin] --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] --libexecdir=DIR program executables in DIR [EPREFIX/libexec] --datadir=DIR read-only architecture-independent data in DIR [PREFIX/share] --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] --sharedstatedir=DIR modifiable architecture-independent data in DIR [PREFIX/com] --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] --libdir=DIR object code libraries in DIR [EPREFIX/lib] --includedir=DIR C header files in DIR [PREFIX/include] --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] --infodir=DIR info documentation in DIR [PREFIX/info] --mandir=DIR man documentation in DIR [PREFIX/man] --srcdir=DIR find the sources in DIR [configure dir or ..] --program-prefix=PREFIX prepend PREFIX to installed program names --program-suffix=SUFFIX append SUFFIX to installed program names --program-transform-name=PROGRAM run sed PROGRAM on installed program names EOF cat << EOF Host type: --build=BUILD configure for building on BUILD [BUILD=HOST] --host=HOST configure for HOST [guessed] --target=TARGET configure for TARGET [TARGET=HOST] Features and packages: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --x-includes=DIR X include files are in DIR --x-libraries=DIR X library files are in DIR EOF if test -n "$ac_help"; then echo "--enable and --with options recognized:$ac_help" fi exit 0 ;; -host | --host | --hos | --ho) ac_prev=host ;; -host=* | --host=* | --hos=* | --ho=*) host="$ac_optarg" ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir="$ac_optarg" ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir="$ac_optarg" ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir="$ac_optarg" ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir="$ac_optarg" ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir="$ac_optarg" ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir="$ac_optarg" ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir="$ac_optarg" ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix="$ac_optarg" ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix="$ac_optarg" ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix="$ac_optarg" ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name="$ac_optarg" ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir="$ac_optarg" ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir="$ac_optarg" ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site="$ac_optarg" ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir="$ac_optarg" ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir="$ac_optarg" ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target="$ac_optarg" ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers) echo "configure generated by autoconf version 2.13" exit 0 ;; -with-* | --with-*) ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` case "$ac_option" in *=*) ;; *) ac_optarg=yes ;; esac eval "with_${ac_package}='$ac_optarg'" ;; -without-* | --without-*) ac_package=`echo $ac_option|sed -e 's/-*without-//'` # Reject names that are not valid shell variable names. if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } fi ac_package=`echo $ac_package| sed 's/-/_/g'` eval "with_${ac_package}=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes="$ac_optarg" ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries="$ac_optarg" ;; -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; exit 1; } ;; *) if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then echo "configure: warning: $ac_option: invalid host type" 1>&2 fi if test "x$nonopt" != xNONE; then { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } fi nonopt="$ac_option" ;; esac done if test -n "$ac_prev"; then { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } fi trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 # File descriptor usage: # 0 standard input # 1 file creation # 2 errors and warnings # 3 some systems may open it to /dev/tty # 4 used on the Kubota Titan # 6 checking for... messages and results # 5 compiler messages saved in config.log if test "$silent" = yes; then exec 6>/dev/null else exec 6>&1 fi exec 5>./config.log echo "\ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. " 1>&5 # Strip out --no-create and --no-recursion so they do not pile up. # Also quote any args containing shell metacharacters. ac_configure_args= for ac_arg do case "$ac_arg" in -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_arg" ;; esac done # NLS nuisances. # Only set these to C if already set. These must not be set unconditionally # because not all systems understand e.g. LANG=C (notably SCO). # Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! # Non-C LC_CTYPE values break the ctype check. if test "${LANG+set}" = set; then LANG=C; export LANG; fi if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi # confdefs.h avoids OS command line length limits that DEFS can exceed. rm -rf conftest* confdefs.h # AIX cpp loses on an empty file, so make sure it contains at least a newline. echo > confdefs.h # A filename unique to this package, relative to the directory that # configure is in, which we can look for to find out if srcdir is correct. ac_unique_file=psgml.el # Find the source files, if location was not specified. if test -z "$srcdir"; then ac_srcdir_defaulted=yes # Try the directory containing this script, then its parent. ac_prog=$0 ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. srcdir=$ac_confdir if test ! -r $srcdir/$ac_unique_file; then srcdir=.. fi else ac_srcdir_defaulted=no fi if test ! -r $srcdir/$ac_unique_file; then if test "$ac_srcdir_defaulted" = yes; then { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } else { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } fi fi srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` # Prefer explicitly selected file to automatically selected ones. if test -z "$CONFIG_SITE"; then if test "x$prefix" != xNONE; then CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then echo "loading site script $ac_site_file" . "$ac_site_file" fi done if test -r "$cache_file"; then echo "loading cache $cache_file" . $cache_file else echo "creating cache $cache_file" > $cache_file fi ac_ext=c # CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ac_cpp='$CPP $CPPFLAGS' ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' cross_compiling=$ac_cv_prog_cc_cross ac_exeext= ac_objext=o if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ac_n= ac_c=' ' ac_t=' ' else ac_n=-n ac_c= ac_t= fi else ac_n= ac_c='\c' ac_t= fi PACKAGE=psgml VERSION=1.2.3 cat >> confdefs.h <> confdefs.h <&6 echo "configure:538: checking whether ${MAKE-make} sets \${MAKE}" >&5 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y%./+-%__p_%'` if eval "test \"`echo '$''{'ac_cv_prog_make_${ac_make}_set'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else cat > conftestmake <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftestmake 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftestmake fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$ac_t""yes" 1>&6 SET_MAKE= else echo "$ac_t""no" 1>&6 SET_MAKE="MAKE=${MAKE-make}" fi ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f $ac_dir/install-sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f $ac_dir/install.sh; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break fi done if test -z "$ac_aux_dir"; then { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } fi ac_config_guess=$ac_aux_dir/config.guess ac_config_sub=$ac_aux_dir/config.sub ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 echo "configure:595: checking for a BSD compatible install" >&5 if test -z "$INSTALL"; then if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" for ac_dir in $PATH; do # Account for people who put trailing slashes in PATH elements. case "$ac_dir/" in /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/usr/ucb/*) ;; *) # OSF1 and SCO ODT 3.0 have their own names for install. # Don't use installbsd from OSF since it installs stuff as root # by default. for ac_prog in ginstall scoinst install; do if test -f $ac_dir/$ac_prog; then if test $ac_prog = install && grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done IFS="$ac_save_IFS" fi if test "${ac_cv_path_install+set}" = set; then INSTALL="$ac_cv_path_install" else # As a last resort, use the slow shell script. We don't cache a # path for INSTALL within a source directory, because that will # break other packages using the cache if that directory is # removed, or if the path is relative. INSTALL="$ac_install_sh" fi fi echo "$ac_t""$INSTALL" 1>&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' # If set to t, that means we are running in a shell under Emacs. # If you have an Emacs named "t", then use the full path. test "$EMACS" = t && EMACS= for ac_prog in emacs xemacs do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:655: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_EMACS'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$EMACS" in /*) ac_cv_path_EMACS="$EMACS" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_EMACS="$EMACS" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_EMACS="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" ;; esac fi EMACS="$ac_cv_path_EMACS" if test -n "$EMACS"; then echo "$ac_t""$EMACS" 1>&6 else echo "$ac_t""no" 1>&6 fi test -n "$EMACS" && break done test -n "$EMACS" || EMACS="no" if test $EMACS != "no"; then echo $ac_n "checking where .elc files should go""... $ac_c" 1>&6 echo "configure:693: checking where .elc files should go" >&5 lispdir="\$(datadir)/emacs/site-lisp" if test "x$prefix" = "xNONE"; then if test -d $ac_default_prefix/share/emacs/site-lisp; then lispdir="\$(prefix)/share/emacs/site-lisp" else if test -d $ac_default_prefix/lib/emacs/site-lisp; then lispdir="\$(prefix)/lib/emacs/site-lisp" fi fi else if test -d $prefix/share/emacs/site-lisp; then lispdir="\$(prefix)/share/emacs/site-lisp" else if test -d $prefix/lib/emacs/site-lisp; then lispdir="\$(prefix)/lib/emacs/site-lisp" fi fi fi echo "$ac_t""$lispdir" 1>&6 fi # Extract the first word of "makeinfo", so it can be a program name with args. set dummy makeinfo; ac_word=$2 echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 echo "configure:718: checking for $ac_word" >&5 if eval "test \"`echo '$''{'ac_cv_path_MAKEINFO'+set}'`\" = set"; then echo $ac_n "(cached) $ac_c" 1>&6 else case "$MAKEINFO" in /*) ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a path. ;; ?:/*) ac_cv_path_MAKEINFO="$MAKEINFO" # Let the user override the test with a dos path. ;; *) IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ac_dummy="$PATH" for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if test -f $ac_dir/$ac_word; then ac_cv_path_MAKEINFO="$ac_dir/$ac_word" break fi done IFS="$ac_save_ifs" test -z "$ac_cv_path_MAKEINFO" && ac_cv_path_MAKEINFO="no" ;; esac fi MAKEINFO="$ac_cv_path_MAKEINFO" if test -n "$MAKEINFO"; then echo "$ac_t""$MAKEINFO" 1>&6 else echo "$ac_t""no" 1>&6 fi trap '' 1 2 15 cat > confcache <<\EOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs. It is not useful on other systems. # If it contains results you don't want to keep, you may remove or edit it. # # By default, configure uses ./config.cache as the cache file, # creating it if it does not exist already. You can give configure # the --cache-file=FILE option to use a different cache file; that is # what configure does when it calls configure scripts in # subdirectories, so they share the cache. # Giving --cache-file=/dev/null disables caching, for debugging configure. # config.status only pays attention to the cache file if you give it the # --recheck option to rerun configure. # EOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, don't put newlines in cache variables' values. # Ultrix sh set writes to stderr and can't be redirected directly, # and sets the high bit in the cache file unless we assign to the vars. (set) 2>&1 | case `(ac_space=' '; set | grep ac_space) 2>&1` in *ac_space=\ *) # `set' does not quote correctly, so add quotes (double-quote substitution # turns \\\\ into \\, and sed turns \\ into \). sed -n \ -e "s/'/'\\\\''/g" \ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ;; *) # `set' quotes correctly as required by POSIX, so do not add quotes. sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ;; esac >> confcache if cmp -s $cache_file confcache; then : else if test -w $cache_file; then echo "updating cache $cache_file" cat confcache > $cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # Any assignment to VPATH causes Sun make to only execute # the first set of double-colon rules, so remove it if not needed. # If there is a colon in the path, we need to keep it. if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' fi trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 # Transform confdefs.h into DEFS. # Protect against shell expansion while executing Makefile rules. # Protect against Makefile macro expansion. cat > conftest.defs <<\EOF s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%-D\1=\2%g s%[ `~#$^&*(){}\\|;'"<>?]%\\&%g s%\[%\\&%g s%\]%\\&%g s%\$%$$%g EOF DEFS=`sed -f conftest.defs confdefs.h | tr '\012' ' '` rm -f conftest.defs # Without the "./", some shells look in PATH for config.status. : ${CONFIG_STATUS=./config.status} echo creating $CONFIG_STATUS rm -f $CONFIG_STATUS cat > $CONFIG_STATUS </dev/null | sed 1q`: # # $0 $ac_configure_args # # Compiler output produced by configure, useful for debugging # configure, is in ./config.log if it exists. ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" for ac_option do case "\$ac_option" in -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; -version | --version | --versio | --versi | --vers | --ver | --ve | --v) echo "$CONFIG_STATUS generated by autoconf version 2.13" exit 0 ;; -help | --help | --hel | --he | --h) echo "\$ac_cs_usage"; exit 0 ;; *) echo "\$ac_cs_usage"; exit 1 ;; esac done ac_given_srcdir=$srcdir ac_given_INSTALL="$INSTALL" trap 'rm -fr `echo "Makefile" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 EOF cat >> $CONFIG_STATUS < conftest.subs <<\\CEOF $ac_vpsub $extrasub s%@SHELL@%$SHELL%g s%@CFLAGS@%$CFLAGS%g s%@CPPFLAGS@%$CPPFLAGS%g s%@CXXFLAGS@%$CXXFLAGS%g s%@FFLAGS@%$FFLAGS%g s%@DEFS@%$DEFS%g s%@LDFLAGS@%$LDFLAGS%g s%@LIBS@%$LIBS%g s%@exec_prefix@%$exec_prefix%g s%@prefix@%$prefix%g s%@program_transform_name@%$program_transform_name%g s%@bindir@%$bindir%g s%@sbindir@%$sbindir%g s%@libexecdir@%$libexecdir%g s%@datadir@%$datadir%g s%@sysconfdir@%$sysconfdir%g s%@sharedstatedir@%$sharedstatedir%g s%@localstatedir@%$localstatedir%g s%@libdir@%$libdir%g s%@includedir@%$includedir%g s%@oldincludedir@%$oldincludedir%g s%@infodir@%$infodir%g s%@mandir@%$mandir%g s%@SET_MAKE@%$SET_MAKE%g s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g s%@INSTALL_DATA@%$INSTALL_DATA%g s%@EMACS@%$EMACS%g s%@lispdir@%$lispdir%g s%@MAKEINFO@%$MAKEINFO%g s%@PACKAGE@%$PACKAGE%g s%@VERSION@%$VERSION%g CEOF EOF cat >> $CONFIG_STATUS <<\EOF # Split the substitutions into bite-sized pieces for seds with # small command number limits, like on Digital OSF/1 and HP-UX. ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ac_file=1 # Number of current file. ac_beg=1 # First line for current file. ac_end=$ac_max_sed_cmds # Line after last line for current file. ac_more_lines=: ac_sed_cmds="" while $ac_more_lines; do if test $ac_beg -gt 1; then sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file else sed "${ac_end}q" conftest.subs > conftest.s$ac_file fi if test ! -s conftest.s$ac_file; then ac_more_lines=false rm -f conftest.s$ac_file else if test -z "$ac_sed_cmds"; then ac_sed_cmds="sed -f conftest.s$ac_file" else ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" fi ac_file=`expr $ac_file + 1` ac_beg=$ac_end ac_end=`expr $ac_end + $ac_max_sed_cmds` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds=cat fi EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". case "$ac_file" in *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; *) ac_file_in="${ac_file}.in" ;; esac # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. # Remove last slash and all that follows it. Not all systems have dirname. ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then # The file is in a subdirectory. test ! -d "$ac_dir" && mkdir "$ac_dir" ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" # A "../" for each directory in $ac_dir_suffix. ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` else ac_dir_suffix= ac_dots= fi case "$ac_given_srcdir" in .) srcdir=. if test -z "$ac_dots"; then top_srcdir=. else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; *) # Relative path. srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" top_srcdir="$ac_dots$ac_given_srcdir" ;; esac case "$ac_given_INSTALL" in [/$]*) INSTALL="$ac_given_INSTALL" ;; *) INSTALL="$ac_dots$ac_given_INSTALL" ;; esac echo creating "$ac_file" rm -f "$ac_file" configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." case "$ac_file" in *Makefile*) ac_comsub="1i\\ # $configure_input" ;; *) ac_comsub= ;; esac ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` sed -e "$ac_comsub s%@configure_input@%$configure_input%g s%@srcdir@%$srcdir%g s%@top_srcdir@%$top_srcdir%g s%@INSTALL@%$INSTALL%g " $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file fi; done rm -f conftest.s* EOF cat >> $CONFIG_STATUS <> $CONFIG_STATUS <<\EOF exit 0 EOF chmod +x $CONFIG_STATUS rm -fr confdefs* $ac_clean_files test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 ./psgml-1.4.0/configure.in0000640000076500000240000000076110212356414013602 0ustar dialoutdnl Process this file with autoconf to produce a `configure' script. dnl To rebuild `configure' from this, execute the command dnl autoconf dnl in the directory containing this script. AC_PREREQ(2.9)dnl AC_INIT(psgml.el) PACKAGE=psgml VERSION=1.3.2 AC_DEFINE_UNQUOTED(PACKAGE, "$PACKAGE") AC_DEFINE_UNQUOTED(VERSION, "$VERSION") AC_SET_MAKE AC_PROG_INSTALL AM_PATH_LISPDIR AC_PATH_PROG(MAKEINFO, makeinfo, no) AC_SUBST(PACKAGE) AC_SUBST(VERSION) AC_OUTPUT(Makefile) dnl configure.in ends here ./psgml-1.4.0/install-sh0000750000076500000240000001124510212356414013273 0ustar dialout#! /bin/sh # # install - install a program, script, or datafile # This comes from X11R5. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. # # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd="$cpprog" shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd="$stripprog" shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "install: no input file specified" exit 1 else true fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d $dst ]; then instcmd=: else instcmd=mkdir fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f $src -o -d $src ] then true else echo "install: $src does not exist" exit 1 fi if [ x"$dst" = x ] then echo "install: no destination specified" exit 1 else true fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d $dst ] then dst="$dst"/`basename $src` else true fi fi ## this sed command emulates the dirname command dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-${defaultIFS}}" oIFS="${IFS}" # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'` IFS="${oIFS}" pathcomp='' while [ $# -ne 0 ] ; do pathcomp="${pathcomp}${1}" shift if [ ! -d "${pathcomp}" ] ; then $mkdirprog "${pathcomp}" else true fi pathcomp="${pathcomp}/" done fi if [ x"$dir_arg" != x ] then $doit $instcmd $dst && if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename $dst` else dstfile=`basename $dst $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename $dst` else true fi # Make a temp file name in the proper directory. dsttmp=$dstdir/#inst.$$# # Move or copy the file name to the temp name $doit $instcmd $src $dsttmp && trap "rm -f ${dsttmp}" 0 && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi && # Now rename the file to the real destination. $doit $rmcmd -f $dstdir/$dstfile && $doit $mvcmd $dsttmp $dstdir/$dstfile fi && exit 0 ./psgml-1.4.0/iso88591.map0000640000076500000240000000533110212356414013177 0ustar dialout-*-coding: iso-8859-1; -*- 192 [Agrave] 193 [Aacute] 194 [Acirc ] 195 [Atilde] 196 [Auml ] 197 [Aring ] 198 [AElig ] 199 [Ccedil] 200 [Egrave] 201 [Eacute] 202 [Ecirc ] 203 [Euml ] 204 [Igrave] 205 [Iacute] 206 [Icirc ] 207 [Iuml ] 208 [ETH ] 209 [Ntilde] 210 [Ograve] 211 [Oacute] 212 [Ocirc ] 213 [Otilde] 214 [Ouml ] 216 [Oslash] 217 [Ugrave] 218 [Uacute] 219 [Ucirc ] 220 [Uuml ] 221 [Yacute] 222 [THORN ] 223 [szlig ] 224 [agrave] 225 [aacute] 226 [acirc ] 227 [atilde] 228 [auml ] 229 [aring ] 230 [aelig ] 231 [ccedil] 232 [egrave] 233 [eacute] 234 [ecirc ] 235 [euml ] 236 [igrave] 237 [iacute] 238 [icirc ] 239 [iuml ] 240 [eth ] 241 [ntilde] 242 [ograve] 243 [oacute] 244 [ocirc ] 245 [otilde] 246 [ouml ] 248 [oslash] 249 [ugrave] 250 [uacute] 251 [ucirc ] 252 [uuml ] 253 [yacute] 254 [thorn ] 255 [yuml ] 34 " 192 À 193 Á 194 Â 195 Ã 196 Ä 197 Å 198 Æ 199 Ç 200 È 201 É 202 Ê 203 Ë 204 Ì 205 Í 206 Î 207 Ï 208 Ð 209 Ñ 210 Ò 211 Ó 212 Ô 213 Õ 214 Ö 216 Ø 217 Ù 218 Ú 219 Û 220 Ü 221 Ý 222 Þ 223 ß 224 à 225 á 226 â 227 ã 228 ä 229 å 230 æ 231 ç 232 è 233 é 234 ê 235 ë 236 ì 237 í 238 î 239 ï 240 ð 241 ñ 242 ò 243 ó 244 ô 245 õ 246 ö 248 ø 249 ù 250 ú 251 û 252 ü 253 ý 254 þ 255 ÿ 192 À 193 Á 194 Â 195 Ã 196 Ä 197 Å 198 Æ 199 Ç 200 È 201 É 202 Ê 203 Ë 204 Ì 205 Í 206 Î 207 Ï 208 Ð 209 Ñ 210 Ò 211 Ó 212 Ô 213 Õ 214 Ö 216 Ø 217 Ù 218 Ú 219 Û 220 Ü 221 Ý 222 Þ 223 ß 224 à 225 á 226 â 227 ã 228 ä 229 å 230 æ 231 ç 232 è 233 é 234 ê 235 ë 236 ì 237 í 238 î 239 ï 240 ð 241 ñ 242 ò 243 ó 244 ô 245 õ 246 ö 248 ø 249 ù 250 ú 251 û 252 ü 253 ý 254 þ 255 ÿ 192 À 193 Á 194 Â 195 Ã 196 Ä 197 Å 198 Æ 199 Ç 200 È 201 É 202 Ê 203 Ë 204 Ì 205 Í 206 Î 207 Ï 208 Ð 209 Ñ 210 Ò 211 Ó 212 Ô 213 Õ 214 Ö 216 Ø 217 Ù 218 Ú 219 Û 220 Ü 221 Ý 222 Þ 223 ß 224 à 225 á 226 â 227 ã 228 ä 229 å 230 æ 231 ç 232 è 233 é 234 ê 235 ë 236 ì 237 í 238 î 239 ï 240 ð 241 ñ 242 ò 243 ó 244 ô 245 õ 246 ö 248 ø 249 ù 250 ú 251 û 252 ü 253 ý 254 þ 255 ÿ ./psgml-1.4.0/mkinstalldirs0000750000076500000240000000113610212356414014073 0ustar dialout#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d in ${1+"$@"} ; do pathcomp="$pathcomp$d" case "$pathcomp" in -* ) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" 1>&2 mkdir "$pathcomp" || errstatus=$? fi pathcomp="$pathcomp/" done done exit $errstatus # mkinstalldirs ends here ./psgml-1.4.0/psgml-api.el0000640000076500000240000000721410212356414013504 0ustar dialout;;; psgml-api.el --- Extra API functions for PSGML ;; $Id: psgml-api.el,v 1.8 2002/04/25 20:50:27 lenst Exp $ ;; Copyright (C) 1994 Lennart Staflin ;; Author: Lennart Staflin ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; Provides some extra functions for the API to PSGML. ;;; Code: (provide 'psgml-api) (require 'psgml) (require 'psgml-parse) (eval-when-compile (require 'cl)) ;;;; Mapping: map and modify (defun sgml-map-element-modify (el-fun element) "Apply EL-FUN to ELEMENT and the elements in its content. The EL-FUN may change the buffer. But if it changes the buffer and leaves the element with no start-tag some elements may be ignored." (let ((level ; level in the element tree 0) next (tick ; change counter (buffer-modified-tick))) (while element (funcall el-fun element) ;; If the function has modified the buffer, a fresh parse is needed (when (/= tick (buffer-modified-tick)) (setq element (sgml-find-element-of (sgml-element-start element))) (setq tick (buffer-modified-tick))) (cond ;; Map content if any ((setq next (sgml-element-content element)) (incf level)) ;; If in a sub-tree, move to next element (t (while (and (> level 0) (null (setq next (sgml-element-next element)))) (setq element (sgml-element-parent element)) (decf level)))) (setq element next)))) ;;;; Map content (defun sgml-map-content (element element-fun &optional data-fun pi-fun entity-fun) "Map content of ELEMENT, calling ELEMENT-FUN for every element. Also calling DATA-FUN, if non-nil, with data in content." (sgml-pop-all-entities) (sgml-need-dtd) (sgml-element-end element) ; Make sure all content is parsed (unless (sgml-element-empty element) (let ((main-buffer-max (point-max))) (save-excursion (sgml-with-parser-syntax-ro (sgml-set-parse-state element 'start) (when (eobp) (sgml-pop-entity)) (when (eolp) (forward-char 1)) (sgml-parse-data main-buffer-max data-fun pi-fun entity-fun) (let ((c (sgml-tree-content element))) (while c (sgml-pop-all-entities) (funcall element-fun c) (sgml-set-parse-state c 'after) (sgml-parse-data main-buffer-max data-fun pi-fun entity-fun) (setq c (sgml-tree-next c))))))))) (defun sgml-parse-data (sgml-goal sgml-data-function sgml-pi-function sgml-entity-function) (let ((sgml-throw-on-element-change 'el-done)) (catch sgml-throw-on-element-change (sgml-parse-continue sgml-goal nil t)))) ;;;; Entity management (defun sgml-push-to-string (string) "Create an entity from STRING and push it on the top of the entity stack. After this the current buffer will be a scratch buffer containing the text of the new entity with point at the first character. Use `sgml-pop-entity' to exit from this buffer." (sgml-push-to-entity (sgml-make-entity "#STRING" 'text string))) ;;; psgml-api.el ends here ./psgml-1.4.0/psgml-api.info0000750000076500000240000006202610212356414014043 0ustar dialoutThis is psgml-api.info, produced by makeinfo version 4.0 from psgml-api.texi. START-INFO-DIR-ENTRY * PSGML-API: (psgml-api). PSGML, the API documentation. END-INFO-DIR-ENTRY Documentation for PSGML, a major mode for SGML. Copyright 1994 Lennart Staflin Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation.  File: psgml-api.info, Node: Top, Next: Types, Prev: (dir), Up: (dir) PSGML Internals *************** * Menu: * Types:: Types and operations * Hooks:: Hooks * Implementation:: Implementation notes * Index:: Index --- The Detailed Node Listing --- Types and operations * element:: The element structure * attribute:: Attribute Types * parser state:: Parser state * DTD:: DTD * entities:: Entities  File: psgml-api.info, Node: Types, Next: Hooks, Prev: Top, Up: Top Types and operations ******************** NOTE: Names of element types, attributes and entities should be treated as far as possible as a real type. In versions prior to 1.0 names are represented by lisp symbols but in 1.0 they are strings. Perhaps I should make a `psgml-api.el' that defines some functions to deal with names. Then it would be possible to write code that works in both 0.4 and 1.0. * Menu: * element:: The element structure * attribute:: Attribute Types * parser state:: Parser state * DTD:: DTD * entities:: Entities  File: psgml-api.info, Node: element, Next: attribute, Prev: Types, Up: Types The element structure ===================== - Data type: element The basic data type representing the element structure is the Element (this happens to be a node in the parse tree). Mapping buffer positions to elements ------------------------------------ - Function: sgml-find-context-of pos Return the element current at buffer position POS. If POS is in markup, `sgml-markup-type' will be a symbol identifying the markup type. It will be `nil' if POS is outside markup. - Function: sgml-find-element-of pos Return the element containing the character at buffer position POS. Functions operating on elements ------------------------------- - Function: sgml-element-name element Returns the name of the element. (obsolete) - Function: sgml-element-gi element Return the general identifier (string) of ELEMENT. - Function: sgml-element-level element Returns the level of ELEMENT in the element structure. The document element is level 1. Structure ......... - Function: sgml-top-element Return the document element. - Function: sgml-off-top-p element True if ELEMENT is the pseudo element above the document element. These functions return other related elements, or possibly `nil'. - Function: sgml-element-content element First element in content of ELEMENT, or nil. - Function: sgml-element-next element Next sibling of ELEMENT. To loop thru all sub elements of an element, `el', You could do like this: (let ((c (sgml-element-content el))) (while c <> (setq c (sgml-element-next c)))) - Function: sgml-element-parent element Parent of ELEMENT. Tags .... - Function: sgml-element-stag-optional element Return true if the start-tag of ELEMENT is omissible. - Function: sgml-element-etag-optional element Return true if the end-tag of ELEMENT is omissible. - Function: sgml-element-stag-len element Return the length of the start-tag of ELEMENT. If the start-tag has been omitted the length is 0. - Function: sgml-element-etag-len element Return the length of the end-tag of ELEMENT. If the end-tag has been omitted the length is 0. - Function: sgml-element-net-enabled element Return true, if ELEMENT or some parent of the element has null end tag (NET) enabled. Return `t', if it is ELEMENT that has NET enabled. Positions ......... These functions relates an element to positions in the buffer. - Function: sgml-element-start element Position of start of ELEMENT. - Function: sgml-element-end element Position after ELEMENT. - Function: sgml-element-stag-end element Position after start-tag of ELEMENT. - Function: sgml-element-etag-start element Position before end-tag of ELEMENT. Attributes .......... - Function: sgml-element-attlist element Return the attribute declaration list for ELEMENT. - Function: sgml-element-attribute-specification-list element Return the attribute specification list for ELEMENT. - Function: sgml-element-attval element attribute Return the value of the ATTRIBUTE in ELEMENT, string or nil. Misc technical .............. - Function: sgml-element-data-p element True if ELEMENT can contain data characters. - Function: sgml-element-mixed element True if ELEMENT has mixed content. - Function: sgml-element-eltype element - Function: sgml-element-empty element True if ELEMENT is empty. - Function: sgml-element-excludes element - Function: sgml-element-includes element - Function: sgml-element-model element Declared content or content model of ELEMENT. - Function: sgml-element-context-string element Return string describing context of ELEMENT.  File: psgml-api.info, Node: attribute, Next: parser state, Prev: element, Up: Types Attribute Types =============== Basic types for attributes are names and values. (See note about names in *Note Types::.) And attribute values (attval) by lisp strings. Attribute Declaration List Type ------------------------------- - Data type: attlist attdecl* This is the result of the ATTLIST declarations in the DTD. All attribute declarations for an element is the elements attlist. - Function: sgml-lookup-attdecl name attlist Return attribute declaration (attdecl) for attribute NAME in attribute declaration list ATTLIST. - Function: sgml-attribute-with-declared-value attlist declared-value Find the first attribute in ATTLIST that has DECLARED-VALUE. Attribute Declaration Type -------------------------- - Data type: attdecl name declared-value default-value This is the representation of an individual attribute declaration contained in an ATTLIST declaration. - Function: sgml-make-attdecl name declared-value default-value Produces an attdecl. - Function: sgml-attdecl-name attdecl Returns the name of an attribute declaration. - Function: sgml-attdecl-declared-value attdecl Returns the declared-value of attribute declaration ATTDECL. - Function: sgml-attdecl-default-value: attdecl Returns the default-value of attribute declaration ATTDECL. Declared Value Type ------------------- - Data type: declared-value (token-group | notation | simple) A declared value of an SGML attribute can be of different kinds. If the declared value is a token group there is an associated list of name tokens. For notation there is also a list of associated names, the allowed notation names. The other declared values are represented by the type name as a lisp symbol. - Function: sgml-declared-value-token-group declared-value Return the name token group for the DECLARED-VALUE. This applies to name token groups. For other declared values nil is returned. - Function: sgml-declared-value-notation declared-value Return the list of notation names for the DECLARED-VALUE. This applies to notation declared value. For other declared values nil is returned. Default Value Type ------------------ - Data type: default-value (required | implied | conref | specified ) There are several kinds of default values. The REQUIRED, IMPLIED, and CONREF has no associated information. The SPECIFIED have an associated attribute value and can be either `fixed' or `normal'. - Function: sgml-make-default-value type &optional attval - Function: sgml-default-value-attval default-value Return the actual default value of the declared DEFAULT-VALUE. The actual value is a string. Return `nil' if no actual value. - Function: sgml-default-value-type-p type default-value Return true if DEFAULT-VALUE is of TYPE. Where TYPE is a symbol, one of `required', `implied', `conref', or `fixed'. Attribute Specification Type ---------------------------- - Data type: attspec name attval This is the result of parsing an attribute specification. - Function: sgml-make-attspec name attval Create an attspec from NAME and ATTVAL. Special case, if ATTVAL is `nil' this is an implied attribute. - Function: sgml-attspec-name attspec Return the name of the attribute specified by ATTSPEC. - Function: sgml-attspec-attval attspec Return the value (attval) of attribute specification ATTSPEC. If ATTSPEC is `nil', `nil' is returned. Attribute Specification List Type --------------------------------- - Data type: asl attspec* This is the result of parsing an attribute specification list. - Function: sgml-lookup-attspec name asl Return the attribute specification for attribute with NAME in the attribute specification list ASL. If the attribute is unspecified `nil' is returned.  File: psgml-api.info, Node: parser state, Next: DTD, Prev: attribute, Up: Types Parser state ============ The state of the parser that needs to be kept between commands are stored in a buffer local variable. Some global variables are initialised from this variable when parsing starts. - Variable: sgml-buffer-parse-state The state of the parser that is kept between commands. The value of this variable is of type pstate. - Data type: pstate The parser state. - Function: sgml-pstate-dtd pstate The document type information (dtd) for the parser.  File: psgml-api.info, Node: DTD, Next: entities, Prev: parser state, Up: Types DTD === - Data type: dtd Represents what PSGML knows about the DTD. - Function: sgml-dtd-doctype dtd The document type name. - Function: sgml-dtd-eltypes dtd The table of element types. - Function: sgml-dtd-entities dtd The table of declared general entities (entity-table). - Function: sgml-dtd-parameters dtd The table of declared parameter entities (entity-table). - Function: sgml-dtd-shortmaps dtd The list of short reference maps. - Function: sgml-dtd-notations dtd Not yet implemented.  File: psgml-api.info, Node: entities, Prev: DTD, Up: Types Entities ======== - Data type: entity An entity has the following properties: NAME The name of the entity (a string). This is either the name of a declared entity (general or parameter) or the doctype name if it is the implicit entity referred to by the doctype declaration. TYPE This is a symbol. It is `text' if it is a text entity, other values are `cdata', `ndata', `sdata', `sgml' or `dtd'. TEXT This is the text of the entity, either a string or an external identifier. Operations on entities - Function: sgml-make-entity name type text Create an entity. - Function: sgml-entity-name entity The name of the entity. - Function: sgml-entity-type entity The type of the entity. - Function: sgml-entity-text entity The text of the entity. - Function: sgml-entity-insert-text entity Insert the text of the entity into the current buffer at point. - Function: sgml-entity-data-p entity True if ENTITY is a data entity, that is not of type `text'. - Data type: entity-table A table of entities that can be referenced by entity name. - Function: sgml-lookup-entity name entity-table The entity with named NAME in the table ENTITY-TABLE. If no such entity exists, `nil' is returned. - Function: sgml-entity-declare name entity-table type text Create an entity from NAME, TYPE and TEXT; and enter the entity into the table ENTITY-TABLE. - Function: sgml-entity-completion-table entity-table Make a completion table from the ENTITY-TABLE. - Function: sgml-map-entities fn entity-table &optional collect Apply the function FN to all entities in ENTITY-TABLE. If COLLECT is `t', the results of the applications are collected in a list and returned.  File: psgml-api.info, Node: Hooks, Next: Implementation, Prev: Types, Up: Top Hooks ***** - Variable: sgml-open-element-hook The hook run by `sgml-open-element'. Theses functions are called with two arguments, the first argument is the opened element and the second argument is the attribute specification list. It is probably best not to refer to the content or the end-tag of the element. - Variable: sgml-close-element-hook The hook run by `sgml-close-element'. These functions are invoked with `sgml-current-tree' bound to the element just parsed. - Variable: sgml-doctype-parsed-hook This hook is called after the doctype has been parsed. It can be used to load any additional information into the DTD structure. - Variable: sgml-sysid-resolve-functions This variable should contain a list of functions. Each function should take one argument, the system identifier of an entity. If the function can handle that identifier, it should insert the text of the entity into the current buffer at point and return t. If the system identifier is not handled the function should return nil. - Variable: sgml-doctype-parsed-hook This hook is caled after the doctype has been parsed. It can be used to load any additional information into the DTD structure. - Variable: sgml-close-element-hook The hook run by `sgml-close-element'. These functions are invoked with `sgml-current-tree' bound to the element just parsed. *** sgml-new-attribute-list-function This hook is run when a new element is inserted to construct the attribute specification list. The default function prompts for the required attributes.  File: psgml-api.info, Node: Implementation, Next: Index, Prev: Hooks, Up: Top Implementation notes ******************** Data Types and Operations ========================= Element Type ------------ - Data type: eltype Data type representing the information about an element type. An `eltype' has information from `ELEMENT' and `ATTLIST' declarations. It can also store data for the application. The element types are symbols in a special oblist. The oblist is the table of element types. The symbols name is the GI, its value is used to store three flags and the function definition holds the content model. Other information about the element type is stored on the property list. - Function: sgml-eltype-name et The name (a string) of the element type ET. - Function: sgml-eltype-appdata et prop Get application data from element type ET with name PROP. PROP should be a symbol, reserved names are: flags, model, attlist, includes, excludes, conref-regexp, mixed, stag-optional, etag-optional. This function can be used as a place in `setf', `push' and other functions from the CL library. - Function: sgml-eltype-all-miscdata eltype A list of all data properties for eltype except for flags, model, includes and excludes. This function filters the property list of ELTYPE. Used when saving the parsed DTD. - Function: sgml-eltype-set-all-miscdata eltype miscdata Append the MISCDATA data properties to the properties of ELTYPE. - Function: sgml-eltype-attlist et The attribute specification list for the element type ET. - Function: sgml-eltype-completion-table eltypes Make a completion table from a list, ELTYPES, of element types. - Function: sgml-eltype-stag-optional et True if the element type ET has optional start-tag. - Function: sgml-eltype-etag-optional et True if the element type ET has optional end-tag. - Function: sgml-eltype-excludes et The list of excluded element types for element type ET. - Function: sgml-eltype-includes et The list of included element types for element type ET. - Function: sgml-eltype-flags et Contains three flags as a number. The flags are stag-optional, etag-optional and mixed. - Function: sgml-eltype-mixed et True if element type ET has mixed content. - Function: sgml-eltype-model et The content model of element type ET. The content model is either the start state in the DFA for the content model or a symbol identifying a declared content. - Function: sgml-eltype-shortmap et The name of the shortmap associated with element type ET. This can also be the symbol `empty' (if declared with a `' or `nil' (if no associated map). - Function: sgml-eltype-token et Return a token for the element type ET. - Function: sgml-eltypes-in-state state tree List of element types valid in STATE and TREE. DTD --- The DTD data type is realised as a lisp vector using `defstruct'. There are two additional fields for internal use: dependencies and merged. - Function: sgml-dtd-dependencies dtd The list of files used to create this DTD. - Function: sgml-dtd-merged dtd The pair (FILE . MERGED-DTD), if the DTD has had a precompiled dtd merged into it. FILE is the file containing the compiled DTD and MERGED-DTD is the DTD loaded from that file. Element and Tree ---------------- - Data Type: tree This is the data type for the nodes in the tree build by the parser. The tree nodes are represented as lisp vectors, using `defstruct' to define basic operations. The Element data type is a view of the tree built by the parser. Parsing model ============= PSGML uses finite state machines and a stack to parse SGML. Every element type has an associated DFA (deterministic finite automaton). This DFA is constructed from the content model. SGML restricts the allowed content models in such a way that it is easy to directly construct a DFA. To be able to determine when a start-tag can be omitted the DFA need to contain some more information than the traditional DFA. In PSGML a DFA has a set of states and two sets of edges. The edges are associated with tokens (corresponding to SGML's primitive content tokens). I call these moves. One set of moves, the "optional moves", represents optional tokens. I call the other set "required moves". The correspondence to SGML definitions are: if there is precisely one required move from one state, then the associated token is required. A state is final if there is not required move from that state. The SGML construct `(...&...&...)' ("AND-group") is another problem. There is a simple translation to sequence- and or-connectors. For example `(a & b & c)' is can be translated to: ((a, ((c, b) | (b, c))) | (b, ((a, c) | (c, a))) | (c, ((a, b) | (b, a))) ) But this grows too fast to be of direct practical use. PSGML represents an AND-group with one DFA for every (SGML) token in the group. During parsing of an AND-group there is a pointer to a state in one of the group's DFAs, and a list of the DFAs for the tokens not yet satisfied. Most of this is hidden by the primitives for the state type. The parser only sees states in a DFA and moves. Entity manager ============== - Function: sgml-push-to-entity entity &optional ref-start type Set current buffer to a buffer containing the entity ENTITY. ENTITY can also be a file name. Optional argument REF-START should be the start point of the entity reference. Optional argument TYPE, overrides the entity type in entity look up. - Function: sgml-pop-entity Should be called after a `sgml-push-to-entity' (or similar). Restore the current buffer to the buffer that was current when the push to this buffer was made. - Function: sgml-push-to-string string Create an entity from STRING and push it on the top of the entity stack. After this the current buffer will be a scratch buffer containing the text of the new entity with point at the first character. Use `sgml-pop-entity' to exit from this buffer. Parser functions ================ - Function: sgml-need-dtd This makes sure that the buffer has a DTD and set global variables needed by parsing routines. One global variable is `sgml-dtd-info' which contain the DTD (type dtd). - Function: sgml-parse-to goal &optional extra-cond quiet This is the low level interface to the parser. Parse until (at least) GOAL, a buffer position. Optional argument EXTRA-COND should be a function. This function is called in the parser loop, and the loop is exited if the function returns t. If third argument QUIT is non-`nil', no "`Parsing...'" message will be displayed. - Function: sgml-reparse-buffer shortref-fun Reparse the buffer and let SHORTREF-FUN take care of short references. SHORTREF-FUN is called with the entity as argument and `sgml-markup-start' pointing to start of short reference and point pointing to the end. Saved DTD Format ================ File = Comment, File version, S-expression --dependencies--, Parameter entites, Document type name, Elements, General entities, S-expression --shortref maps--, S-expression --notations-- Elements = Counted Sequence of S-expression --element type name--, Counted Sequence of Element type description File version = "(sgml-saved-dtd-version 5) " Comment = (";", (CASE OF [0-9] OF [11-255])*, [10] --end of line marker--)* Element type description = S-expression --Misc info--, CASE OF [0-7] --Flags 1:stag-opt, 2:etag-opt, 4:mixed--, Content specification, Token list --includes--, Token list --excludes-- OF [128] --Flag undefined element-- Content specification = CASE OF [0] --cdata-- OF [1] --rcdata-- OF [2] --empty-- OF [3] --any-- OF [4] --undefined-- OF [128] --model follows--, Model --nodes in the finite state automaton-- Model = Counted Sequence of Node Node = CASE OF Normal State OF And Node Normal State = Moves --moves for optional tokens--, Moves --moves for required tokens-- Moves = Counted Sequence of (Token, OCTET --state #--) And Node = [255] --signals an AND node--, Number --next state (node number)--, Counted Sequence of Model --set of models-- Token = Number --index in list of elements-- Number = CASE OF [0-250] --Small number 0--250-- OF [251-255] --Big number, first octet--, OCTET --Big number, second octet-- Token list = Counted Sequence of Token Parameter entites = S-expression --internal representation of parameter entities-- General entities = S-expression --internal representation of general entities-- Document type name = S-expression --name of document type as a string-- S-expression = OTHER Counted Sequence = Number_a --length of sequence--, (ARG_1)^a  File: psgml-api.info, Node: Index, Prev: Implementation, Up: Top Index ***** Types * Menu: * asl: attribute. * attdecl: attribute. * attlist: attribute. * attspec: attribute. * declared-value: attribute. * default-value: attribute. * dtd: DTD. * element: element. * eltype: Implementation. * entity: entities. * entity-table: entities. * pstate: parser state. * tree: Implementation.  Tag Table: Node: Top942 Node: Types1526 Node: element2245 Node: attribute6165 Node: parser state10162 Node: DTD10750 Node: entities11379 Node: Hooks13294 Node: Implementation15026 Node: Index24613  End Tag Table ./psgml-1.4.0/psgml-api.texi0000750000076500000240000006547110212356414014070 0ustar dialout\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename psgml-api.info @settitle psgml-api @c @setchapternewpage odd @c %**end of header @c $Id: psgml-api.texi,v 1.2 1999/12/03 17:29:39 lenst Exp $ @ifinfo @format START-INFO-DIR-ENTRY * PSGML-API: (psgml-api). PSGML, the API documentation. END-INFO-DIR-ENTRY @end format @end ifinfo @ifinfo Documentation for PSGML, a major mode for SGML. Copyright 1994 Lennart Staflin Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title Internals of PSGML @author Lennart Staflin @c The following two commands @c start the copyright page. @page @vskip 0pt plus 1filll Copyright @copyright{} 1994 Lennart Staflin @c Published by ... Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @node Top, Types, (dir), (dir) @comment node-name, next, previous, up @ifinfo @top PSGML Internals @end ifinfo @menu * Types:: Types and operations * Hooks:: Hooks * Implementation:: Implementation notes * Index:: Index --- The Detailed Node Listing --- Types and operations * element:: The element structure * attribute:: Attribute Types * parser state:: Parser state * DTD:: DTD * entities:: Entities @end menu @node Types, Hooks, Top, Top @comment node-name, next, previous, up @chapter Types and operations NOTE: Names of element types, attributes and entities should be treated as far as possible as a real type. In versions prior to 1.0 names are represented by lisp symbols but in 1.0 they are strings. Perhaps I should make a @file{psgml-api.el} that defines some functions to deal with names. Then it would be possible to write code that works in both 0.4 and 1.0. @menu * element:: The element structure * attribute:: Attribute Types * parser state:: Parser state * DTD:: DTD * entities:: Entities @end menu @node element, attribute, Types, Types @comment node-name, next, previous, up @section The element structure @deftp {Data type} element The basic data type representing the element structure is the Element (this happens to be a node in the parse tree). @end deftp @subsection Mapping buffer positions to elements @defun sgml-find-context-of pos Return the element current at buffer position @var{pos}. If @var{pos} is in markup, @code{sgml-markup-type} will be a symbol identifying the markup type. It will be @code{nil} if @var{pos} is outside markup. @end defun @defun sgml-find-element-of pos Return the element containing the character at buffer position @var{pos}. @end defun @subsection Functions operating on elements @defun sgml-element-name element Returns the name of the element. (obsolete) @end defun @defun sgml-element-gi element Return the general identifier (string) of @var{element}. @end defun @defun sgml-element-level element Returns the level of @var{element} in the element structure. The document element is level 1. @end defun @subsubsection Structure @defun sgml-top-element Return the document element. @end defun @defun sgml-off-top-p element True if @var{element} is the pseudo element above the document element. @end defun These functions return other related elements, or possibly @code{nil}. @defun sgml-element-content element First element in content of @var{element}, or nil. @end defun @defun sgml-element-next element Next sibling of @var{element}. To loop thru all sub elements of an element, @code{el}, You could do like this: @lisp (let ((c (sgml-element-content el))) (while c <> (setq c (sgml-element-next c)))) @end lisp @end defun @defun sgml-element-parent element Parent of @var{element}. @end defun @subsubsection Tags @defun sgml-element-stag-optional element Return true if the start-tag of @var{element} is omissible. @end defun @defun sgml-element-etag-optional element Return true if the end-tag of @var{element} is omissible. @end defun @defun sgml-element-stag-len element Return the length of the start-tag of @var{element}. If the start-tag has been omitted the length is 0. @end defun @defun sgml-element-etag-len element Return the length of the end-tag of @var{element}. If the end-tag has been omitted the length is 0. @end defun @defun sgml-element-net-enabled element Return true, if @var{element} or some parent of the element has null end tag (NET) enabled. Return @code{t}, if it is @var{element} that has NET enabled. @end defun @subsubsection Positions These functions relates an element to positions in the buffer. @defun sgml-element-start element Position of start of @var{element}. @end defun @defun sgml-element-end element Position after @var{element}. @end defun @defun sgml-element-stag-end element Position after start-tag of @var{element}. @end defun @defun sgml-element-etag-start element Position before end-tag of @var{element}. @end defun @subsubsection Attributes @defun sgml-element-attlist element Return the attribute declaration list for @var{element}. @end defun @defun sgml-element-attribute-specification-list element Return the attribute specification list for @var{element}. @end defun @defun sgml-element-attval element attribute Return the value of the @var{attribute} in @var{element}, string or nil. @end defun @subsubsection Misc technical @defun sgml-element-data-p element True if @var{element} can contain data characters. @end defun @defun sgml-element-mixed element True if @var{element} has mixed content. @end defun @defun sgml-element-eltype element @end defun @defun sgml-element-empty element True if @var{element} is empty. @end defun @defun sgml-element-excludes element @end defun @defun sgml-element-includes element @end defun @defun sgml-element-model element Declared content or content model of @var{element}. @end defun @defun sgml-element-context-string element Return string describing context of @var{element}. @end defun @c ---------------------------------------------------------------------- @node attribute, parser state, element, Types @comment node-name, next, previous, up @section Attribute Types Basic types for attributes are names and values. (See note about names in @ref{Types}.) And attribute values (attval) by lisp strings. @subsection Attribute Declaration List Type @deftp {Data type} attlist attdecl* This is the result of the ATTLIST declarations in the DTD. All attribute declarations for an element is the elements attlist. @end deftp @defun sgml-lookup-attdecl name attlist Return attribute declaration (attdecl) for attribute @var{name} in attribute declaration list @var{attlist}. @end defun @defun sgml-attribute-with-declared-value attlist declared-value Find the first attribute in @var{attlist} that has @var{declared-value}. @end defun @subsection Attribute Declaration Type @deftp {Data type} attdecl name declared-value default-value This is the representation of an individual attribute declaration contained in an ATTLIST declaration. @end deftp @defun sgml-make-attdecl name declared-value default-value Produces an attdecl. @end defun @defun sgml-attdecl-name attdecl Returns the name of an attribute declaration. @end defun @defun sgml-attdecl-declared-value attdecl Returns the declared-value of attribute declaration @var{attdecl}. @end defun @defun sgml-attdecl-default-value: attdecl Returns the default-value of attribute declaration @var{attdecl}. @end defun @subsection Declared Value Type @deftp {Data type} declared-value (token-group | notation | simple) A declared value of an SGML attribute can be of different kinds. If the declared value is a token group there is an associated list of name tokens. For notation there is also a list of associated names, the allowed notation names. The other declared values are represented by the type name as a lisp symbol. @c token-group = nametoken+ @c notation = nametoken+ @c simple = symbol @end deftp @defun sgml-declared-value-token-group declared-value Return the name token group for the @var{declared-value}. This applies to name token groups. For other declared values nil is returned. @end defun @defun sgml-declared-value-notation declared-value Return the list of notation names for the @var{declared-value}. This applies to notation declared value. For other declared values nil is returned. @end defun @subsection Default Value Type @deftp {Data type} default-value (required | implied | conref | specified ) @c implied, conref = constant symbol @c specified = (fixed | normal) @c fixed, normal = attval There are several kinds of default values. The @var{required}, @var{implied}, and @var{conref} has no associated information. The @var{specified} have an associated attribute value and can be either @code{fixed} or @code{normal}. @end deftp @defun sgml-make-default-value type &optional attval @end defun @defun sgml-default-value-attval default-value Return the actual default value of the declared @var{default-value}. The actual value is a string. Return @code{nil} if no actual value. @end defun @defun sgml-default-value-type-p type default-value Return true if @var{default-value} is of @var{type}. Where @var{type} is a symbol, one of @code{required}, @code{implied}, @code{conref}, or @code{fixed}. @end defun @subsection Attribute Specification Type @deftp {Data type} attspec name attval This is the result of parsing an attribute specification. @end deftp @defun sgml-make-attspec name attval Create an attspec from @var{name} and @var{attval}. Special case, if @var{attval} is @code{nil} this is an implied attribute. @end defun @defun sgml-attspec-name attspec Return the name of the attribute specified by @var{attspec}. @end defun @defun sgml-attspec-attval attspec Return the value (attval) of attribute specification @var{attspec}. If @var{attspec} is @code{nil}, @code{nil} is returned. @end defun @subsection Attribute Specification List Type @deftp {Data type} asl attspec* This is the result of parsing an attribute specification list. @end deftp @defun sgml-lookup-attspec name asl Return the attribute specification for attribute with @var{name} in the attribute specification list @var{asl}. If the attribute is unspecified @code{nil} is returned. @end defun @c ------------------------------------------------------------------ @node parser state, DTD, attribute, Types @comment node-name, next, previous, up @section Parser state The state of the parser that needs to be kept between commands are stored in a buffer local variable. Some global variables are initialised from this variable when parsing starts. @defvar sgml-buffer-parse-state The state of the parser that is kept between commands. The value of this variable is of type pstate. @end defvar @deftp {Data type} pstate The parser state. @end deftp @defun sgml-pstate-dtd pstate The document type information (dtd) for the parser. @end defun @c ------------------------------------------------------------------ @node DTD, entities, parser state, Types @comment node-name, next, previous, up @section DTD @deftp {Data type} dtd Represents what PSGML knows about the DTD. @end deftp @defun sgml-dtd-doctype dtd The document type name. @end defun @defun sgml-dtd-eltypes dtd The table of element types. @end defun @defun sgml-dtd-entities dtd The table of declared general entities (entity-table). @end defun @defun sgml-dtd-parameters dtd The table of declared parameter entities (entity-table). @end defun @defun sgml-dtd-shortmaps dtd The list of short reference maps. @end defun @defun sgml-dtd-notations dtd Not yet implemented. @end defun @c ------------------------------------------------------------------ @node entities, , DTD, Types @comment node-name, next, previous, up @section Entities @deftp {Data type} entity An entity has the following properties: @table @var @item name The name of the entity (a string). This is either the name of a declared entity (general or parameter) or the doctype name if it is the implicit entity referred to by the doctype declaration. @item type This is a symbol. It is @code{text} if it is a text entity, other values are @code{cdata}, @code{ndata}, @code{sdata}, @code{sgml} or @code{dtd}. @item text This is the text of the entity, either a string or an external identifier. @end table @end deftp Operations on entities @defun sgml-make-entity name type text Create an entity. @end defun @defun sgml-entity-name entity The name of the entity. @end defun @defun sgml-entity-type entity The type of the entity. @end defun @defun sgml-entity-text entity The text of the entity. @end defun @defun sgml-entity-insert-text entity Insert the text of the entity into the current buffer at point. @end defun @defun sgml-entity-data-p entity True if @var{entity} is a data entity, that is not of type @code{text}. @end defun @deftp {Data type} entity-table A table of entities that can be referenced by entity name. @end deftp @defun sgml-lookup-entity name entity-table The entity with named @var{name} in the table @var{entity-table}. If no such entity exists, @code{nil} is returned. @end defun @defun sgml-entity-declare name entity-table type text Create an entity from @var{name}, @var{type} and @var{text}; and enter the entity into the table @var{entity-table}. @end defun @defun sgml-entity-completion-table entity-table Make a completion table from the @var{entity-table}. @end defun @defun sgml-map-entities fn entity-table &optional collect Apply the function @var{fn} to all entities in @var{entity-table}. If @var{collect} is @code{t}, the results of the applications are collected in a list and returned. @end defun @c ------------------------------------------------------------------ @node Hooks, Implementation, Types, Top @comment node-name, next, previous, up @chapter Hooks @defvar sgml-open-element-hook The hook run by @code{sgml-open-element}. Theses functions are called with two arguments, the first argument is the opened element and the second argument is the attribute specification list. It is probably best not to refer to the content or the end-tag of the element. @end defvar @defvar sgml-close-element-hook The hook run by @code{sgml-close-element}. These functions are invoked with @code{sgml-current-tree} bound to the element just parsed. @end defvar @defvar sgml-doctype-parsed-hook This hook is called after the doctype has been parsed. It can be used to load any additional information into the DTD structure. @end defvar @defvar sgml-sysid-resolve-functions This variable should contain a list of functions. Each function should take one argument, the system identifier of an entity. If the function can handle that identifier, it should insert the text of the entity into the current buffer at point and return t. If the system identifier is not handled the function should return nil. @end defvar @defvar sgml-doctype-parsed-hook This hook is caled after the doctype has been parsed. It can be used to load any additional information into the DTD structure. @end defvar @defvar sgml-close-element-hook @c *** The hook run by `sgml-close-element'. These functions are invoked with `sgml-current-tree' bound to the element just parsed. @end defvar *** sgml-new-attribute-list-function This hook is run when a new element is inserted to construct the attribute specification list. The default function prompts for the required attributes. @c ------------------------------------------------------------------ @node Implementation, Index, Hooks, Top @comment node-name, next, previous, up @chapter Implementation notes @section Data Types and Operations @subsection Element Type @deftp {Data type} eltype Data type representing the information about an element type. An @code{eltype} has information from @samp{ELEMENT} and @samp{ATTLIST} declarations. It can also store data for the application. @end deftp The element types are symbols in a special oblist. The oblist is the table of element types. The symbols name is the GI, its value is used to store three flags and the function definition holds the content model. Other information about the element type is stored on the property list. @defun sgml-eltype-name et The name (a string) of the element type @var{et}. @end defun @defun sgml-eltype-appdata et prop Get application data from element type @var{et} with name @var{prop}. @var{prop} should be a symbol, reserved names are: flags, model, attlist, includes, excludes, conref-regexp, mixed, stag-optional, etag-optional. This function can be used as a place in @code{setf}, @code{push} and other functions from the CL library. @end defun @defun sgml-eltype-all-miscdata eltype A list of all data properties for eltype except for flags, model, includes and excludes. This function filters the property list of @var{eltype}. Used when saving the parsed DTD. @end defun @defun sgml-eltype-set-all-miscdata eltype miscdata Append the @var{miscdata} data properties to the properties of @var{eltype}. @end defun @defun sgml-eltype-attlist et The attribute specification list for the element type @var{et}. @end defun @defun sgml-eltype-completion-table eltypes Make a completion table from a list, @var{eltypes}, of element types. @end defun @defun sgml-eltype-stag-optional et True if the element type @var{et} has optional start-tag. @end defun @defun sgml-eltype-etag-optional et True if the element type @var{et} has optional end-tag. @end defun @defun sgml-eltype-excludes et The list of excluded element types for element type @var{et}. @end defun @defun sgml-eltype-includes et The list of included element types for element type @var{et}. @end defun @defun sgml-eltype-flags et Contains three flags as a number. The flags are stag-optional, etag-optional and mixed. @end defun @defun sgml-eltype-mixed et True if element type @var{et} has mixed content. @end defun @defun sgml-eltype-model et The content model of element type @var{et}. The content model is either the start state in the DFA for the content model or a symbol identifying a declared content. @end defun @defun sgml-eltype-shortmap et The name of the shortmap associated with element type @var{et}. This can also be the symbol @code{empty} (if declared with a @samp{} or @code{nil} (if no associated map). @end defun @defun sgml-eltype-token et Return a token for the element type @var{et}. @end defun @defun sgml-eltypes-in-state state tree List of element types valid in @var{state} and @var{tree}. @end defun @subsection DTD The DTD data type is realised as a lisp vector using @code{defstruct}. There are two additional fields for internal use: dependencies and merged. @defun sgml-dtd-dependencies dtd The list of files used to create this DTD. @end defun @defun sgml-dtd-merged dtd The pair (@var{file} . @var{merged-dtd}), if the DTD has had a precompiled dtd merged into it. @var{File} is the file containing the compiled DTD and @var{merged-dtd} is the DTD loaded from that file. @end defun @subsection Element and Tree @deftp {Data Type} tree This is the data type for the nodes in the tree build by the parser. @end deftp The tree nodes are represented as lisp vectors, using @code{defstruct} to define basic operations. The Element data type is a view of the tree built by the parser. @section Parsing model PSGML uses finite state machines and a stack to parse SGML. Every element type has an associated DFA (deterministic finite automaton). This DFA is constructed from the content model. SGML restricts the allowed content models in such a way that it is easy to directly construct a DFA. To be able to determine when a start-tag can be omitted the DFA need to contain some more information than the traditional DFA. In PSGML a DFA has a set of states and two sets of edges. The edges are associated with tokens (corresponding to SGML's primitive content tokens). I call these moves. One set of moves, the @dfn{optional moves}, represents optional tokens. I call the other set @dfn{required moves}. The correspondence to SGML definitions are: if there is precisely one required move from one state, then the associated token is required. A state is final if there is not required move from that state. The SGML construct @samp{(...&...&...)} (@dfn{AND-group}) is another problem. There is a simple translation to sequence- and or-connectors. For example @samp{(a & b & c)} is can be translated to: @example ((a, ((c, b) | (b, c))) | (b, ((a, c) | (c, a))) | (c, ((a, b) | (b, a))) ) @end example But this grows too fast to be of direct practical use. PSGML represents an AND-group with one DFA for every (SGML) token in the group. During parsing of an AND-group there is a pointer to a state in one of the group's DFAs, and a list of the DFAs for the tokens not yet satisfied. Most of this is hidden by the primitives for the state type. The parser only sees states in a DFA and moves. @section Entity manager @defun sgml-push-to-entity entity &optional ref-start type Set current buffer to a buffer containing the entity @var{entity}. @var{entity} can also be a file name. Optional argument @var{ref-start} should be the start point of the entity reference. Optional argument @var{type}, overrides the entity type in entity look up. @end defun @defun sgml-pop-entity Should be called after a @code{sgml-push-to-entity} (or similar). Restore the current buffer to the buffer that was current when the push to this buffer was made. @end defun @defun sgml-push-to-string string Create an entity from @var{string} and push it on the top of the entity stack. After this the current buffer will be a scratch buffer containing the text of the new entity with point at the first character. Use @code{sgml-pop-entity} to exit from this buffer. @end defun @c @section Lexical @section Parser functions @defun sgml-need-dtd This makes sure that the buffer has a DTD and set global variables needed by parsing routines. One global variable is @code{sgml-dtd-info} which contain the DTD (type dtd). @end defun @defun sgml-parse-to goal &optional extra-cond quiet This is the low level interface to the parser. Parse until (at least) @var{goal}, a buffer position. Optional argument @var{extra-cond} should be a function. This function is called in the parser loop, and the loop is exited if the function returns t. If third argument @var{quit} is non-@code{nil}, no "@samp{Parsing...}" message will be displayed. @end defun @defun sgml-reparse-buffer shortref-fun Reparse the buffer and let @var{shortref-fun} take care of short references. @var{shortref-fun} is called with the entity as argument and @code{sgml-markup-start} pointing to start of short reference and point pointing to the end. @end defun @section Saved DTD Format @format File = Comment, File version, S-expression --dependencies--, Parameter entites, Document type name, Elements, General entities, S-expression --shortref maps--, S-expression --notations-- Elements = Counted Sequence of S-expression --element type name--, Counted Sequence of Element type description File version = "(sgml-saved-dtd-version 5) " Comment = (";", (CASE OF [0-9] OF [11-255])*, [10] --end of line marker--)* Element type description = S-expression --Misc info--, CASE OF [0-7] --Flags 1:stag-opt, 2:etag-opt, 4:mixed--, Content specification, Token list --includes--, Token list --excludes-- OF [128] --Flag undefined element-- Content specification = CASE OF [0] --cdata-- OF [1] --rcdata-- OF [2] --empty-- OF [3] --any-- OF [4] --undefined-- OF [128] --model follows--, Model --nodes in the finite state automaton-- Model = Counted Sequence of Node Node = CASE OF Normal State OF And Node Normal State = Moves --moves for optional tokens--, Moves --moves for required tokens-- Moves = Counted Sequence of (Token, OCTET --state #--) And Node = [255] --signals an AND node--, Number --next state (node number)--, Counted Sequence of Model --set of models-- Token = Number --index in list of elements-- Number = CASE OF [0-250] --Small number 0--250-- OF [251-255] --Big number, first octet--, OCTET --Big number, second octet-- Token list = Counted Sequence of Token Parameter entites = S-expression --internal representation of parameter entities-- General entities = S-expression --internal representation of general entities-- Document type name = S-expression --name of document type as a string-- S-expression = OTHER Counted Sequence = Number_a --length of sequence--, (ARG_1)^a @end format @c ------------------------------------------------------------------ @node Index, , Implementation, Top @comment node-name, next, previous, up @chapter Index Types @printindex tp @bye ./psgml-1.4.0/psgml-charent.el0000640000076500000240000001017510212356414014357 0ustar dialout;;;; psgml-charent.el ;;; Last edited: 1999-12-18 18:54:53 lenst ;;; $Id: psgml-charent.el,v 1.7 2002/04/25 20:50:27 lenst Exp $ ;; Copyright (C) 1994 Lennart Staflin ;; Author: Steinar Bang, Falch Hurtigtrykk as., Oslo, 940711 ;; Lennart Staflin ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; Functions to convert character entities into displayable characters ;; and displayable characters back into character entities. ;; This should either use iso-cvt or do better with a multilingual set of entities ;;;; Code: (provide 'psgml-charent) (require 'psgml-parse) (eval-when-compile (require 'cl)) ;;;; Variable declarations (defvar sgml-display-char-list-filename (expand-file-name "iso88591.map" (file-name-directory (locate-library "psgml"))) "*Name of file holding relations between character codes and character names of displayable characters") (defvar sgml-display-char-alist-cache nil) ;;;; Function declarations (defun sgml-display-char-alist () "Return the current display character alist. Alist with entity name as key and display character as content." (unless (file-exists-p sgml-display-char-list-filename) (error "No display char file: %s" sgml-display-char-list-filename)) (sgml-cache-catalog sgml-display-char-list-filename 'sgml-display-char-alist-cache (function sgml-read-display-char-alist))) (defun sgml-read-display-char-alist () (let (key disp-char alist) (while (re-search-forward "^\\([0-9]+\\)[ \t]+\\(.+\\)$" nil t) (setq key (buffer-substring (match-beginning 2) (match-end 2))) (setq disp-char (string-to-number (buffer-substring (match-beginning 1) (match-end 1)))) (if (fboundp 'unibyte-char-to-multibyte) (setq disp-char (unibyte-char-to-multibyte disp-char))) (setq disp-char (char-to-string disp-char)) (push (cons key disp-char) alist)) alist)) (defun sgml-charent-to-dispchar-alist () "Association list to hold relations of the type (CHARACTER-NAME . CHARACTER) where CHARACTER-NAME is a string holding a character name CHARACTER is a string holding a single displayable character" (sgml-need-dtd) (let ((display-chars (sgml-display-char-alist)) (alist nil)) (sgml-map-entities (function (lambda (entity) (let ((char (cdr (assoc (sgml-entity-text entity) display-chars)))) (when char (push (cons (sgml-entity-name entity) char) alist))))) (sgml-dtd-entities sgml-dtd-info)) alist)) (defun sgml-charent-to-display-char () "Replace character entities with their display character equivalents" (interactive) (let ((charent-to-char (sgml-charent-to-dispchar-alist)) charent replacement) (save-excursion (goto-char (point-min)) (sgml-with-parser-syntax (while (re-search-forward "&\\(\\w\\(\\w\\|\\s_\\)*\\);?" nil t) (setq charent (buffer-substring-no-properties (match-beginning 1) (match-end 1))) (if (setq replacement (cdr (assoc charent charent-to-char))) (replace-match replacement t t))))))) (defun sgml-display-char-to-charent () "Replace displayable characters with their character entity equivalents" (interactive) (let ((case-fold-search nil)) (save-excursion (loop for pair in (sgml-charent-to-dispchar-alist) do (goto-char (point-min)) (while (search-forward (cdr pair) nil t) (replace-match (concat "&" (car pair) ";") t t)))))) ;;; psgml-charent.el ends here ./psgml-1.4.0/psgml-debug.el0000640000076500000240000002462012016746505014031 0ustar dialout;;;;\filename psgml-debug.el ;;;\Last edited: 2001-03-10 00:32:00 lenst ;;;\RCS $Id: psgml-debug.el,v 2.31 2005/03/02 19:43:45 lenst Exp $ ;;;\author {Lennart Staflin} ;;;\maketitle ;;\begin{codeseg} (provide 'psgml-debug) (require 'psgml) (require 'psgml-parse) (require 'psgml-edit) (require 'psgml-dtd) (autoload 'sgml-translate-model "psgml-dtd" "" nil) (eval-when-compile (require 'cl) (require 'elp) (require 'edebug)) ;;;; Debugging (define-key sgml-mode-map "\C-c," 'sgml-goto-cache) (define-key sgml-mode-map "\C-c\C-x" 'sgml-dump-tree) (define-key sgml-mode-map "\C-c." 'sgml-shortref-identify) (defun sgml-this-element () (interactive) (let ((tree (sgml-find-element-of (point)))) (sgml-dump-rec tree))) (defun sgml-goto-cache () (interactive) (setq sgml-dtd-info (sgml-pstate-dtd sgml-buffer-parse-state) sgml-top-tree (sgml-pstate-top-tree sgml-buffer-parse-state)) (sgml-goto-start-point (point)) (message "%s" (sgml-dump-node sgml-current-tree))) (defun sgml-dump-tree (arg) (interactive "P") (when arg (sgml-parse-to-here)) (with-output-to-temp-buffer "*Dump*" (sgml-dump-rec (sgml-pstate-top-tree sgml-buffer-parse-state)))) (defun sgml-auto-dump () (let ((standard-output (get-buffer-create "*Dump*")) (cb (current-buffer))) (when sgml-buffer-parse-state (unwind-protect (progn (set-buffer standard-output) (erase-buffer)) (set-buffer cb)) (sgml-dump-rec (sgml-pstate-top-tree sgml-buffer-parse-state)) )) ) (defun sgml-start-auto-dump () (interactive) (add-hook 'post-command-hook (function sgml-auto-dump) 'append)) (defun sgml-comepos (epos) (if (sgml-strict-epos-p epos) (format "%s:%s" (sgml-entity-name (sgml-eref-entity (sgml-epos-eref epos))) (sgml-epos-pos epos)) (format "%s" epos))) (defun sgml-dump-node (u) (format "%s%s start:%s(%s) end:%s(%s) epos:%s/%s net:%s\n" (make-string (sgml-tree-level u) ?. ) (sgml-element-gi u) (sgml-element-start u) (sgml-tree-stag-len u) (if (sgml-tree-etag-epos u) (sgml-tree-end u)) (sgml-tree-etag-len u) (sgml-comepos (sgml-tree-stag-epos u)) (sgml-comepos (sgml-tree-etag-epos u)) (sgml-tree-net-enabled u))) (defun sgml-dump-rec (u) (while u (princ (sgml-dump-node u)) (sgml-dump-rec (sgml-tree-content u)) (setq u (sgml-tree-next u)))) (defun sgml-shortref-identify () (interactive) (sgml-find-context-of (point)) (let* ((nobol (eq (point) sgml-rs-ignore-pos)) (tem (sgml-deref-shortmap sgml-current-shortmap nobol))) (message "%s (%s)" tem nobol))) (defun sgml-lookup-shortref-name (table map) (car (rassq map (cdr table)))) (defun sgml-show-current-map () (interactive) (sgml-find-context-of (point)) (let ((name (sgml-lookup-shortref-name (sgml-dtd-shortmaps sgml-dtd-info) sgml-current-shortmap))) (message "Current map: %s" (or name "#EMPTY")))) ;;;; For edebug ;;(put 'when 'edebug-form-hook t) ;;(put 'unless 'edebug-form-hook t) ;;(put 'push 'edebug-form-hook '(form sexp)) ;;(put 'setf 'edebug-form-hook '(sexp form)) (setq edebug-print-level 3 edebug-print-length 5 edebug-print-circle nil ) (eval-when (load) (unless sgml-running-lucid (def-edebug-spec sgml-with-parser-syntax (&rest form)) (def-edebug-spec sgml-with-parser-syntax-ro (&rest form)) (def-edebug-spec sgml-skip-upto (sexp)) (def-edebug-spec sgml-check-delim (sexp &optional sexp)) (def-edebug-spec sgml-parse-delim (sexp &optional sexp)) (def-edebug-spec sgml-is-delim (sexp &optional sexp sexp sexp)))) ;;;; dump (defun sgml-dump-dtd (&optional dtd) (interactive ) (unless dtd (setq dtd (sgml-pstate-dtd sgml-buffer-parse-state))) (with-output-to-temp-buffer "*DTD dump*" (princ (format "Dependencies: %S\n" (sgml-dtd-dependencies dtd))) (loop for et being the symbols of (sgml-dtd-eltypes dtd) do (sgml-dp-element et)))) (defun sgml-dump-element (el-name) (interactive (list (completing-read "Element: " (sgml-dtd-eltypes (sgml-pstate-dtd sgml-buffer-parse-state)) nil t))) (with-output-to-temp-buffer "*Element dump*" (sgml-dp-element (sgml-lookup-eltype el-name)))) (defun sgml-dp-element (el) (cond ((sgml-eltype-defined el) (princ (format "Element %s %s %s%s:\n" (sgml-eltype-name el) (if (sgml-eltype-stag-optional el) "O" "-") (if (sgml-eltype-etag-optional el) "O" "-") (if (sgml-eltype-mixed el) " mixed" ""))) (cond ((sgml-model-group-p (sgml-eltype-model el)) (sgml-dp-model (sgml-eltype-model el))) (t (prin1 (sgml-eltype-model el)) (terpri))) (princ (format "Exeptions: +%S -%S\n" (sgml-eltype-includes el) (sgml-eltype-excludes el))) (princ (format "Attlist: %S\n" (sgml-eltype-attlist el))) (princ (format "Plist: %S\n" (symbol-plist el)))) (t (princ (format "Undefined element %s\n" (sgml-eltype-name el))))) (terpri)) (defun sgml-dp-model (model &optional indent) (or indent (setq indent 0)) (let ((sgml-code-xlate (sgml-translate-model model))) (loop for i from 0 for x in sgml-code-xlate do (cond ((sgml-normal-state-p (car x)) (princ (format "%s%d: opts=%s reqs=%s\n" (make-string indent ? ) i (sgml-untangel-moves (sgml-state-opts (car x))) (sgml-untangel-moves (sgml-state-reqs (car x)))))) (t ; and-node (princ (format "%s%d: and-node next=%d\n" (make-string indent ? ) i (sgml-code-xlate (sgml-and-node-next (car x))))) (loop for m in (sgml-and-node-dfas (car x)) do (sgml-dp-model m (+ indent 2)))))))) (defun sgml-untangel-moves (moves) (loop for m in moves collect (list (sgml-move-token m) (sgml-code-xlate (sgml-move-dest m))))) ;;;; Dump state (defun sgml-dump-state () (interactive) (with-output-to-temp-buffer "*State dump*" (sgml-dp-state sgml-current-state))) (defun sgml-dp-state (state &optional indent) (or indent (setq indent 0)) (cond ((sgml-normal-state-p state) (sgml-dp-model state indent)) (t (princ (format "%sand-state\n" (make-string indent ? ))) (sgml-dp-state (sgml-and-state-substate state) (+ 2 indent)) (princ (format "%s--next\n" (make-string indent ? ))) (sgml-dp-state (sgml-and-state-next state) (+ 2 indent)) (princ (format "%s--dfas\n" (make-string indent ? ))) (loop for m in (sgml-and-state-dfas state) do (sgml-dp-model m (+ indent 2)) (princ (format "%s--\n" (make-string indent ? ))))))) ;;;; Build autoloads for all interactive functions in psgml-parse (defun sgml-build-autoloads () (interactive) (with-output-to-temp-buffer "*autoload*" (loop for file in '("psgml-parse" "psgml-edit" "psgml-dtd" "psgml-info" "psgml-charent") do (set-buffer (find-file-noselect (concat file ".el"))) (goto-char (point-min)) (while (and (not (eobp)) (re-search-forward "^(defun +\\([^ ]+\\)" nil t)) (let ((name (buffer-substring (match-beginning 1) (match-end 1))) doc) (forward-sexp 1) ; skip argument list (skip-chars-forward " \n\t") (when (eq ?\" (following-char)) ; doc string (setq doc (buffer-substring (point) (progn (forward-sexp 1) (point))))) (skip-chars-forward " \n\t") (when (looking-at "(interactive") (if (null doc) (message "No doc for %s" name)) (princ (format "(autoload '%s \"%s\" %s t)\n" name file doc)))))))) ;;;; Test psgml with sgmls test cases (defun test-sgml (start) (interactive "p") (let (file (sgml-show-warnings t)) (with-output-to-temp-buffer "*Testing psgml*" (while (progn (setq file (format "/u2/src/sgmls-1.1/test/test%03d.sgm" start)) (file-exists-p file)) (princ (format "*** File test%03d ***\n" start)) (find-file file) (condition-case errcode (progn (sgml-parse-prolog) ;;(sgml-next-trouble-spot) (sgml-parse-until-end-of nil)) (error (princ errcode) (terpri))) (if (get-buffer sgml-log-buffer-name) (princ (save-excursion (set-buffer sgml-log-buffer-name) (buffer-string)))) (terpri) (terpri) (sit-for 0) (kill-buffer (current-buffer)) (setq start (1+ start)))))) ;;;; Profiling (defun profile-sgml (&optional file) (interactive) (or file (setq file (expand-file-name "~/work/sigmalink/BBB/config/configspec.xml"))) (find-file file) (sgml-need-dtd) (sgml-instrument-parser) (elp-reset-all) (dotimes (i 5) (garbage-collect) (sgml-reparse-buffer (function sgml-handle-shortref))) (elp-results)) (defun sgml-instrument-parser () (interactive) (require 'elp) (setq elp-function-list nil) (elp-restore-all) (setq elp-function-list '( sgml-parse-to sgml-parser-loop sgml-parse-markup-declaration sgml-do-processing-instruction sgml-pop-entity sgml-tree-net-enabled sgml-do-end-tag sgml-do-data sgml-deref-shortmap sgml-handle-shortref sgml-do-start-tag sgml-do-general-entity-ref sgml-set-face-for sgml-pcdata-move sgml-shortmap-skipstring ;; sgml-parse-attribute-specification-list sgml-check-tag-close sgml-do-move sgml-open-element sgml-list-implications sgml-move-current-state sgml-do-empty-start-tag sgml-lookup-eltype sgml-startnm-char-next sgml-eltype-defined sgml-execute-implied sgml-next-sub-and sgml-get-and-move format )) (elp-instrument-list)) (defun sgml-instrument-dtd-parser () (interactive) (require 'elp) (setq elp-function-list nil) (elp-restore-all) (setq elp-function-list '( sgml-parse-prolog sgml-skip-ds sgml-parse-markup-declaration sgml-check-doctype-body ;; sgml-check-dtd-subset sgml-parse-ds sgml-declare-attlist sgml-declare-entity sgml-declare-element sgml-declare-shortref ;; sgml-parse-parameter-literal sgml-check-element-type sgml-check-primitive-content-token sgml-check-model-group ;; In sgml-check-model-group sgml-parse-modifier sgml-make-pcdata sgml-skip-ts sgml-make-opt sgml-make-* sgml-make-+ sgml-reduce-comma ;; formerly sgml-reduce-, sgml-reduce-| sgml-make-& sgml-make-conc sgml-copy-moves ;; is ps* sgml-do-parameter-entity-ref ;; sgml-make-primitive-content-token sgml-push-to-entity sgml-lookup-entity sgml-lookup-eltype sgml-one-final-state sgml-remove-redundant-states-1 )) (elp-instrument-list)) ;\end{codeseg} ./psgml-1.4.0/psgml-dtd.el0000640000000000000000000007615712016747034013726 0ustar rootroot;;;; psgml-dtd.el --- DTD parser for SGML-editing mode with parsing support ;; $Id: psgml-dtd.el,v 2.30 2003/03/25 19:46:09 lenst Exp $ ;; Copyright (C) 1994 Lennart Staflin ;; Author: Lennart Staflin ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; Part of major mode for editing the SGML document-markup language. ;;;; Code: (provide 'psgml-dtd) (require 'psgml) (require 'psgml-parse) (eval-when-compile (require 'cl)) ;;;; Variables ;; Variables used during doctype parsing and loading (defvar sgml-used-pcdata nil "True if model group built is mixed.") ;;;; Constructing basic (defun sgml-copy-moves (s1 s2) "Copy all moves from S1 to S2, keeping their status." (let ((l (sgml-state-opts s1))) (while l (sgml-add-opt-move s2 (sgml-move-token (car l)) (sgml-move-dest (car l))) (setq l (cdr l))) (setq l (sgml-state-reqs s1)) (while l (sgml-add-req-move s2 (sgml-move-token (car l)) (sgml-move-dest (car l))) (setq l (cdr l))))) (defun sgml-copy-moves-to-opt (s1 s2) "Copy all moves from S1 to S2 as optional moves." (let ((l (sgml-state-opts s1))) (while l (sgml-add-opt-move s2 (sgml-move-token (car l)) (sgml-move-dest (car l))) (setq l (cdr l))) (setq l (sgml-state-reqs s1)) (while l (sgml-add-opt-move s2 (sgml-move-token (car l)) (sgml-move-dest (car l))) (setq l (cdr l))))) (defun sgml-some-states-of (state) ;; List of some states reachable from STATE, includes all final states (let* ((states (list state)) (l states) s ms m) (while l (setq s (car l) ms (append (sgml-state-opts s) (sgml-state-reqs s))) (while ms (setq m (sgml-move-dest (car ms)) ms (cdr ms)) (unless (sgml-normal-state-p m) (setq m (sgml-and-node-next m))) (unless (memq m states) (nconc states (list m)))) (setq l (cdr l))) states)) (defmacro sgml-for-all-final-states (s dfa &rest forms) "For all final states S in DFA do FORMS. Syntax: var dfa-expr &body forms" `(let ((L-states (sgml-some-states-of ,dfa)) ,s) (while L-states (when (sgml-state-final-p (setq ,s (car L-states))) ,@forms) (setq L-states (cdr L-states))))) (put 'sgml-for-all-final-states 'lisp-indent-hook 2) (put 'sgml-for-all-final-states 'edebug-form-hook '(symbolp &rest form)) ;;;; Optimization for the dfa building (defsubst sgml-empty-state-p (s) ;; True if S has no outgoing moves (and (sgml-normal-state-p s) (null (sgml-state-reqs s)) (null (sgml-state-opts s))) ) (defun sgml-one-final-state (s) ;; Collapse all states that have no moves ;; This is a safe optimization, useful for (..|..|..) (sgml-debug "OPT one final: reqs %d opts %d" (length (sgml-state-reqs s)) (length (sgml-state-opts s))) (let ((final nil) dest) (loop for m in (append (sgml-state-reqs s) (sgml-state-opts s)) do (setq dest (sgml-move-dest m)) (when (sgml-empty-state-p dest) (cond ((null final) (setq final dest)) (t (setf (sgml-move-dest m) final))))))) (defun sgml-states-equal (s1 s2) (and (= (length (sgml-state-opts s1)) (length (sgml-state-opts s2))) (= (length (sgml-state-reqs s1)) (length (sgml-state-reqs s2))) (loop for m in (sgml-state-opts s1) always (eq (sgml-move-dest m) (sgml-move-dest (sgml-moves-lookup (sgml-move-token m) (sgml-state-opts s2))))) (loop for m in (sgml-state-reqs s1) always (eq (sgml-move-dest m) (sgml-move-dest (sgml-moves-lookup (sgml-move-token m) (sgml-state-reqs s2))))))) (defun sgml-remove-redundant-states-1 (s) ;; Remove states accessible from s with one move and equivalent to s, ;; by changing the moves from s. (sgml-debug "OPT redundant-1: reqs %d opts %d" (length (sgml-state-reqs s)) (length (sgml-state-opts s))) (let ((yes nil) (no (list s)) (l (sgml-state-reqs s)) (nl (sgml-state-opts s)) dest) (while (or l (setq l (prog1 nl (setq nl nil)))) (cond ((not (sgml-normal-state-p (setq dest (sgml-move-dest (car l)))))) ((memq dest no)) ((memq dest yes)) ((sgml-states-equal s dest) (progn (push dest yes)))) (setq l (cdr l))) (setq l (sgml-state-opts s) nl (sgml-state-reqs s)) (when yes (sgml-debug "OPT redundant-1: success %s" (length yes)) (while (or l (setq l (prog1 nl (setq nl nil)))) (cond ((memq (sgml-move-dest (car l)) yes) (setf (sgml-move-dest (car l)) s))) (setq l (cdr l)))))) ;;;; Constructing (defun sgml-make-opt (s1) (when (sgml-state-reqs s1) (setf (sgml-state-opts s1) (nconc (sgml-state-opts s1) (sgml-state-reqs s1))) (setf (sgml-state-reqs s1) nil)) s1) (defun sgml-make-* (s1) (setq s1 (sgml-make-+ s1)) (when (sgml-state-reqs s1) (sgml-make-opt s1)) (sgml-remove-redundant-states-1 s1) s1) (defun sgml-make-+ (s1) (sgml-for-all-final-states s s1 (sgml-copy-moves-to-opt s1 s)) (sgml-remove-redundant-states-1 s1) ; optimize s1) (defun sgml-make-conc (s1 s2) (let ((moves (append (sgml-state-reqs s1) (sgml-state-opts s1)))) (cond (;; optimize the case where all moves from s1 goes to empty states (loop for m in moves always (sgml-empty-state-p (sgml-move-dest m))) (loop for m in moves do (setf (sgml-move-dest m) s2)) (when (sgml-state-final-p s1) (sgml-copy-moves s2 s1))) (t ; general case (sgml-for-all-final-states s s1 (sgml-copy-moves s2 s) (sgml-remove-redundant-states-1 s))))) s1) (defun sgml-make-pcdata () (sgml-make-* (sgml-make-primitive-content-token sgml-pcdata-token))) (defun sgml-reduce-comma (l) ; formerly sgml-reduce-, (while (cdr l) (setcar (cdr l) (sgml-make-conc (car l) (cadr l))) (setq l (cdr l))) (car l)) (defun sgml-reduce-| (l) (while (cdr l) ; apply the binary make-alt (cond ((or (sgml-state-final-p (car l)) ; is result optional (sgml-state-final-p (cadr l))) (sgml-make-opt (car l)) (sgml-copy-moves-to-opt (cadr l) (car l))) (t (sgml-copy-moves (cadr l) (car l)))) (setcdr l (cddr l))) (sgml-one-final-state (car l)) ; optimization (car l)) (defun sgml-make-& (dfas) (let ((&n (sgml-make-and-node dfas (sgml-make-state))) (s (sgml-make-state)) (l dfas)) (while l ; For each si: ;; For m in opts(si): add optional move from s to &n on token(m). (loop for m in (sgml-state-opts (car l)) do (sgml-add-opt-move s (sgml-move-token m) &n)) ;; For m in reqs(si): add required move from s to &n on token(m). (loop for m in (sgml-state-reqs (car l)) do (sgml-add-req-move s (sgml-move-token m) &n)) (setq l (cdr l))) ;; Return s. s)) ;(sgml-make-conc (sgml-make-primitive-content-token 'para) (sgml-make-primitive-content-token 'list)) ;(sgml-make-conc (sgml-make-& (list (sgml-make-primitive-content-token 'para) (sgml-make-primitive-content-token 'list))) (sgml-make-primitive-content-token 'foo)) ;(setq x (sgml-some-states-of (sgml-make-primitive-content-token 'para))) ;(sgml-state-final-p (car x) ) ;(sgml-state-final-p (cadr x)) ;;;; Parse doctype: General (defun sgml-skip-ts () ;; Skip over ts* ;;70 ts = 5 s | EE | 60+ parameter entity reference ;;For simplicity I use ps* ;;65 ps = 5 s | EE | 60+ parameter entity reference | 92 comment ;;*** some comments are accepted that shouldn't (sgml-skip-ps)) (defun sgml-parse-character-reference (&optional dofunchar) ;; *** Actually only numerical character references ;; I don't know how to handel the function character references. ;; For the shortrefs let's give them numeric values. (if (if dofunchar (sgml-parse-delim "CRO" (digit nmstart)) (sgml-parse-delim "CRO" (digit))) (prog1 (if (sgml-is-delim "NULL" digit) (string-to-int (sgml-check-nametoken)) (let ((spec (sgml-check-name))) (or (cdr (assoc spec '(("RE" . 10) ("RS" . 1) ("TAB" . 9) ("SPACE" . 32)))) ;; *** What to do with other names? 127))) (or (sgml-parse-delim "REFC") (sgml-parse-RE))))) (defun sgml-parse-parameter-literal (&optional dofunchar) (let* (lita ; flag if lita (value ; accumulates literals value "") (original-buffer ; Buffer (entity) where lit started (current-buffer)) temp) (cond ((or (sgml-parse-delim "LIT") (setq lita (sgml-parse-delim "LITA"))) (while (not (and (eq (current-buffer) original-buffer) (if lita (sgml-parse-delim "LITA") (sgml-parse-delim "LIT")))) (cond ((eobp) (or (sgml-pop-entity) (sgml-error "Parameter literal unterminated"))) ((sgml-parse-parameter-entity-ref)) ((setq temp (sgml-parse-character-reference dofunchar)) (setq value (concat value (cond ((< temp 256) (if enable-multibyte-characters (setq temp (unibyte-char-to-multibyte temp))) (format "%c" temp)) (t (format "&#%d;" temp)))))) (t (setq value (concat value (buffer-substring-no-properties (point) (progn (forward-char 1) (if lita (sgml-skip-upto ("LITA" "PERO" "CRO")) (sgml-skip-upto ("LIT" "PERO" "CRO"))) (point)))))))) value)))) (defun sgml-check-parameter-literal () (or (sgml-parse-parameter-literal) (sgml-parse-error "Parameter literal expected"))) (defsubst sgml-parse-connector () (sgml-skip-ps) (cond ((sgml-parse-delim "SEQ") (function sgml-reduce-comma)) ; formerly sgml-reduce-, ((sgml-parse-delim "OR") (function sgml-reduce-|)) ((sgml-parse-delim "AND") (if sgml-xml-p (sgml-error "XML forbids AND connector") (function sgml-make-&))))) (defun sgml-parse-name-group () "Parse a single name or a name group (general name case) . Returns a list of strings or nil." (let (names) (cond ((sgml-parse-delim "GRPO") (sgml-skip-ps) (setq names (sgml-parse-name-group)) ; *** Allows more than it should (while (sgml-parse-connector) (sgml-skip-ps) (nconc names (sgml-parse-name-group))) (sgml-check-delim "GRPC") names) ((setq names (sgml-parse-name)) (list names))))) (defun sgml-check-name-group () (or (sgml-parse-name-group) (sgml-parse-error "Expecting a name or a name group"))) (defun sgml-check-nametoken-group () "Parse a name token group, return a list of strings. Case transformed for general names." (sgml-skip-ps) (let ((names nil)) (cond ((sgml-parse-delim GRPO) (while (progn (sgml-skip-ps) (push (sgml-general-case (sgml-check-nametoken)) names) (sgml-parse-connector))) (sgml-check-delim GRPC) (nreverse names)) ; store in same order as declared (t (list (sgml-general-case (sgml-check-nametoken))))))) (defun sgml-check-element-type () "Parse and check an element type, return list of strings." ;;; 117 element type = [[30 generic identifier]] ;;; | [[69 name group]] ;;; | [[118 ranked element]] ;;; | [[119 ranked group]] (cond ((sgml-parse-delim GRPO) (when sgml-xml-p (sgml-error "XML forbids name groups for the element type")) (sgml-skip-ts) (let ((names (list (sgml-check-name)))) (while (progn (sgml-skip-ts) (sgml-parse-connector)) (sgml-skip-ts) (nconc names (list (sgml-check-name)))) (sgml-check-delim GRPC) ;; A ranked group will have a rank suffix here (sgml-skip-ps) (if (sgml-is-delim "NULL" digit) (let ((suffix (sgml-parse-nametoken))) (loop for n in names collect (concat n suffix))) names))) (t ; gi/ranked element (let ((name (sgml-check-name))) (sgml-skip-ps) (list (if (sgml-is-delim "NULL" digit) (concat name (sgml-check-nametoken)) name)))))) (defun sgml-check-external (&optional pubid-ok) (or (sgml-parse-external pubid-ok) (sgml-parse-error "Expecting a PUBLIC or SYSTEM"))) ;;;; Parse doctype: notation (defun sgml-declare-notation () ;;148 notation declaration = MDO, "NOTATION", ;; 65 ps+, 41 notation name, ;; 65 ps+, 149 notation identifier, ;; 65 ps*, MDC ;;41 notation name = 55 name ;;149 notation identifier = 73 external identifier (sgml-skip-ps) (sgml-check-name) (sgml-skip-ps) (sgml-check-external t)) ;;;; Parse doctype: Element (defun sgml-parse-opt () (sgml-skip-ps) (cond ((or (sgml-parse-char ?o) (sgml-parse-char ?O)) (if sgml-xml-p (sgml-error "XML forbids omitted tag minimization.") t)) ((sgml-parse-char ?-) (if sgml-xml-p (sgml-error "XML forbids omitted tag minimization") nil)))) (defun sgml-parse-modifier () (cond ((sgml-parse-delim "PLUS") (function sgml-make-+)) ((sgml-parse-delim "REP") (function sgml-make-*)) ((sgml-parse-delim "OPT") (function sgml-make-opt)))) (defun sgml-check-primitive-content-token () (sgml-make-primitive-content-token (sgml-eltype-token (sgml-lookup-eltype (sgml-check-name))))) (defun sgml-check-model-group () (sgml-skip-ps) (let (el mod) (cond ((sgml-parse-delim "GRPO") (let ((subs (list (sgml-check-model-group))) (con1 nil) (con2 nil)) (while (setq con2 (sgml-parse-connector)) (cond ((and con1 (not (eq con1 con2))) (sgml-parse-error "Mixed connectors"))) (setq con1 con2) (setq subs (nconc subs (list (sgml-check-model-group))))) (sgml-check-delim "GRPC") (setq el (if con1 (funcall con1 subs) (car subs))))) ((sgml-parse-rni "PCDATA") ; #PCDATA (FIXME: when changing case) (setq sgml-used-pcdata t) (setq el (sgml-make-pcdata))) ((sgml-parse-delim "DTGO") ; data tag group (when sgml-xml-p (sgml-error "XML forbids DATATAG")) (sgml-skip-ts) (let ((tok (sgml-check-primitive-content-token))) (sgml-skip-ts) (sgml-check-delim "SEQ") (sgml-skip-ts) (sgml-check-data-tag-pattern) (sgml-skip-ts) (sgml-check-delim "DTGC") (setq el (sgml-make-conc tok (sgml-make-pcdata))) (setq sgml-used-pcdata t))) (t (setq el (sgml-check-primitive-content-token)))) (setq mod (sgml-parse-modifier)) (if mod (funcall mod el) el))) (defun sgml-check-data-tag-pattern () ;; 134 data tag pattern ;; template | template group (cond ((sgml-parse-delim GRPO) (sgml-skip-ts) (sgml-check-parameter-literal) ; data tag template, (while (progn (sgml-skip-ts) (sgml-parse-delim OR)) (sgml-skip-ts) (sgml-check-parameter-literal)) ; data tag template (sgml-skip-ts) (sgml-check-delim GRPC)) (t (sgml-check-parameter-literal))) ; data tag template (sgml-skip-ts) (when (sgml-parse-delim SEQ) (sgml-check-parameter-literal))) ; data tag padding template (defun sgml-check-content-model () (sgml-check-model-group)) (defun sgml-check-content () (sgml-skip-ps) (cond ((sgml-is-delim GRPO) (sgml-check-content-model)) (t ;; ANY, CDATA, RCDATA or EMPTY (let ((dc (intern (sgml-check-case (sgml-check-name))))) (cond ((eq dc 'ANY) (setq sgml-used-pcdata t)) ((eq dc 'CDATA) (when sgml-xml-p (sgml-error "XML forbids CDATA declared content"))) ((eq dc 'RCDATA) (when sgml-xml-p (sgml-error "XML forbids RCDATA declared content"))) ((eq dc 'EMPTY)) (t (sgml-error "Exptected content model group or one of %s" (if sgml-xml-p "ANY or EMPTY" "ANY, CDATA, RCDATA or EMPTY")))) dc)))) (defun sgml-parse-exception (type) (sgml-skip-ps) (if (sgml-parse-char type) (if sgml-xml-p (sgml-error "XML forbids inclusion and exclusion exceptions") (mapcar (function sgml-lookup-eltype) (sgml-check-name-group))))) (defun sgml-before-eltype-modification () ;;; (let ((merged (sgml-dtd-merged sgml-dtd-info))) ;;; (when (and merged ;;; (eq (sgml-dtd-eltypes sgml-dtd-info) ;;; (sgml-dtd-eltypes (cdr merged)))) ;;; (setf (sgml-dtd-eltypes sgml-dtd-info) ;;; (sgml-merge-eltypes (sgml-make-eltypes-table) ;;; (sgml-dtd-eltypes sgml-dtd-info))))) ) (defun sgml-declare-element () (let* ((names (sgml-check-element-type)) (stag-opt (sgml-parse-opt)) (etag-opt (sgml-parse-opt)) (sgml-used-pcdata nil) (model (sgml-check-content)) (exclusions (sgml-parse-exception ?-)) (inclusions (sgml-parse-exception ?+))) (sgml-before-eltype-modification) (while names (sgml-debug "Defining element %s" (car names)) (let ((et (sgml-lookup-eltype (car names)))) (setf (sgml-eltype-stag-optional et) stag-opt (sgml-eltype-etag-optional et) etag-opt (sgml-eltype-model et) model (sgml-eltype-mixed et) sgml-used-pcdata (sgml-eltype-excludes et) exclusions (sgml-eltype-includes et) inclusions)) (setq names (cdr names))) (sgml-lazy-message "Parsing doctype (%s elements)..." (incf sgml-no-elements)))) ;;;; Parse doctype: Entity (defun sgml-declare-entity () (let (name ; Name of entity dest ; Entity table (type 'text) ; Type of entity (notation nil) ; Notation of entity text ; Text of entity extid ; External id ) (cond ((sgml-parse-delim "PERO") ; parameter entity declaration (sgml-skip-ps) (setq name (sgml-check-name t)) (setq dest (sgml-dtd-parameters sgml-dtd-info))) (t ; normal entity declaration (or (sgml-parse-rni "DEFAULT") (setq name (sgml-check-name t))) (setq dest (sgml-dtd-entities sgml-dtd-info)))) (sgml-skip-ps) ;;105 entity text = 66 parameter literal ;; | 106 data text ;; | 107 bracketed text ;; | 108 external entity specification (setq extid (sgml-parse-external)) (setq text (cond (extid ; external entity specification = ; 73 external identifier, ; (65 ps+, 109+ entity type)? (sgml-skip-ps) (let ((tn (sgml-parse-entity-type))) (setq type (or (car tn) 'text)) (unless (eq (cdr tn) "") (setq notation (cdr tn)))) extid) ((sgml-startnm-char-next) (let ((token (intern (sgml-check-case (sgml-check-name))))) (sgml-skip-ps) (when (and sgml-xml-p (memq token '(CDATA SDATA PI STARTTAG ENDTAG MS MD))) (sgml-error "XML forbids %s entities" (upcase (symbol-name token)))) (cond ((memq token '(CDATA SDATA)) ; data text *** (setq type token) (sgml-check-parameter-literal)) ((eq token 'PI) (concat "")) ((eq token 'STARTTAG) (sgml-start-tag-of (sgml-check-parameter-literal))) ((eq token 'ENDTAG) (sgml-end-tag-of (sgml-check-parameter-literal))) ((eq token 'MS) ; marked section (concat "")) ((eq token 'MD) ; Markup declaration (concat ""))))) ((sgml-check-parameter-literal)))) (when dest (sgml-entity-declare name dest type text notation)))) (defun sgml-parse-entity-type () ;;109+ entity type = "SUBDOC" ;; | (("CDATA" | "NDATA" | "SDATA"), ;; 65 ps+, ;; 41 notation name, ;; 149.2+ data attribute specification?) (let ((type (sgml-parse-name)) (notation nil)) (when type (setq type (intern (sgml-check-case type))) (when (and sgml-xml-p (memq type '(SUBDOC CDATA SDATA))) (sgml-error "XML forbids %s entities" (upcase (symbol-name type)))) (cond ((eq type 'SUBDOC)) ((memq type '(CDATA NDATA SDATA)) (sgml-skip-ps) (setq notation (sgml-parse-name)) ;;149.2+ data attribute specification ;; = 65 ps+, DSO, ;; 31 attribute specification list, ;; 5 s*, DSC (sgml-skip-ps) (when (sgml-parse-delim DSO) (sgml-parse-attribute-specification-list) (sgml-parse-s) (sgml-check-delim DSC))) (t (sgml-error "Illegal entity type: %s" type)))) (cons type notation))) ;;;; Parse doctype: Attlist (defun sgml-declare-attlist () (let* ((assnot (cond ((sgml-parse-rni "NOTATION") (when sgml-xml-p (sgml-error "XML forbids data attribute declarations")) (sgml-skip-ps) t))) (assel (sgml-check-name-group)) (attlist nil) (attdef nil)) (when (and sgml-xml-p (> (length assel) 1)) (sgml-error "XML forbids name groups for an associated element type")) (while (setq attdef (sgml-parse-attribute-definition)) (push attdef attlist)) (setq attlist (nreverse attlist)) (unless assnot (sgml-before-eltype-modification) (loop for elname in assel do (setf (sgml-eltype-attlist (sgml-lookup-eltype elname)) (sgml-merge-attlists (sgml-eltype-attlist (sgml-lookup-eltype elname)) attlist)))))) (defun sgml-merge-attlists (old new) (setq old (nreverse (copy-sequence old))) (loop for att in new do (unless (assoc (car att) old) (setq old (cons att old)))) (nreverse old)) (defun sgml-parse-attribute-definition () (sgml-skip-ps) (if (sgml-is-delim "MDC") ; End of attlist? nil (sgml-make-attdecl (sgml-check-name) (sgml-check-declared-value) (sgml-check-default-value)))) (defun sgml-check-declared-value () (sgml-skip-ps) (let ((type 'name-token-group) (names nil)) (unless (eq (following-char) ?\() (setq type (intern (sgml-check-case (sgml-check-name)))) (sgml-validate-declared-value type) (sgml-skip-ps)) (when (memq type '(name-token-group NOTATION)) (setq names (sgml-check-nametoken-group))) (sgml-make-declared-value type names))) (defun sgml-validate-declared-value (type) (unless (memq type '(CDATA ENTITY ENTITIES ID IDREF IDREFS NAME NAMES NMTOKEN NMTOKENS NOTATION NUMBER NUMBERS NUTOKEN NUTOKENS)) (sgml-error "Invalid attribute declared value: %s" type)) (when (and sgml-xml-p (memq type '(NAME NAMES NUMBER NUMBERS NUTOKEN NUTOKENS))) (sgml-error "XML forbids %s attributes" (upcase (symbol-name type))))) (defun sgml-check-default-value () (sgml-skip-ps) (let* ((rni (sgml-parse-rni)) (key (if rni (intern (sgml-check-case (sgml-check-name)))))) (if rni (sgml-validate-default-value-rn key)) (sgml-skip-ps) (sgml-make-default-value key (if (or (not rni) (eq key 'FIXED)) (sgml-check-attribute-value-specification))))) (defun sgml-validate-default-value-rn (rn) (unless (memq rn '(REQUIRED FIXED CURRENT CONREF IMPLIED)) (sgml-error "Unknown reserved name: %s" (upcase (symbol-name rn)))) (when (and sgml-xml-p (memq rn '(CURRENT CONREF))) (sgml-error "XML forbids #%s attributes" (upcase (symbol-name rn))))) ;;;; Parse doctype: Shortref ;;;150 short reference mapping declaration = MDO, "SHORTREF", ;;; [[65 ps]]+, [[151 map name]], ;;; ([[65 ps]]+, [[66 parameter literal]], ;;; [[65 ps]]+, [[55 name]])+, ;;; [[65 ps]]*, MDC (defun sgml-declare-shortref () (let ((mapname (sgml-check-name)) mappings literal name) (while (progn (sgml-skip-ps) (setq literal (sgml-parse-parameter-literal 'dofunchar))) (sgml-skip-ps) (setq name (sgml-check-name t)) (push (cons literal name) mappings)) (sgml-add-shortref-map (sgml-dtd-shortmaps sgml-dtd-info) mapname (sgml-make-shortmap mappings)))) ;;;152 short reference use declaration = MDO, "USEMAP", ;;; [[65 ps]]+, [[153 map specification]], ;;; ([[65 ps]]+, [[72 associated element type]])?, ;;; [[65 ps]]*, MDC (defun sgml-do-usemap-element (mapname) ;; This is called from sgml-do-usemap with the mapname (sgml-before-eltype-modification) (loop for e in (sgml-parse-name-group) do (setf (sgml-eltype-shortmap (sgml-lookup-eltype e sgml-dtd-info)) (if (null mapname) 'empty mapname)))) ;;;; Parse doctype (defun sgml-check-dtd-subset () (let ((sgml-parsing-dtd t) (eref sgml-current-eref)) (while (progn (setq sgml-markup-start (point)) (cond ((and (eobp) (eq sgml-current-eref eref)) nil) ((sgml-parse-ds)) ((sgml-parse-markup-declaration 'dtd)) ((sgml-parse-delim "MS-END"))))))) ;;;; Save DTD: compute translation (defvar sgml-translate-table nil) (defun sgml-translate-node (node) (assert (not (numberp node))) (let ((tp (assq node sgml-translate-table))) (unless tp (setq tp (cons node (length sgml-translate-table))) (nconc sgml-translate-table (list tp))) (cdr tp))) (defun sgml-translate-moves (moves) (while moves (sgml-translate-node (sgml-move-dest (car moves))) (setq moves (cdr moves)))) (defun sgml-translate-model (model) (let* ((sgml-translate-table (list (cons model 0))) (p sgml-translate-table)) (while p (cond ((sgml-normal-state-p (caar p)) (sgml-translate-moves (sgml-state-opts (caar p))) (sgml-translate-moves (sgml-state-reqs (caar p)))) (t (sgml-translate-node (sgml-and-node-next (caar p))))) (setq p (cdr p))) sgml-translate-table)) ;;;; Save DTD: binary coding (defvar sgml-code-token-numbers nil) (defvar sgml-code-xlate nil) (defsubst sgml-code-xlate (node) ;;(let ((x (cdr (assq node sgml-code-xlate)))) (assert x) x) (cdr (assq node sgml-code-xlate))) (defun sgml-code-number (num) (if (> num sgml-max-single-octet-number) (insert (+ (lsh (- num sgml-max-single-octet-number) -8) sgml-max-single-octet-number 1) (logand (- num sgml-max-single-octet-number) 255)) (insert num))) (defun sgml-code-token-number (token) (let ((bp (assq token sgml-code-token-numbers))) (unless bp (setq sgml-code-token-numbers (nconc sgml-code-token-numbers (list (setq bp (cons token (length sgml-code-token-numbers))))))) (cdr bp))) (defun sgml-code-token (token) (sgml-code-number (sgml-code-token-number token))) (defmacro sgml-code-sequence (loop-c &rest body) "Produce the binary coding of a counted sequence from a list. Syntax: (var seq) &body forms FORMS should produce the binary coding of element in VAR." (let ((var (car loop-c)) (seq (cadr loop-c))) `(let ((seq ,seq)) (sgml-code-number (length seq)) (loop for ,var in seq do ,@body)))) (put 'sgml-code-sequence 'lisp-indent-hook 1) (put 'sgml-code-sequence 'edbug-forms-hook '(sexp &rest form)) (defun sgml-code-sexp (sexp) (let ((standard-output (current-buffer))) (prin1 sexp) (terpri))) (defun sgml-code-tokens (l) (sgml-code-sequence (x l) (sgml-code-token x))) (defsubst sgml-code-move (m) (sgml-code-token (sgml-move-token m)) (insert (sgml-code-xlate (sgml-move-dest m)))) (defun sgml-code-model (m) (let ((sgml-code-xlate (sgml-translate-model m))) (sgml-code-sequence (s sgml-code-xlate) ; s is (node . number) (setq s (car s)) ; s is node (cond ((sgml-normal-state-p s) (assert (and (< (length (sgml-state-opts s)) 255) (< (length (sgml-state-reqs s)) 256))) (sgml-code-sequence (x (sgml-state-opts s)) (sgml-code-move x)) (sgml-code-sequence (x (sgml-state-reqs s)) (sgml-code-move x))) (t ; s is a &-node (insert 255) ; Tag &-node (insert (sgml-code-xlate (sgml-and-node-next s))) (sgml-code-sequence (m (sgml-and-node-dfas s)) (sgml-code-model m))))))) (defun sgml-code-element (et) (sgml-code-sexp (sgml-eltype-all-miscdata et)) (cond ((not (sgml-eltype-defined et)) (insert 128)) (t (insert (sgml-eltype-flags et)) (let ((c (sgml-eltype-model et))) (cond ((eq c sgml-cdata) (insert 0)) ((eq c sgml-rcdata) (insert 1)) ((eq c sgml-empty) (insert 2)) ((eq c sgml-any) (insert 3)) ((null c) (insert 4)) (t (assert (sgml-model-group-p c)) (insert 128) (sgml-code-model c)))) (sgml-code-tokens (sgml-eltype-includes et)) (sgml-code-tokens (sgml-eltype-excludes et))))) (defun sgml-code-dtd (dtd) "Produce the binary coding of the current DTD into the current buffer." (sgml-code-sexp (sgml-dtd-dependencies dtd)) (sgml-code-sexp (sgml-dtd-parameters dtd)) (sgml-code-sexp (sgml-dtd-doctype dtd)) (let ((done 0) ; count written elements tot) (setq sgml-code-token-numbers nil) (sgml-code-token-number sgml-pcdata-token) ; Make #PCDATA token 0 (sgml-map-eltypes ; Assign numbers to all tokens (function (lambda (et) (sgml-code-token-number (sgml-eltype-token et)))) dtd nil t) (setq tot (length sgml-code-token-numbers)) ;; Produce the counted sequence of element type names (sgml-code-sequence (pair (cdr sgml-code-token-numbers)) (sgml-code-sexp (sgml-eltype-name (car pair)))) ;; Produce the counted sequence of element types (sgml-code-sequence (pair (cdr sgml-code-token-numbers)) (setq done (1+ done)) (sgml-code-element (car pair)) (sgml-lazy-message "Saving DTD %d%% done" (/ (* 100 done) tot))) (sgml-code-sexp (sgml-dtd-entities dtd)) (sgml-code-sexp (sgml-dtd-shortmaps dtd)) (sgml-code-sexp (sgml-dtd-notations dtd)))) ;;;; Save DTD (defun sgml-save-dtd (file) "Save the parsed dtd on FILE." (interactive (let* ((tem (expand-file-name (or sgml-default-dtd-file (sgml-default-dtd-file)))) (dir (file-name-directory tem)) (nam (file-name-nondirectory tem))) (list (read-file-name "Save DTD in: " dir tem nil nam)))) (setq file (expand-file-name file)) (when (equal file (buffer-file-name)) (error "Would clobber current file")) (sgml-need-dtd) (sgml-push-to-entity (sgml-make-entity "#SAVE" nil "")) (sgml-write-dtd sgml-dtd-info file) (sgml-pop-entity) (setq sgml-default-dtd-file (if (equal (expand-file-name default-directory) (file-name-directory file)) (file-name-nondirectory file) file)) (setq sgml-loaded-dtd file)) (defun sgml-write-dtd (dtd file) "Save the parsed DTD in FILE. Construct the binary coded DTD (bdtd) in the current buffer." (sgml-set-buffer-multibyte nil) (insert ";;; This file was created by psgml on " (current-time-string) " -*-coding:binary-*-\n" "(sgml-saved-dtd-version 7)\n") (let ((print-escape-multibyte t)) (sgml-code-dtd dtd)) (set 'file-type 1) (let ((coding-system-for-write 'no-conversion)) (write-region (point-min) (point-max) file))) ;;; psgml-dtd.el ends here ./psgml-1.4.0/psgml-edit.el0000640000076500000240000025002410212356414013657 0ustar dialout;;; psgml-edit.el --- Editing commands for SGML-mode with parsing support ;; ;; $Id: psgml-edit.el,v 2.73 2005/03/02 19:46:31 lenst Exp $ ;; Copyright (C) 1994, 1995, 1996 Lennart Staflin ;; Author: Lennart Staflin ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; Part of major mode for editing the SGML document-markup language. ;;;; Code: (provide 'psgml-edit) (require 'psgml) (require 'psgml-parse) (require 'psgml-ids) (eval-when-compile (require 'cl)) ;; (eval-when-compile ;; (setq byte-compile-warnings '(free-vars unresolved callargs redefine))) ;;;; Variables (defvar sgml-split-level nil "Used by sgml-split-element") ;;;; SGML mode: structure editing (defun sgml-last-element () "Return the element where last command left point. This either uses the save value in `sgml-last-element' or parses the buffer to find current open element." (setq sgml-markup-type nil) (if (and (not sgml-xml-p) (memq last-command sgml-users-of-last-element) sgml-last-element) ; Don't return nil sgml-last-element (setq sgml-last-element (sgml-find-context-of (point)))) ) (defun sgml-set-last-element (&optional el) (if el (setq sgml-last-element el)) (sgml-show-context sgml-last-element)) (defun sgml-beginning-of-element () "Move to after the start-tag of the current element. If the start-tag is implied, move to the start of the element." (interactive) (goto-char (sgml-element-stag-end (sgml-last-element))) (sgml-set-last-element (if (sgml-element-empty sgml-last-element) (sgml-element-parent sgml-last-element)))) (defun sgml-end-of-element () "Move to before the end-tag of the current element." (interactive) (goto-char (sgml-element-etag-start (sgml-last-element))) (sgml-set-last-element (if (sgml-element-empty sgml-last-element) (sgml-element-parent sgml-last-element)))) (defun sgml-backward-up-element () "Move backward out of this element level. That is move to before the start-tag or where a start-tag is implied." (interactive) (goto-char (sgml-element-start (sgml-last-element))) (sgml-set-last-element (sgml-element-parent sgml-last-element))) (defun sgml-up-element () "Move forward out of this element level. That is move to after the end-tag or where an end-tag is implied." (interactive) (goto-char (sgml-element-end (sgml-last-element))) (sgml-set-last-element (sgml-element-parent sgml-last-element))) (defun sgml-forward-element () "Move forward over next element." (interactive) (let ((next (sgml-find-element-after (point) (sgml-last-element)))) (goto-char (sgml-element-end next)) (sgml-set-last-element (sgml-element-parent next)))) (defun sgml-backward-element () "Move backward over previous element at this level. With implied tags this is ambiguous." (interactive) (let ((prev ; previous element (sgml-find-previous-element (point) (sgml-last-element)))) (goto-char (sgml-element-start prev)) (sgml-set-last-element (sgml-element-parent prev)))) (defun sgml-down-element () "Move forward and down one level in the element structure." (interactive) (let ((to (sgml-find-element-after (point) (sgml-last-element)))) (when (sgml-strict-epos-p (sgml-element-stag-epos to)) (error "Sub-element in other entity")) (goto-char (sgml-element-stag-end to)) (sgml-set-last-element (if (sgml-element-empty to) (sgml-element-parent to) to)))) (defun sgml-kill-element () "Kill the element following the cursor." (interactive "*") (sgml-parse-to-here) (when sgml-markup-type (error "Point is inside markup")) (kill-region (point) (sgml-element-end (sgml-find-element-after (point))))) (defun sgml-transpose-element () "Interchange element before point with element after point, leave point after." (interactive "*") (let ((pre (sgml-find-previous-element (point))) (next (sgml-find-element-after (point))) s1 s2 m2) (goto-char (sgml-element-start next)) (setq m2 (point-marker)) (setq s2 (buffer-substring (point) (sgml-element-end next))) (delete-region (point) (sgml-element-end next)) (goto-char (sgml-element-start pre)) (setq s1 (buffer-substring (point) (sgml-element-end pre))) (delete-region (point) (sgml-element-end pre)) (insert-before-markers s2) (goto-char m2) (insert s1) (sgml-message ""))) (defun sgml-mark-element () "Set mark after next element." (interactive) (push-mark (sgml-element-end (sgml-find-element-after (point))) nil t)) (defun sgml-mark-current-element () "Set mark at end of current element, and leave point before current element." (interactive) (let ((el (sgml-find-element-of (point)))) (goto-char (sgml-element-start el)) (push-mark (sgml-element-end el) nil t))) (defun sgml-change-element-name (gi) "Replace the name of the current element with a new name. Eventual attributes of the current element will be translated if possible." (interactive (list (let ((el (sgml-find-element-of (point)))) (goto-char (sgml-element-start el)) (sgml-read-element-name (format "Change %s to: " (sgml-element-name el)))))) (when (or (null gi) (equal gi "")) (error "Illegal name")) (let* ((element (sgml-find-element-of (point))) (attspec (sgml-element-attribute-specification-list element)) (oldattlist (sgml-element-attlist element)) (tagc (if (and sgml-xml-p (sgml-element-empty element)) (sgml-delim "XML-TAGCE") (sgml-delim "TAGC"))) (tagc-len (length tagc))) (goto-char (sgml-element-end element)) (unless (sgml-element-empty element) (delete-char (- (sgml-element-etag-len element)))) (insert (sgml-end-tag-of gi)) (goto-char (sgml-element-start element)) (delete-char (sgml-element-stag-len element)) (insert (sgml-delim "STAGO") (sgml-general-insert-case gi) tagc) (let* ((newel (sgml-find-context-of (point))) (newattlist (sgml-element-attlist newel)) (newasl (sgml-translate-attribute-specification-list attspec oldattlist newattlist))) (backward-char tagc-len) (sgml-insert-attributes newasl newattlist) (forward-char tagc-len)))) (defun sgml-translate-attribute-specification-list (values from to) "Translate attribute specification from one element type to another. Input attribute values in VALUES using attlist FROM is translated into a list using attlist TO." (let ((new-values nil) (sgml-show-warnings t) tem) (loop for attspec in values as from-decl = (sgml-lookup-attdecl (sgml-attspec-name attspec) from) as to-decl = (sgml-lookup-attdecl (sgml-attspec-name attspec) to) do (cond ;; Special case ID attribute ((and (eq 'ID (sgml-attdecl-declared-value from-decl)) (setq tem (sgml-attribute-with-declared-value to 'ID))) (push (sgml-make-attspec (sgml-attdecl-name tem) (sgml-attspec-attval attspec)) new-values)) ;; Use attribute with same name if compatible type ((equal (sgml-attdecl-declared-value from-decl) (sgml-attdecl-declared-value to-decl)) (push attspec new-values)) (to-decl (sgml-log-warning "Attribute %s has new declared-value" (sgml-attspec-name attspec)) (push attspec new-values)) (t (sgml-log-warning "Can't translate attribute %s = %s" (sgml-attspec-name attspec) (sgml-attspec-attval attspec))))) new-values)) (defun sgml-untag-element () "Remove tags from current element." (interactive "*") (let ((el (sgml-find-element-of (point)))) (when (or (sgml-strict-epos-p (sgml-element-stag-epos el)) (sgml-strict-epos-p (sgml-element-etag-epos el))) (error "Current element has some tag inside an entity reference")) (goto-char (sgml-element-etag-start el)) (delete-char (sgml-element-etag-len el)) (goto-char (sgml-element-start el)) (delete-char (sgml-element-stag-len el)))) (defun sgml-kill-markup () "Kill next tag, markup declaration or process instruction." (interactive "*") (let ((start (point))) (sgml-with-parser-syntax (sgml-parse-s) (setq sgml-markup-start (point)) (cond ((sgml-parse-markup-declaration 'ignore)) ((sgml-parse-processing-instruction)) ((sgml-skip-tag))) (kill-region start (point))))) ;;;; SGML mode: folding (defun sgml-fold-region (beg end &optional unhide) "Hide (or if prefixarg unhide) region. If called from a program first two arguments are start and end of region. And optional third argument true unhides." (interactive "r\nP") (setq selective-display t) (let ((mp (buffer-modified-p)) (inhibit-read-only t) (before-change-functions nil) (after-change-functions nil)) (unwind-protect (subst-char-in-region beg end (if unhide ?\r ?\n) (if unhide ?\n ?\r) 'noundo) (when sgml-buggy-subst-char-in-region (set-buffer-modified-p mp))))) (defun sgml-fold-element () "Fold the lines comprising the current element, leaving the first line visible. This uses the selective display feature." (interactive) (sgml-parse-to-here) (cond ((and (eq sgml-current-tree sgml-top-tree) ; outside document element sgml-markup-type) (sgml-fold-region sgml-markup-start (save-excursion (sgml-parse-to (point)) (point)))) ((and (eq sgml-current-tree sgml-top-tree) ; outside document element (looking-at " * sgml-indent-line %s %s" col (if element (sgml-element-gi element))) (when sgml-indent-step (let ((here (point-marker)) ;; Where the indentation goes, i.e., will this be data element-insert ;; Where we compute indentation, where the thing we indent is. ;; Can be different from above if end-tag is omitted. element-level) (back-to-indentation) (unless col ;; Determine element (setq element-insert (let ((sgml-throw-on-error 'parse-error)) (catch sgml-throw-on-error ;; This used to be (sgml-find-element-of (point)) ;; Why? Possibly to handle omitted end-tags (sgml-debug "-- sgml-indent-line find context") (sgml-find-context-of (point))))) (setq element-level element-insert) (when (and (not (eobp)) element-level) (setq element-level (sgml-find-element-of (point))) ;; It would be good if sgml-find-element-of would also tell ;; us if the character is in the start-tag/end-tag or ;; content (when (or (= (point) (sgml-element-start element-level)) (sgml-with-parser-syntax (sgml-is-end-tag))) (setq element-level (sgml-element-parent element-level))))) (when (eq element-level sgml-top-tree) ; not in a element at all (setq element-level nil) ; forget element (goto-char here)) ; insert normal tab insted) (when element-level (cond ((and (> (point) (sgml-element-start element-insert)) (< (point) (sgml-element-stag-end element-insert)) (not (sgml-element-data-p (sgml-element-parent element-insert)))) (setq col (funcall sgml-attribute-indent-function element-insert))) ((or sgml-indent-data (not (sgml-element-data-p element-insert))) (setq col (funcall sgml-content-indent-function element-level))))) (when (and col (/= col (current-column))) (beginning-of-line 1) (delete-horizontal-space) (indent-to col)) (when (< (point) here) (goto-char here)) col))) (defun sgml-next-data-field () "Move forward to next point where data is allowed." (interactive) (when (eobp) (error "End of buffer")) (let ((sgml-throw-on-warning 'next-data) (avoid-el (sgml-last-element))) ;; Avoid stopping in current element, unless point is in the start ;; tag of the element (when (< (point) (sgml-element-stag-end avoid-el)) (setq avoid-el nil)) (catch sgml-throw-on-warning (while (progn (sgml-parse-to (1+ (point))) (setq sgml-last-element (if (not (eq ?< (following-char))) (sgml-find-element-of (point)) sgml-current-tree)) (or (eq sgml-last-element avoid-el) (not (sgml-element-data-p sgml-last-element))))) (sgml-set-last-element)))) (defun sgml-next-trouble-spot () "Move forward to next point where something is amiss with the structure." (interactive) (push-mark) (sgml-note-change-at (point)) ; Prune the parse tree (sgml-parse-to (point)) (let ((sgml-throw-on-warning 'trouble)) (or (catch sgml-throw-on-warning (sgml-parse-until-end-of nil t)) (message "Ok")))) ;;;; SGML mode: information display (defun sgml-list-valid-tags () "Display a list of the contextually valid tags." (interactive) (sgml-parse-to-here) (let ((model (sgml-element-model sgml-current-tree)) (smap-name (sgml-lookup-shortref-name (sgml-dtd-shortmaps sgml-dtd-info) sgml-current-shortmap))) (with-output-to-temp-buffer "*Tags*" (princ (format "Current element: %s %s\n" (sgml-element-name sgml-current-tree) (if (sgml-eltype-defined (sgml-element-eltype sgml-current-tree)) "" "[UNDEFINED]"))) (princ (format "Element content: %s %s\n" (cond ((or (sgml-current-mixed-p) (eq model sgml-any)) "mixed") ((sgml-model-group-p model) "element") (t model)) (if (eq model sgml-any) "[ANY]" ""))) (when smap-name (princ (format "Current short reference map: %s\n" smap-name))) (cond ((sgml-final-p sgml-current-state) (princ "Valid end-tags : ") (loop for e in (sgml-current-list-of-endable-eltypes) do (princ (sgml-end-tag-of e)) (princ " ")) (terpri)) (t (princ "Current element can not end here\n"))) ;;; (let ((s (sgml-tree-shortmap sgml-current-tree))) ;;; (when s ;;; (princ (format "Current shortref map: %s\n" s)))) (princ "Valid start-tags\n") (sgml-print-valid-tags "In current element:" sgml-current-tree sgml-current-state)))) (defun sgml-print-valid-tags (prompt tree state &optional exclude omitted-stag) (if (not (sgml-model-group-p state)) (princ (format "%s (in %s)\n" prompt state)) (let* ((req (sgml-required-tokens state)) (elems (nconc req (delq sgml-pcdata-token (sgml-optional-tokens state)))) (in (sgml-tree-includes tree)) (ex (append exclude (sgml-tree-excludes tree)))) ;; Modify for exceptions (while in (unless (memq (car in) elems) (setq elems (nconc elems (list (car in))))) (setq in (cdr in))) (while ex (setq elems (delq (car ex) elems)) (setq ex (cdr ex))) ;; (setq elems (sort elems (function string-lessp))) (sgml-print-list-of-tags prompt elems) ;; Check for omissable start-tags (when (and req (null (cdr req))) ;; *** Assumes tokens are eltypes (let ((el (sgml-fake-open-element tree (car req)))) (when (sgml-element-stag-optional el) (sgml-print-valid-tags (format "If omitting %s:" (sgml-start-tag-of el)) el (sgml-element-model el) (append exclude elems) 'omitted-stag)))) ;; Check for omissable end-tag (when (and (not omitted-stag) (sgml-final-p state) (sgml-element-etag-optional tree)) (sgml-print-valid-tags (format "If omitting %s:" (sgml-end-tag-of tree)) (sgml-element-parent tree) (sgml-element-pstate tree) (append exclude elems)))))) (defun sgml-print-list-of-tags (prompt list) (when list (princ prompt) (let ((col (length prompt)) (w (1- (frame-width)))) (loop for e in list as str = (sgml-start-tag-of e) do (setq col (+ col (length str) 2)) (cond ((>= col w) (setq col (+ (length str) 2)) (terpri))) (princ " ") (princ str)) (terpri)))) (defun sgml-show-context-standard (el &optional markup-type) (let* ((model (sgml-element-model el))) (format "%s %s" (cond (markup-type (format "%s" markup-type)) ((sgml-element-mixed el) "#PCDATA") ((not (sgml-model-group-p model)) model) (t "")) (if (eq el sgml-top-tree) "in empty context" (sgml-element-context-string el))))) (defun sgml-show-context-backslash (el &optional markup-type) (let ((gis nil)) (while (not (sgml-off-top-p el)) (push (sgml-element-gi el) gis) (setq el (sgml-element-parent el))) (mapconcat #'sgml-general-insert-case gis "\\"))) (defun sgml-show-context (&optional element) "Display where the cursor is in the element hierarchy." (interactive) (message "%s" (funcall sgml-show-context-function (or element (sgml-last-element)) (if element nil sgml-markup-type)))) (defun sgml-what-element () "Display what element is under the cursor." (interactive) (let* ((pos (point)) (nobol (eq (point) sgml-rs-ignore-pos)) (sref (and sgml-current-shortmap (sgml-deref-shortmap sgml-current-shortmap nobol))) (el nil)) (goto-char pos) (setq el (sgml-find-element-of pos)) (assert (not (null el))) (message "%s %s" (cond ((eq el sgml-top-tree) "outside document element") ((< (point) (sgml-element-stag-end el)) "start-tag") ((>= (point) (sgml-element-etag-start el)) "end-tag") (sref "shortref") (t "content")) (sgml-element-context-string el)))) ;;;; SGML mode: keyboard inserting (defun sgml-coerce-element-type (obj) (when (stringp obj) (setq obj (sgml-lookup-eltype (sgml-general-case obj)))) (when nil ;FIXME: need predicate (setq obj (sgml-tree-eltype obj))) obj) (defun sgml-break-brefore-stag-p (element) (sgml-eltype-appdata (sgml-coerce-element-type element) 'break-brefore-stag)) (defun sgml-break-after-stag-p (element) (sgml-eltype-appdata (sgml-coerce-element-type element) 'break-after-stag)) (defun sgml-insert-break () (skip-chars-backward " \t") (cond ((bolp) (if (looking-at "^\\s-*$") (fixup-whitespace))) (t ;; FIXME: fixup-whitespace ?? (insert "\n")))) (defun sgml-insert-tag (tag &optional silent no-nl-after) "Insert a tag, reading tag name in minibuffer with completion. If sgml-leave-point-after-insert is t, the point is left after the inserted tag(s), unless the element has some required content. If sgml-leave-point-after-insert is nil the point is left after the first tag inserted." (interactive (list (let ((completion-ignore-case sgml-namecase-general)) (completing-read "Tag: " (sgml-completion-table) nil t "<" )))) (sgml-find-context-of (point)) (assert (null sgml-markup-type)) ;; Fix white-space before tag (unless (sgml-element-data-p (sgml-parse-to-here)) (skip-chars-backward " \t") (cond ((bolp) (if (looking-at "^\\s-*$") (fixup-whitespace))) (t (insert "\n")))) (insert tag) (sgml-indent-line) (unless no-nl-after (save-excursion (unless (sgml-element-data-p (sgml-parse-to-here)) (unless (eolp) (save-excursion (insert "\n")))))) (or silent (sgml-show-context))) (defvar sgml-new-attribute-list-function (function sgml-default-asl)) (defun sgml-insert-element (name &optional after silent) "Reads element name from minibuffer and inserts start and end tags. If sgml-leave-point-after-insert is t, the point is left after the inserted tag(s), unless the element has some required content. If sgml-leave-point-after-insert is nil the point is left after the first tag inserted." (interactive (list (sgml-read-element-name "Element: ") sgml-leave-point-after-insert)) (let (newpos ; position to leave cursor at element ; inserted element (sgml-show-warnings nil)) (when (and name (not (equal name ""))) (when (sgml-break-brefore-stag-p name) (sgml-insert-break)) (sgml-insert-tag (sgml-start-tag-of name) 'silent) (if (and sgml-xml-p (sgml-check-empty name)) (forward-char -2) (forward-char -1)) (setq element (sgml-find-element-of (point))) (sgml-insert-attributes (funcall sgml-new-attribute-list-function element) (sgml-element-attlist element)) ;; Get element with new attributes (setq element (sgml-find-context-of (point))) (if (and sgml-xml-p (sgml-check-empty name)) (forward-char 2) (forward-char 1)) (when (sgml-break-after-stag-p name) (sgml-insert-break)) (when (not (sgml-element-empty element)) (when (and sgml-auto-insert-required-elements (sgml-model-group-p sgml-current-state)) (let (tem) (while (and (setq tem (sgml-required-tokens sgml-current-state)) (null (cdr tem))) (setq tem (sgml-insert-element (car tem) t t)) (setq newpos (or newpos tem)) (sgml-parse-to-here)) (when tem ; more than one req elem (insert "\n") (when sgml-insert-missing-element-comment (insert (format "" tem)) (sgml-indent-line))))) (setq newpos (or newpos (point))) (when sgml-insert-end-tag-on-new-line (insert "\n")) (sgml-insert-tag (sgml-end-tag-of name) 'silent) (unless after (goto-char newpos)) (unless silent (sgml-show-context))) newpos))) (defun sgml-default-asl (element) (loop for attdecl in (sgml-element-attlist element) when (sgml-default-value-type-p (sgml-attdecl-default-value attdecl) 'REQUIRED) collect (sgml-make-attspec (sgml-attdecl-name attdecl) (sgml-read-attribute-value attdecl (sgml-element-name element) nil)))) (defun sgml-tag-region (element start end) "Reads element name from minibuffer and inserts start and end tags." (interactive (list (save-excursion (goto-char (region-beginning)) (sgml-read-element-name "Tag region with element: ")) (region-beginning) (region-end))) (save-excursion (when (and element (not (equal element ""))) (goto-char end) (insert (sgml-end-tag-of element)) (goto-char start) (sgml-insert-tag (sgml-start-tag-of element))))) (defun sgml-insert-attributes (avl attlist) "Insert the attributes with values AVL and declarations ATTLIST. AVL should be a assoc list mapping symbols to strings." (let (name val dcl def) (loop for attspec in attlist do (setq name (sgml-attspec-name attspec) val (cdr-safe (sgml-lookup-attspec name avl)) dcl (sgml-attdecl-declared-value attspec) def (sgml-attdecl-default-value attspec)) (setq name (sgml-general-insert-case name)) (unless val ; no value given ;; Supply the default value if a value is needed (cond ((sgml-default-value-type-p 'REQUIRED def) (setq val "")) ((and (or (not (or sgml-xml-p sgml-omittag sgml-shorttag)) sgml-insert-defaulted-attributes) (consp def)) (setq val (sgml-default-value-attval def))))) (when val (cond ((eq dcl 'CDATA)) ((eq dcl 'ENTITY) (setq val (sgml-entity-insert-case val))) (t (setq val (sgml-general-insert-case val))))) (cond ((null val)) ; Ignore ;; Ignore attributes with default value ((and (consp def) (eq sgml-minimize-attributes 'max) (or sgml-omittag sgml-shorttag) (equal val (sgml-default-value-attval def)))) ;; No attribute name for token groups ((and sgml-minimize-attributes sgml-shorttag (member (sgml-general-case val) (sgml-declared-value-token-group dcl))) (insert " " val)) (t (insert " " name "=" (sgml-quote-attribute-value val))))) (when auto-fill-function (funcall auto-fill-function)))) (defun sgml-quote-attribute-value (value) "Add quotes to the string VALUE unless minimization is on." (let ((quote "")) (cond ((and (not sgml-always-quote-attributes) sgml-shorttag (string-match "\\`[-.A-Za-z0-9]+\\'" value)) ) ; no need to quote ((not (string-match "\"" value)) ; can use "" quotes (setq quote "\"")) (t ; use '' quotes (setq quote "'"))) (concat quote value quote))) (defun sgml-completion-table (&optional avoid-tags-in-cdata) (sgml-parse-to-here) (when sgml-markup-type (error "No tags allowed")) (cond ((or (sgml-model-group-p sgml-current-state) (eq sgml-current-state sgml-any)) (append (mapcar (function (lambda (x) (cons (sgml-end-tag-of x) x))) (sgml-current-list-of-endable-eltypes)) (mapcar (function (lambda (x) (cons (sgml-start-tag-of x) x))) (sgml-current-list-of-valid-eltypes)))) (t (sgml-message "%s" sgml-current-state) nil))) (defun sgml-element-endable-p () (sgml-parse-to-here) (and (not (eq sgml-current-tree sgml-top-tree)) (sgml-final-p sgml-current-state))) (defun sgml-insert-end-tag () "Insert end-tag for the current open element." (interactive "*") (sgml-parse-to-here) (cond ((eq sgml-current-tree sgml-top-tree) (sgml-error "No open element")) ((not (sgml-final-p sgml-current-state)) (sgml-error "Can`t end element here")) (t (when (and sgml-indent-step (not (sgml-element-data-p sgml-current-tree))) (delete-horizontal-space) (unless (bolp) (insert "\n"))) (when (prog1 (bolp) (insert (if (eq t (sgml-element-net-enabled sgml-current-tree)) "/" (sgml-end-tag-of sgml-current-tree)))) (sgml-indent-line))))) (defun sgml-insert-start-tag (name asl attlist &optional net) ;; Insert a start-tag with attributes ;; if NET is true end with NESTC unless XML then end with NESTC NET ;; (aka XML-TAGCE). (insert (sgml-delim "STAGO") (sgml-general-insert-case name)) (sgml-insert-attributes asl attlist) ;; In XML, force net if element is always empty (when (and sgml-xml-p (sgml-check-empty name)) (setq net t)) (insert (if net (if sgml-xml-p (sgml-delim "XML-TAGCE") (sgml-delim "NESTC")) (sgml-delim "TAGC")))) (defun sgml-change-start-tag (element asl) (let ((name (sgml-element-gi element)) (attlist (sgml-element-attlist element))) ;; Concoct an attribute specification list using the names of the ;; existing attributes and those ot be changed. (when (and (not attlist) sgml-dtd-less) (dolist (elt (mapcar 'car asl)) (unless (assoc elt attlist) ; avoid duplicates (push (sgml-make-attdecl elt 'CDATA 'REQUIRED) attlist))) (setq attlist (nreverse attlist))) (assert (sgml-bpos-p (sgml-element-stag-epos element))) (goto-char (sgml-element-start element)) (delete-char (sgml-element-stag-len element)) (sgml-insert-start-tag name asl attlist (if sgml-xml-p (sgml-element-empty element) (eq t (sgml-element-net-enabled element)))))) (defun sgml-read-attribute-value (attdecl element curvalue) "Return the attribute value read from user. ATTDECL is the attribute declaration for the attribute to read. CURVALUE is nil or a string that will be used as default value." (assert attdecl) (let* ((name (sgml-attdecl-name attdecl)) (dv (sgml-attdecl-declared-value attdecl)) (tokens (sgml-declared-value-token-group dv)) (notations (sgml-declared-value-notation dv)) ; JDF's addition (ids (and (memq dv '(IDREF IDREFS)) (sgml-id-list))) (type (cond (tokens "token") (notations "NOTATION") (t (symbol-name dv)))) (prompt (format "Value for %s in %s (%s%s): " name element type (if (and curvalue (not (eq dv 'IDREFS))) (format " Default: %s" curvalue) ""))) value) (setq value (cond ((or tokens notations) (let ((completion-ignore-case sgml-namecase-general)) (completing-read prompt (mapcar 'list (or tokens notations)) nil t))) (ids (let ((completion-ignore-case sgml-namecase-general) (minibuffer-local-completion-map sgml-edit-idrefs-map)) (completing-read prompt 'sgml-idrefs-completer nil nil (and curvalue (cons curvalue (length curvalue)))))) (t (read-string prompt)))) (if (and curvalue (equal value "")) curvalue value))) (defun sgml-idrefs-completer (fullstring pred action) (let* ((start (string-match "\\(\\(:?-\\|\\w\\)*\\)$" fullstring)) (string (match-string 0 fullstring)) (prefix (substring fullstring 0 start))) ;(message "prefix: %s string: %s" prefix string) (cond ((null action) (let ((completion (try-completion string (sgml-id-alist) pred))) (if (eq completion t) t (concat prefix completion)))) ((eq action t) (all-completions string (sgml-id-alist) pred)) ((eq action 'lambda) (member string (sgml-id-alist)))))) (defun sgml-non-fixed-attributes (attlist) (loop for attdecl in attlist unless (sgml-default-value-type-p 'FIXED (sgml-attdecl-default-value attdecl)) collect attdecl)) (defun sgml-insert-attribute (name value) "Read attribute name and value from minibuffer and insert attribute spec." (interactive (let* ((el (sgml-find-attribute-element)) (name (sgml-general-case (let ((completion-ignore-case sgml-namecase-general)) (completing-read "Attribute name: " (mapcar (function (lambda (a) (list (sgml-attdecl-name a)))) (if sgml-dtd-less (sgml-tree-asl el) (sgml-non-fixed-attributes (sgml-element-attlist el)))) nil (not sgml-dtd-less)))))) (list name (sgml-read-attribute-value (if sgml-dtd-less (list name) (sgml-lookup-attdecl name (sgml-element-attlist el))) (sgml-element-name el) (sgml-element-attval el name))))) ;; Body (assert (stringp name)) (assert (or (null value) (stringp value))) (let* ((el (sgml-find-attribute-element)) (asl (cons (sgml-make-attspec name value) (sgml-element-attribute-specification-list el))) (in-tag (< (point) (sgml-element-stag-end el)))) (sgml-change-start-tag el asl) (when in-tag (forward-char -1)))) (defun sgml-split-element () "Split the current element at point. If repeated, the containing element will be split before the beginning of then current element." (interactive "*") (setq sgml-split-level (if (eq this-command last-command) (1+ sgml-split-level) 0)) (let ((u (sgml-find-context-of (point))) (start (point-marker))) (loop repeat sgml-split-level do (goto-char (sgml-element-start u)) (setq u (sgml-element-parent u))) ;; Verify that a new element can be started (unless (and (sgml-element-pstate u) ; in case of top element (sgml-get-move (sgml-element-pstate u) (sgml-element-name u))) (sgml-error "The %s element can't be split" (sgml-element-name u))) ;; Do the split (sgml-insert-end-tag) (insert ?\n) (sgml-insert-tag (sgml-start-tag-of u) 'silent) (skip-chars-forward " \t\n") (sgml-indent-line) (when (> sgml-split-level 0) (goto-char start)) (or (eq sgml-top-tree (setq u (sgml-element-parent u))) (sgml-message "Repeat the command to split the containing %s element" (sgml-element-name u))))) ;;; David Megginson's custom menus for keys (defun sgml-custom-dtd (doctype) "Insert a DTD declaration from the sgml-custom-dtd alist." (interactive (list (completing-read "Insert DTD: " sgml-custom-dtd nil t))) (let ((entry (assoc doctype sgml-custom-dtd))) (sgml-doctype-insert (second entry) (cddr entry)))) (defun sgml-custom-markup (markup) "Insert markup from the sgml-custom-markup alist." (interactive (let ((completion-ignore-case sgml-namecase-general)) (list (completing-read "Insert Markup: " sgml-custom-markup nil t)))) (sgml-insert-markup (cadr (assoc markup sgml-custom-markup)))) ;;;; SGML mode: Menu inserting (defun sgml-tags-menu (event) "Pop up a menu with valid tags and insert the chosen tag. If the variable sgml-balanced-tag-edit is t, also inserts the corresponding end tag. If sgml-leave-point-after-insert is t, the point is left after the inserted tag(s), unless the element has some required content. If sgml-leave-point-after-insert is nil the point is left after the first tag inserted." (interactive "*e") (let ((end (sgml-mouse-region))) (sgml-parse-to-here) (cond ((eq sgml-markup-type 'start-tag) (sgml-attrib-menu event)) (t (let ((what (sgml-menu-ask event (if (or end sgml-balanced-tag-edit) 'element 'tags)))) (cond ((null what)) (end (sgml-tag-region what (point) end)) (sgml-balanced-tag-edit (sgml-insert-element what)) (t (sgml-insert-tag what)))))))) (defun sgml-element-menu (event) "Pop up a menu with valid elements and insert choice. If sgml-leave-point-after-insert is nil the point is left after the first tag inserted." (interactive "*e") (let ((what (sgml-menu-ask event 'element))) (and what (sgml-insert-element what)))) (defun sgml-add-element-menu (event) (interactive "*e") (let ((what (sgml-menu-ask event 'add-element))) (and what (sgml-add-element-to-element what nil)))) (defun sgml-start-tag-menu (event) "Pop up a menu with valid start-tags and insert choice." (interactive "*e") (let ((what (sgml-menu-ask event 'start-tag))) (and what (sgml-insert-tag what)))) (defun sgml-end-tag-menu (event) "Pop up a menu with valid end-tags and insert choice." (interactive "*e") (let ((what (sgml-menu-ask event 'end-tag))) (and what (sgml-insert-tag what)))) (defun sgml-tag-region-menu (event) "Pop up a menu with valid elements and tag current region with the choice." (interactive "*e") (let ((what (sgml-menu-ask event 'element))) (and what (sgml-tag-region what (region-beginning) (region-end))))) (defun sgml-menu-ask (event type) (sgml-parse-to-here) (let (tab (title (capitalize (symbol-name type)))) (cond ((eq type 'add-element) (setq tab (mapcar #'sgml-eltype-name (sgml--all-possible-elements (sgml-find-context-of (point)))))) (sgml-markup-type) ((eq type 'element) (setq tab (mapcar (function symbol-name) (sgml-current-list-of-valid-eltypes)))) (t (unless (eq type 'start-tag) (setq tab (mapcar (function sgml-end-tag-of) (sgml-current-list-of-endable-eltypes)))) (unless (eq type 'end-tag) (setq tab (nconc tab (mapcar (function sgml-start-tag-of) (sgml-current-list-of-valid-eltypes))))))) (if sgml-dtd-less ;; The best we can do is assemble a list of elements we've ;; seen so far. (dolist (n (append (sgml-dtd-eltypes sgml-dtd-info) '()) ;; Space avoids possible clash with valid element. (setq tab (cons "Any " (cons "--" tab)))) (when (and (symbolp n) (not (memq n tab))) (push (symbol-name n) tab)))) (or tab (error "No valid %s at this point" type)) (let ((elt (sgml-popup-menu event title (mapcar (function (lambda (x) (cons x x))) tab)))) (if (equal elt "Any ") (setq elt (sgml-read-element-name "Element: "))) (or elt (message nil))))) (defun sgml-entities-menu (event) (interactive "*e") (sgml-need-dtd) (let ((menu (mapcar (function (lambda (x) (cons x x))) (sort (sgml-map-entities (function sgml-entity-name) (sgml-dtd-entities sgml-dtd-info) t) (function string-lessp)))) choice) (unless menu (error "No entities defined")) (setq choice (sgml-popup-menu event "Entities" menu)) (when choice (insert "&" choice ";")))) (defun sgml-doctype-insert (doctype vars) "Insert string DOCTYPE (ignored if nil) and set variables in &rest VARS. VARS should be a list of variables and values. For backward compatibility a single string instead of a variable is assigned to sgml-default-dtd-file. All variables are made buffer local and are also added to the buffers local variables list." (when doctype (unless (bolp) (insert "\n")) (unless (eolp) (insert "\n") (forward-char -1)) (sgml-insert-markup doctype)) (while vars (cond ((stringp (car vars)) (sgml-set-local-variable 'sgml-default-dtd-file (car vars)) (setq vars (cdr vars))) ((car vars) ; Avoid nil (sgml-set-local-variable (car vars) (cadr vars)) (setq vars (cddr vars))) (t (setq vars (cddr vars))))) (setq sgml-top-tree nil)) (defun sgml-attrib-menu (event) "Pop up a menu of the attributes of the current element \(or the element with start-tag before point)." (interactive "e") (let ((menu (sgml-make-attrib-menu (sgml-find-attribute-element)))) (sgml-popup-multi-menu event "Attributes" menu))) (defun sgml-make-attrib-menu (el) (let ((attlist (sgml-non-fixed-attributes (sgml-element-attlist el)))) (if (and (not attlist) sgml-dtd-less) (let ((name (sgml-general-case (let ((completion-ignore-case sgml-namecase-general)) (completing-read "Attribute name: " (mapcar (lambda (a) (list (sgml-attdecl-name a))) (if sgml-dtd-less (sgml-tree-asl el) (sgml-non-fixed-attributes (sgml-element-attlist el)))) nil (not sgml-dtd-less)))))) (if name (setq attlist (list (sgml-make-attdecl name 'CDATA nil)))))) (or attlist (error "No non-fixed attributes for element")) (loop for attdecl in attlist for name = (sgml-attdecl-name attdecl) for defval = (sgml-attdecl-default-value attdecl) for tokens = (or (sgml-declared-value-token-group (sgml-attdecl-declared-value attdecl)) (sgml-declared-value-notation (sgml-attdecl-declared-value attdecl))) collect (cons (sgml-attdecl-name attdecl) (nconc (if tokens (loop for val in tokens collect (list val (list 'sgml-insert-attribute name val))) (list (list "Set attribute value" (list 'sgml-insert-attribute (sgml-attdecl-name attdecl) (list 'sgml-read-attribute-value (list 'quote attdecl) (list 'quote (sgml-element-name el)) (sgml-element-attval el name)))))) (if (sgml-default-value-type-p 'REQUIRED defval) nil (list "--" (list (if (sgml-default-value-type-p nil defval) (format "Default: %s" (sgml-default-value-attval defval)) "#IMPLIED") (list 'sgml-insert-attribute name nil))))))))) ;;;; New Right Button Menu (defun sgml-right-menu (event) "Pop up a menu with valid tags and insert the choosen tag. If the variable sgml-balanced-tag-edit is t, also inserts the corresponding end tag. If sgml-leave-point-after-insert is t, the point is left after the inserted tag(s), unless the element has som required content. If sgml-leave-point-after-insert is nil the point is left after the first tag inserted." (interactive "*e") (let ((end (sgml-mouse-region))) (sgml-parse-to-here) (cond ((eq sgml-markup-type 'start-tag) (sgml-right-stag-menu event)) (t (let ((what (sgml-menu-ask event (if (or end sgml-balanced-tag-edit) 'element 'tags)))) (cond ((null what)) (end (sgml-tag-region what (point) end)) (sgml-balanced-tag-edit (sgml-insert-element what)) (t (sgml-insert-tag what)))))))) (defun sgml-right-stag-menu (event) (let* ((el (sgml-find-attribute-element)) (attrib-menu (ignore-errors (sgml-make-attrib-menu el)))) (let* ((alt-gi (mapcar (function sgml-eltype-name) (progn (sgml-find-context-of (sgml-element-start el)) (sgml-current-list-of-valid-eltypes)))) (change-menu (cons "Change To" (loop for gi in alt-gi collect `(,gi (sgml-change-element-name ,gi)))))) (sgml-popup-multi-menu event "Start Tag" (list* `("Misc" ("Edit attributes" (sgml-edit-attributes)) ("Normalize" (sgml-normalize-element)) ("Fill" (sgml-fill-element (sgml-find-context-of (point)))) ("Splice" (sgml-untag-element)) ("Fold" (sgml-fold-element))) change-menu ;;`("--" "--") attrib-menu))))) ;;;; SGML mode: Fill (defun sgml-element-fillable (element) (and (sgml-element-mixed element) (not (sgml-element-appdata element 'nofill)))) (defun sgml-fill-element (element) "Fill biggest enclosing element with mixed content. If current element has pure element content, recursively fill the subelements." (interactive (list (sgml-find-element-of (point)))) ;; (message "Filling...") (when (sgml-element-fillable element) ;; Find biggest enclosing fillable element (while (sgml-element-fillable (sgml-element-parent element)) (setq element (sgml-element-parent element)))) ;; (sgml-do-fill element) (sgml-message "Done")) (defun sgml-do-fill (element) (when sgml-debug (goto-char (sgml-element-start element)) (sit-for 0)) (save-excursion (cond ((sgml-element-fillable element) (let (last-pos (c (sgml-element-content element)) (agenda nil)) ; regions to fill later (goto-char (sgml-element-stag-end element)) (when (eolp) (forward-char 1)) (setq last-pos (point)) (while c (cond ((sgml-element-fillable c)) (t ;; Put region before element on agenda. Can't fill it now ;; that would mangle the parse tree that is being traversed. (push (cons last-pos (sgml-element-start c)) agenda) (goto-char (sgml-element-start c)) (sgml-do-fill c) ;; Fill may change parse tree, get a fresh (setq c (sgml-find-element-of (point))) (setq last-pos (sgml-element-end c)))) (setq c (sgml-element-next c))) ;; Fill the last region in content of element, ;; but get a fresh parse tree, if it has change due to other fills. (goto-char last-pos) (when (bolp) (sgml-indent-line)) (sgml-fill-region last-pos (sgml-element-etag-start (sgml-find-element-of (sgml-element-start element)))) (while agenda (sgml-fill-region (caar agenda) (cdar agenda)) (setq agenda (cdr agenda))))) (t ;; If element is not mixed, fill subelements recursively (let ((c (sgml-element-content element))) (while c (goto-char (sgml-element-etag-start c)) (sgml-indent-line) (goto-char (sgml-element-start c)) (sgml-indent-line) (setq c (sgml-find-element-of (point))) (sgml-do-fill c) (setq c (sgml-element-next (sgml-find-element-of (point)))))))))) (defun sgml-fill-region (start end) (sgml-message "Filling...") (save-excursion (goto-char end) (skip-chars-backward " \t\n") (while (progn (beginning-of-line 1) (< start (point))) (delete-char -1) (delete-horizontal-space) (insert " ")) (end-of-line 1) (let (give-up prev-column opoint oopoint) (while (and (not give-up) (> (current-column) fill-column)) (setq prev-column (current-column)) (setq oopoint (point)) (move-to-column (1+ fill-column)) (skip-chars-backward "^ \t\n") (setq opoint (point)) (skip-chars-backward " \t") (if (bolp) (progn (goto-char opoint) (if (re-search-forward "[ \t]" oopoint t) (save-excursion (skip-chars-forward " \t") (setq opoint (point))) (setq give-up t)))) (if (not give-up) (progn (delete-region (point) opoint) (newline) (sgml-indent-line) (end-of-line 1) (setq give-up (>= (current-column) prev-column)))))))) ;;;; SGML mode: Attribute editing (defvar sgml-start-attributes nil) (defvar sgml-main-buffer nil) (defvar sgml-attlist nil) (defun sgml-edit-attributes () "Edit attributes of current element. Editing is done in a separate window." (interactive) (let ((element (sgml-find-attribute-element))) (unless (sgml-bpos-p (sgml-element-stag-epos element)) (error "Element's start-tag is not in the buffer")) (push-mark) (goto-char (sgml-element-start element)) (let* ((start (point-marker)) (asl (sgml-element-attribute-specification-list element)) (cb (current-buffer)) (quote sgml-always-quote-attributes) (xml-p sgml-xml-p)) (switch-to-buffer-other-window (sgml-attribute-buffer element asl)) (make-local-variable 'sgml-start-attributes) (setq sgml-start-attributes start) (make-local-variable 'sgml-always-quote-attributes) (setq sgml-always-quote-attributes quote) (make-local-variable 'sgml-main-buffer) (setq sgml-main-buffer cb) (make-local-variable 'sgml-xml-p) (setq sgml-xml-p xml-p)))) (defun sgml-effective-attlist (eltype) (let ((effective-attlist nil) (attlist (sgml-eltype-attlist eltype)) (attnames (or (sgml-eltype-appdata eltype 'attnames) '(*)))) (while (and attnames (not (eq '* (car attnames)))) (let ((attdecl (sgml-lookup-attdecl (car attnames) attlist))) (if attdecl (push attdecl effective-attlist) (message "Attnames specefication error: no %s attribute in %s" (car attnames) eltype))) (setq attnames (cdr attnames))) (when (eq '* (car attnames)) (while attlist (let ((attdecl (sgml-lookup-attdecl (sgml-attdecl-name (car attlist)) effective-attlist))) (unless attdecl (push (car attlist) effective-attlist))) (setq attlist (cdr attlist)))) (nreverse effective-attlist))) (defun sgml-attribute-buffer (element asl) (let ((bname "*Edit attributes*") (buf nil) (inhibit-read-only t)) (save-excursion (when (setq buf (get-buffer bname)) (kill-buffer buf)) (setq buf (get-buffer-create bname)) (set-buffer buf) (erase-buffer) (sgml-edit-attrib-mode) (make-local-variable 'sgml-attlist) (setq sgml-attlist (sgml-effective-attlist (sgml-element-eltype element))) (sgml-insert '(read-only t) (substitute-command-keys "<%s -- Edit values and finish with \ \\[sgml-edit-attrib-finish], abort with \\[sgml-edit-attrib-abort] --\n") (sgml-element-name element)) (loop for attr in sgml-attlist do ;; Produce text like ;; name = value ;; -- declaration : default -- (let* ((aname (sgml-attdecl-name attr)) (dcl-value (sgml-attdecl-declared-value attr)) (def-value (sgml-attdecl-default-value attr)) (cur-value (sgml-lookup-attspec aname asl))) (sgml-insert ; atribute name '(read-only t category sgml-form) " %s =" aname) (cond ; attribute value ((sgml-default-value-type-p 'FIXED def-value) (sgml-insert '(read-only t category sgml-fixed) " #FIXED %s" (sgml-default-value-attval def-value))) ((and (null cur-value) (or (memq def-value '(IMPLIED CONREF CURRENT)) (sgml-default-value-attval def-value))) (sgml-insert '(read-only t category sgml-form rear-nonsticky (read-only category)) " ") (sgml-insert '(category sgml-default rear-nonsticky (category)) "#DEFAULT")) (t (sgml-insert '(read-only t category sgml-form rear-nonsticky (read-only category)) " ") (when (not (null cur-value)) (sgml-insert nil "%s" (sgml-attspec-attval cur-value))))) (sgml-insert '(read-only 1) "\n\t-- %s: %s --\n" (cond ((sgml-declared-value-token-group dcl-value)) ((sgml-declared-value-notation dcl-value) (format "NOTATION %s" (sgml-declared-value-notation dcl-value))) (t dcl-value)) (cond ((sgml-default-value-attval def-value)) (t (concat "#" (upcase (symbol-name def-value)))))))) (sgml-insert '(read-only t) ">") (goto-char (point-min)) (sgml-edit-attrib-next)) buf)) (defvar sgml-edit-attrib-mode-map (make-sparse-keymap)) ;; used as only for #DEFAULT in attribute editing. Binds all normally inserting ;; keys to a command that will clear the #DEFAULT before doing self-insert. (defvar sgml-attr-default-keymap (let ((map (make-sparse-keymap))) (set-keymap-parent map sgml-edit-attrib-mode-map) (substitute-key-definition 'self-insert-command 'sgml-attr-clean-and-insert map global-map) (put 'sgml-default 'local-map map))) (define-key sgml-edit-attrib-mode-map "\C-c\C-c" 'sgml-edit-attrib-finish) (define-key sgml-edit-attrib-mode-map "\C-c\C-d" 'sgml-edit-attrib-default) (define-key sgml-edit-attrib-mode-map "\C-c\C-k" 'sgml-edit-attrib-abort) (define-key sgml-edit-attrib-mode-map "\C-a" 'sgml-edit-attrib-field-start) (define-key sgml-edit-attrib-mode-map "\C-e" 'sgml-edit-attrib-field-end) (define-key sgml-edit-attrib-mode-map "\t" 'sgml-edit-attrib-next) (defun sgml-edit-attrib-mode () "Major mode to edit attribute specification list.\\ Use \\[sgml-edit-attrib-next] to move between input fields. Use \\[sgml-edit-attrib-default] to make an attribute have its default value. To abort edit kill buffer (\\[kill-buffer]) and remove window \(\\[delete-window]). To finish edit use \\[sgml-edit-attrib-finish]. \\{sgml-edit-attrib-mode-map}" (setq mode-name "SGML edit attributes" major-mode 'sgml-edit-attrib-mode) (use-local-map sgml-edit-attrib-mode-map) (run-hooks 'text-mode-hook 'sgml-edit-attrib-mode-hook)) (defun sgml-edit-attrib-abort () "Abort the attribute editor, removing the window." (interactive) (let ((cb (current-buffer)) (start sgml-start-attributes)) (delete-windows-on cb) (kill-buffer cb) (when (markerp start) (switch-to-buffer (marker-buffer start)) (goto-char start)))) (defun sgml-edit-attrib-finish () "Finish editing and insert attribute values in original buffer." (interactive) (let ((cb (current-buffer)) (asl (sgml-edit-attrib-specification-list)) ;; save buffer local variables (start sgml-start-attributes)) (when (markerp start) (delete-windows-on cb) (switch-to-buffer (marker-buffer start)) (kill-buffer cb) (goto-char start) (let ((element (sgml-find-element-of start))) ;; *** Should the it be verified that this element ;; is the one edited? (sgml-change-start-tag element asl))))) (defun sgml-edit-attrib-specification-list () (goto-char (point-min)) (forward-line 1) (sgml-with-parser-syntax (let ((asl nil) (al sgml-attlist)) (while (not (eq ?> (following-char))) (sgml-parse-s) (sgml-check-nametoken) ; attribute name, should match head of al (forward-char 3) (unless (memq (get-text-property (point) 'category) '(sgml-default sgml-fixed)) (push (sgml-make-attspec (sgml-attdecl-name (car al)) (sgml-extract-attribute-value (sgml-attdecl-declared-value (car al)))) asl)) (while (progn (beginning-of-line 2) (or (eolp) (not (get-text-property (point) 'read-only))))) (forward-line 1) (setq al (cdr al))) asl))) (defun sgml-extract-attribute-value (type) (save-excursion (save-restriction (narrow-to-region (point) (progn (sgml-edit-attrib-field-end) (point))) (goto-char (point-min)) (while (not (eobp)) (if (eq 'sgml-default (get-text-property (point) 'category)) (delete-char 1) (forward-char 1))) (unless (eq type 'CDATA) (subst-char-in-region (point-min) (point-max) ?\n ? ) (goto-char (point-min)) (delete-horizontal-space)) (goto-char (point-min)) (when (search-forward "\"" nil t) ; don't allow both " and ' (goto-char (point-min)) (while (search-forward "'" nil t) ; replace ' with char ref (replace-match "'"))) (buffer-string)))) (defun sgml-edit-attrib-default () "Set current attribute value to default." (interactive) (sgml-edit-attrib-clear) (save-excursion (sgml-insert '(category sgml-default rear-nonsticky (category)) "#DEFAULT"))) (defun sgml-edit-attrib-clear () "Kill the value of current attribute." (interactive) (let ((inhibit-read-only '(sgml-default))) (sgml-edit-attrib-field-start) (let ((end (save-excursion (sgml-edit-attrib-field-end) (point)))) (put-text-property (point) end 'read-only nil) (let ((inhibit-read-only t)) (put-text-property (1- (point)) (point) 'rear-nonsticky '(read-only category))) (kill-region (point) end)))) (defun sgml-attr-clean-and-insert (n) "Insert the character you type, after clearing the current attribute." (interactive "p") (sgml-edit-attrib-clear) (self-insert-command n)) (defun sgml-edit-attrib-field-start () "Go to the start of the attribute value field." (interactive) (let (start) (beginning-of-line 1) (while (not (eq t (get-text-property (point) 'read-only))) (beginning-of-line 0)) (while (eq 'sgml-form (get-text-property (point) 'category)) (setq start (next-single-property-change (point) 'category)) (unless start (error "No attribute value here")) (assert (number-or-marker-p start)) (goto-char start)))) (defun sgml-edit-attrib-field-end () "Go to the end of the attribute value field." (interactive) (sgml-edit-attrib-field-start) (let ((end (if (and (eolp) (get-text-property (1+ (point)) 'read-only)) (point) (next-single-property-change (point) 'read-only)))) (assert (number-or-marker-p end)) (goto-char end))) (defun sgml-edit-attrib-next () "Move to next attribute value." (interactive) (if (eq t (get-text-property (point) 'read-only)) (beginning-of-line 1)) (or (search-forward-regexp (if sgml-have-re-char-clases "^ *[-_.:[:alnum:]]+ *= ?" "^ *[-_.:A-Za-z0-9]+ *= ?") nil t) (goto-char (point-min)))) ;;;; SGML mode: Hiding tags/attributes (defconst sgml-tag-regexp (if sgml-have-re-char-clases "\\(\\|?\\)" "\\(\\|?\\)")) (defun sgml-operate-on-tags (action &optional attr-p) (let ((buffer-modified-p (buffer-modified-p)) (inhibit-read-only t) (buffer-read-only nil) (before-change-functions nil) (markup-index ; match-data index in tag regexp (if attr-p 2 1)) (tagcount ; number tags to give them uniq ; invisible properties 1)) (unwind-protect (save-excursion (goto-char (point-min)) (while (re-search-forward sgml-tag-regexp nil t) (cond ((eq action 'hide) (let ((tag (downcase (buffer-substring-no-properties (1+ (match-beginning 0)) (match-beginning 2))))) (if (or attr-p (not (member tag sgml-exposed-tags))) (add-text-properties (match-beginning markup-index) (match-end markup-index) (list 'invisible tagcount 'rear-nonsticky '(invisible face)))))) ((eq action 'show) ; ignore markup-index (remove-text-properties (match-beginning 0) (match-end 0) '(invisible nil))) (t (error "Invalid action: %s" action))) (incf tagcount))) (sgml-restore-buffer-modified-p buffer-modified-p)))) (defun sgml-hide-tags () "Hide all tags in buffer." (interactive) (sgml-operate-on-tags 'hide)) (defun sgml-show-tags () "Show hidden tags in buffer." (interactive) (sgml-operate-on-tags 'show)) (defun sgml-hide-attributes () "Hide all attribute specifications in the buffer." (interactive) (sgml-operate-on-tags 'hide 'attributes)) (defun sgml-show-attributes () "Show all attribute specifications in the buffer." (interactive) (sgml-operate-on-tags 'show 'attributes)) ;;;; SGML mode: Normalize (and misc manipulations) (defun sgml-expand-shortref-to-text (name) (let (before-change-functions (entity (sgml-lookup-entity name (sgml-dtd-entities sgml-dtd-info)))) (cond ((null entity) (sgml-error "Undefined entity %s" name)) ((sgml-entity-data-p entity) (sgml-expand-shortref-to-entity name)) (t (delete-region sgml-markup-start (point)) (sgml-entity-insert-text entity) (setq sgml-goal (point-max)) ; May have changed size of buffer ;; now parse the entity text (setq sgml-rs-ignore-pos sgml-markup-start) (goto-char sgml-markup-start))))) (defun sgml-expand-shortref-to-entity (name) (let ((end (point)) (re-found nil) before-change-functions) (goto-char sgml-markup-start) (setq re-found (search-forward "\n" end t)) (delete-region sgml-markup-start end) (insert "&" name (if re-found "\n" ";")) (setq sgml-goal (point-max)) ; May have changed size of buffer (goto-char (setq sgml-rs-ignore-pos sgml-markup-start)))) (defun sgml-expand-all-shortrefs (to-entity) "Expand all short references in the buffer. Short references to text entities are expanded to the replacement text of the entity; other short references are expanded into general entity references. If argument TO-ENTITY is non-nil, or if called interactively with a numeric prefix argument, all short references are replaced by general entity references." (interactive "*P") (sgml-reparse-buffer (if to-entity (function sgml-expand-shortref-to-entity) (function sgml-expand-shortref-to-text)))) (defun sgml-normalize (to-entity &optional element) "Normalize buffer by filling in omitted tags and expanding empty tags. Argument TO-ENTITY controls how short references are expanded as with `sgml-expand-all-shortrefs'. An optional argument ELEMENT can be the element to normalize instead of the whole buffer, if used no short references will be expanded." (interactive "*P") (unless element (sgml-expand-all-shortrefs to-entity)) (let ((only-one (not (null element)))) (setq element (or element (sgml-top-element))) (goto-char (sgml-element-end element)) ;; FIXME: actually the sgml-note-change-at called by the ;; before-change-functions need to be delayed to after the normalize ;; to avoid destroying the tree wile traversing it. (let ((before-change-functions nil)) (sgml-normalize-content element only-one))) (sgml-note-change-at (sgml-element-start element)) (sgml-message "Done")) (defun sgml-normalize-element () (interactive "*") (sgml-normalize nil (sgml-find-element-of (point)))) (defun sgml-normalize-content (element only-first) "Normalize all elements in a content where ELEMENT is first element. If sgml-normalize-trims is non-nil, trim off white space from ends of elements with omitted end-tags." (let ((content nil)) (while element ; Build list of content elements (push element content) (setq element (if only-first nil (sgml-element-next element)))) (while content (setq element (car content)) ;; Progress report (sgml-lazy-message "Normalizing %d%% left" (/ (point) (/ (+ (point-max) 100) 100))) ;; Fix the end-tag (sgml-normalize-end-tag element) ;; Fix tags of content (sgml-normalize-content (sgml-tree-content element) nil) ;; Fix the start-tag (sgml-normalize-start-tag element) ;; Next content element (setq content (cdr content))))) (defun sgml-normalize-start-tag (element) (when (sgml-bpos-p (sgml-element-stag-epos element)) (goto-char (min (point) (sgml-element-start element))) (let ((name (sgml-element-gi element)) (attlist (sgml-element-attlist element)) (asl (sgml-element-attribute-specification-list element))) (save-excursion (assert (or (zerop (sgml-element-stag-len element)) (= (point) (sgml-element-start element)))) (delete-char (sgml-element-stag-len element)) (sgml-insert-start-tag name asl attlist nil))))) (defun sgml-normalize-end-tag (element) (unless (sgml-element-empty element) (when (sgml-bpos-p (sgml-element-etag-epos element)) (goto-char (min (point) (sgml-element-etag-start element))) (if (and (zerop (sgml-element-etag-len element)) sgml-normalize-trims) (skip-chars-backward " \t\n\r")) (delete-char (sgml-tree-etag-len element)) (save-excursion (insert (sgml-end-tag-of element)))))) (defun sgml-make-character-reference (&optional invert) "Convert character after point into a character reference. If called with a numeric argument, convert a character reference back to a normal character. If called from a program, set optional argument INVERT to non-nil. If the function `decode-char' is defined, convert to and from Unicodes. Otherwise will only work for ASCII or 8-bit characters in the current coding system." (interactive "*P") (cond (invert (or (looking-at "&#\\([0-9]+\\)[;\n]?") (error "No character reference after point")) (let ((c (string-to-int (buffer-substring (match-beginning 1) (match-end 1))))) (delete-region (match-beginning 0) (match-end 0)) (if (fboundp 'decode-char) ; Emacs 21, Mule-UCS (setq c (decode-char 'ucs c)) ;; Else have to assume 8-bit character. (if (fboundp 'unibyte-char-to-multibyte) ; Emacs 20 (setq c (unibyte-char-to-multibyte c)))) (insert c))) ;; Convert character to &#nn; (t (let ((c (following-char))) (delete-char 1) (if (fboundp 'encode-char) (setq c (encode-char c 'ucs)) (if (fboundp 'multibyte-char-to-unibyte) (setq c (multibyte-char-to-unibyte c)))) (insert (format "&#%d;" c)))))) (defun sgml-expand-entity-reference () "Insert the text of the entity referenced at point." (interactive) (save-excursion (sgml-with-parser-syntax (setq sgml-markup-start (point)) (or (sgml-parse-delim "ERO") (progn (skip-syntax-backward "w_") (forward-char -1) ; @@ Really length of ERO (setq sgml-markup-start (point)) (sgml-check-delim "ERO"))) (let* ((ename (sgml-check-name t)) (entity (sgml-lookup-entity ename (sgml-dtd-entities (sgml-pstate-dtd sgml-buffer-parse-state))))) (unless entity (error "Undefined entity %s" ename)) (or (sgml-parse-delim "REFC") (sgml-parse-RE)) (delete-region sgml-markup-start (point)) (sgml-entity-insert-text entity))))) (defun sgml-trim-and-leave-element () "Remove blanks at end of current element and move point to after element." (interactive) (goto-char (sgml-element-etag-start (sgml-last-element))) (while (progn (forward-char -1) (looking-at "\\s-")) (delete-char 1)) (sgml-up-element)) (defvar sgml-notation-handlers '((gif . "xv") (jpeg . "xv")) "*An alist mapping notations to programs handling them") ;; Function contributed by Matthias Clasen (defun sgml-edit-external-entity () "Open a new window and display the external entity at the point." (interactive) (sgml-need-dtd) (save-excursion (sgml-with-parser-syntax (setq sgml-markup-start (point)) (unless (sgml-parse-delim "ERO") (search-backward-regexp "[&>;]") (setq sgml-markup-start (point)) (sgml-check-delim "ERO")) (sgml-parse-to-here) ; get an up-to-date parse tree (let* ( (parent (buffer-file-name)) ; used to be (sgml-file) (ename (sgml-check-name t)) (entity (sgml-lookup-entity ename (sgml-dtd-entities (sgml-pstate-dtd sgml-buffer-parse-state)))) (buffer nil) (ppos nil)) (unless entity (error "Undefined entity %s" ename)) (let* ((type (sgml-entity-type entity)) (notation (sgml-entity-notation entity)) (handler (cdr (assoc notation sgml-notation-handlers)))) (case type (ndata (if handler (progn (message (format "Using '%s' to handle notation '%s'." handler notation)) (save-excursion (set-buffer (get-buffer-create "*SGML background*")) (erase-buffer) (let* ((file (sgml-external-file (sgml-entity-text entity) type (sgml-entity-name entity))) (process (start-process (format "%s background" handler) nil handler file))) (process-kill-without-query process)))) (error "Don't know how to handle notation '%s'." notation))) (text (progn ;; here I try to construct a useful value for ;; `sgml-parent-element'. ;; find sensible values for the HAS-SEEN-ELEMENT part (let ((seen nil) (child (sgml-tree-content sgml-current-tree))) (while (and child (sgml-tree-etag-epos child) (<= (sgml-tree-end child) (point))) (push (sgml-element-gi child) seen) (setq child (sgml-tree-next child))) (push (nreverse seen) ppos)) ;; find ancestors (let ((rover sgml-current-tree)) (while (not (eq rover sgml-top-tree)) (push (sgml-element-gi rover) ppos) (setq rover (sgml-tree-parent rover)))) (find-file-other-window (sgml-external-file (sgml-entity-text entity) (sgml-entity-type entity) (sgml-entity-name entity))) (goto-char (point-min)) (sgml-mode) (setq sgml-parent-document (cons parent ppos)) ;; update the live element indicator of the new window (sgml-parse-to-here))) (t (error "Can't edit entities of type '%s'." type)))))))) ;;;; SGML mode: TAB completion (defun sgml-complete () "Complete the word/tag/entity before point. If it is a tag (starts with < or \n" (sgml-end-tag-of sgml-current-tree)) (sgml-indent-line)) (setq el (sgml-find-context-of (point)))) (let ((c (sgml-element-content el)) (s (sgml-element-model el)) (tok (sgml-eltype-token et)) (last nil)) ;; Find legal position for new element (while (and (not (cond ((sgml--add-before-p tok s c) (setq last (if c (sgml-element-start c) (sgml-element-etag-start el))) first))) (cond (c (setq s (sgml-element-pstate c)) (setq c (sgml-element-next c)) t)))) (cond (last (goto-char last) (sgml-insert-element gi)) (t (error "A %s element is not valid in current element" gi)))))) ;;;; Show current element type ;; Candidate for C-c C-t (autoload 'sgml-princ-names "psgml-info") (autoload 'sgml-eltype-refrenced-elements "psgml-info") (defun sgml-show-current-element-type () "Show information about the current element and its type." (interactive) (let* ((el (sgml-find-context-of (point))) (et (sgml-element-eltype el))) (with-output-to-temp-buffer "*Current Element Type*" (princ (format "ELEMENT: %s%s\n" (sgml-eltype-name et) (let ((help-text (sgml-eltype-appdata et 'help-text))) (if help-text (format " -- %s" help-text) "")))) (when sgml-omittag (princ (format "\n Start-tag is %s.\n End-tag is %s.\n" (if (sgml-eltype-stag-optional et) "optional" "required") (if (sgml-eltype-etag-optional et) "optional" "required")))) ;; ---- (princ "\nCONTENT: ") (cond ((symbolp (sgml-eltype-model et)) (princ (sgml-eltype-model et))) (t (princ (if (sgml-eltype-mixed et) "mixed\n" "element\n")) (sgml-print-position-in-model el et (point) sgml-current-state) (princ "\n\n") (sgml-princ-names (mapcar #'symbol-name (sgml-eltype-refrenced-elements et)) "All: "))) (let ((incl (sgml-eltype-includes et)) (excl (sgml-eltype-excludes et))) (when (or incl excl) (princ "\n\nEXCEPTIONS:")) (when incl (princ "\n + ") (sgml-princ-names (mapcar #'symbol-name incl))) (when excl (princ "\n - ") (sgml-princ-names (mapcar #'symbol-name excl)))) ;; ---- (princ "\n\nATTRIBUTES:\n") (sgml-print-attlist et) ;; ---- (let ((s (sgml-eltype-shortmap et))) (when s (princ (format "\nUSEMAP: %s\n" s)))) ;; ---- (princ "\nOCCURS IN:\n") (let ((occurs-in ())) (sgml-map-eltypes (function (lambda (cand) (when (memq et (sgml-eltype-refrenced-elements cand)) (push cand occurs-in)))) (sgml-pstate-dtd sgml-buffer-parse-state)) (sgml-princ-names (mapcar 'sgml-eltype-name (sort occurs-in (function string-lessp)))))))) (defun sgml-print-attlist (et) (let ((ob (current-buffer))) (set-buffer standard-output) (unwind-protect (loop for attdecl in (sgml-eltype-attlist et) do (princ " ") (princ (sgml-attdecl-name attdecl)) (let ((dval (sgml-attdecl-declared-value attdecl)) (defl (sgml-attdecl-default-value attdecl))) (when (listp dval) (setq dval (concat (if (eq (first dval) 'NOTATION) "#NOTATION (" "(") (mapconcat (function identity) (second dval) "|") ")"))) (indent-to 15 1) (princ dval) (cond ((sgml-default-value-type-p 'FIXED defl) (setq defl (format "#FIXED '%s'" (sgml-default-value-attval defl)))) ((symbolp defl) (setq defl (upcase (format "#%s" defl)))) (t (setq defl (format "'%s'" (sgml-default-value-attval defl))))) (indent-to 48 1) (princ defl) (terpri))) (set-buffer ob)))) (defun sgml-print-position-in-model (element element-type buffer-pos parse-state) (let ((u (sgml-element-content element)) (names nil)) (while (and u (>= buffer-pos (sgml-element-end u))) (push (sgml-element-gi u) names) (setq u (sgml-element-next u))) (when names (sgml-princ-names (nreverse names) " " ", ") (princ "\n"))) (princ " ->") (let* ((state parse-state) (required-seq ; the seq of req el following point (loop for required = (sgml-required-tokens state) while (and required (null (cdr required))) collect (sgml-eltype-name (car required)) do (setq state (sgml-get-move state (car required))))) (last-alt (mapcar 'sgml-eltype-name (append (sgml-optional-tokens state) (sgml-required-tokens state))))) (cond (required-seq (when last-alt (nconc required-seq (list (concat "(" (mapconcat (lambda (x) x) last-alt " | ") (if (sgml-final state) ")?" ")"))))) (sgml-princ-names required-seq " " ", ")) (last-alt (sgml-princ-names last-alt " (" " | ") (princ ")") (when (sgml-final state) (princ "?")))))) ;;;; Structure Viewing and Navigating (defun sgml-show-structure () "Show the document structure in a separate buffer." (interactive) (let ((source (current-buffer)) (result (get-buffer-create "*Document structure*"))) (set-buffer result) (occur-mode) (erase-buffer) (let ((structure (save-excursion (set-buffer source) (sgml-structure-elements (sgml-top-element))))) (sgml-show-structure-insert structure)) (goto-char (point-min)) (display-buffer result))) (defun sgml-show-structure-insert (structure) (loop for (gi level marker title) in structure do (let ((start (point))) (insert (make-string (* 2 level) ? )) (sgml-insert `(face match mouse-face highlight) gi) (sgml-insert `(mouse-face highlight) " %s" title) (insert "\n") (add-text-properties start (point) `(occur-target ,marker help-echo "mouse-2: go to this occurrence"))))) (defun sgml-show-struct-element-p (element) (let ((configured (sgml-element-appdata element 'structure))) (unless (eql configured 'ignore) (or configured (and (not (sgml-element-data-p element)) (not (sgml-element-empty element))))))) (defun sgml-structure-elements (element) (when (sgml-show-struct-element-p element) (let ((gi (sgml-element-gi element)) (level (sgml-element-level element)) (child1 (sgml-element-content element)) (marker nil) (title "")) (goto-char (sgml-element-start element)) (setq marker (copy-marker (point-marker))) (when (and child1 (not (sgml-show-struct-element-p child1)) (sgml-element-data-p child1)) (let ((start-epos (sgml-element-stag-epos child1)) (end-epos (sgml-element-etag-epos child1))) (when (and (sgml-bpos-p start-epos) (sgml-bpos-p end-epos)) (goto-char start-epos) (forward-char (sgml-element-stag-len child1)) (when (looking-at "\\s-*$") (forward-line 1)) (when (< (point) end-epos) (setq title (buffer-substring (point) (min (line-end-position) end-epos))))))) (cons (list (sgml-general-insert-case gi) level marker title) (loop for child = child1 then (sgml-element-next child) while child nconc (sgml-structure-elements child)))))) ;;; psgml-edit.el ends here ./psgml-1.4.0/psgml-fs.el0000640000076500000240000002543410212356414013347 0ustar dialout;;; psgml-fs.el --- Format a SGML-file according to a style file ;; Copyright (C) 1995, 2000 Lennart Staflin ;; Author: Lennart Staflin ;; Version: $Id: psgml-fs.el,v 1.13 2002/07/14 10:03:26 lenst Exp $ ;; Keywords: ;;; This program is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2, or (at your option) ;;; any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; A copy of the GNU General Public License can be obtained from this ;;; program's author (send electronic mail to lenst@lysator.liu.se) or from ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA ;;; 02139, USA. ;;; ;;; Commentary: ;; The function `style-format' formats the SGML-file in the current buffer ;; according to the style defined in the file `style.fs' (or the file given ;; by the variable `fs-style'). ;; To try it load this file and open the test file example.sgml. Then ;; run the emacs command `M-x style-format'. ;; The style file should contain a single Lisp list. The elements of ;; this list, themsleves lists, describe the style for an element type. ;; The sublists begin with the generic identifier for the element types and ;; the rest of the lists are characteristic/value pairs. ;; E.g. ("p" block t left 4 top 2) ;; Defines the style for p-elements to be blocks with left margin 4 and ;; at least two blank lines before the block. ;;; Code: (require 'psgml-api) (eval-when-compile (require 'cl) (require 'ps-print)) ;;;; Formatting parameters (defvar fs-char '((left . 0) (first . nil) (default-top . 0) (default-bottom . 0) (ignore-empty-para . nil) (literal . nil))) (defvar fs-special-styles '(top bottom before after hang-from text sub-style title) "Style attributes that should not be entered in the characteristics table.") ;;; Dynamic variables (defvar fs-current-element nil) (defvar fs-buffer) ;;;; Formatting engine (defun fs-char (p) (cdr (assq p fs-char))) (defun fs-set-char (p val) (setcdr (assq p fs-char) val)) (defsetf fs-char fs-set-char) (defvar fs-para-acc "" "Accumulate text of paragraph") (defvar fs-hang-from nil "Hanging indent of current paragraph") (defvar fs-first-indent nil) (defvar fs-left-indent nil) (defvar fs-vspace 0 "Vertical space after last paragraph") (defvar fs-filename) (defvar fs-title) (defun fs-add-output (str &optional just) (save-excursion (set-buffer fs-buffer) (goto-char (point-max)) (let ((start (point))) (insert str) (when just (set-justification start (point) just))))) (defun fs-addvspace (n) (when (> n fs-vspace) (fs-add-output (make-string (- n fs-vspace) ?\n)) (setq fs-vspace n))) (defun fs-para () (when (if (fs-char 'ignore-empty-para) (string-match "[^\t\n ]" fs-para-acc) fs-left-indent) (assert fs-left-indent) (fs-output-para fs-para-acc fs-first-indent fs-left-indent fs-hang-from (fs-char 'literal)) (setq fs-vspace 0 fs-hang-from nil)) (setq fs-para-acc "" fs-first-indent nil fs-left-indent nil)) (defun fs-paraform-data (data) (unless fs-left-indent (setq fs-left-indent (fs-char 'left) fs-first-indent (fs-char 'first))) (let ((face (fs-char 'face))) (when face (setq data (copy-sequence data)) (put-text-property 0 (length data) 'face face data)) (setq fs-para-acc (concat fs-para-acc data)))) (defun fs-output-para (text first-indent indent hang-from literal) (sgml-push-to-string text) (let ((indent-tabs-mode nil) (fill-prefix (make-string indent ? ))) (cond (literal (goto-char (point-max)) (unless (bolp) (insert ?\n)) (goto-char (point-min)) (while (not (eobp)) (insert fill-prefix) (beginning-of-line 2))) (t (while (re-search-forward "[ \t\n\r]+" nil t) (replace-match " ")) (goto-char (point-min)) (delete-horizontal-space) (insert (if hang-from hang-from (make-string (or first-indent indent) ? ))) (fill-region-as-paragraph (point-min) (point-max)) (goto-char (point-max)) (unless (bolp) (insert ?\n)))) (fs-add-output (buffer-string) (fs-char 'justification))) (sgml-pop-entity) (sit-for 0)) (defun fs-paraform-phrase (e) (sgml-map-content e (function fs-paraform-phrase) (function fs-paraform-data) nil (function fs-paraform-entity))) (defun fs-paraform-entity (entity) (let ((entity-map (fs-char 'entity-map)) (text nil)) (when entity-map (setq text (loop for (name val) on entity-map by 'cddr thereis (if (equal name (sgml-entity-name entity)) val)))) (unless text (setq text (sgml-entity-text entity))) (fs-paraform-data text))) ;;;; Style driven engine (defvar fs-style "style.fs" "*Style sheet to use for `style-format'. The value can be the style-sheet list, or it can be a file name \(string) of a file containing the style sheet or it can be the name \(symbol) of a variable containing the style sheet.") (put 'fs-style 'variable-interactive "fStyle file: ") (defvar fs-cached-styles nil) (defun fs-get-style (style) (cond ((stringp style) (sgml-cache-catalog style 'fs-cached-styles (function (lambda () (read (current-buffer)))))) ((symbolp style) (fs-get-style (symbol-value style))) ((listp style) style) (t (error "Illegal style value: %s" style)))) (defun fs-engine (e) (fs-do-style e (cdr (or (assoc (sgml-element-gi e) fs-style) (assq t fs-style))))) (defun fs-do-style (fs-current-element style) (let ((hang-from (eval (plist-get style 'hang-from)))) (when hang-from (setq fs-hang-from (format "%s%s " (make-string (or (fs-char 'hang-left) (fs-char 'left)) ? ) hang-from)))) (let ((fs-char (nconc (loop for st on style by 'cddr unless (memq (car st) fs-special-styles) collect (cons (car st) (eval (cadr st)))) fs-char))) (when (plist-get style 'block) (fs-para) (fs-addvspace (or (plist-get style 'top) (fs-char 'default-top)))) (let ((before (plist-get style 'before))) (when before (fs-do-style e before))) (let ((fs-style (append (plist-get style 'sub-style) fs-style))) (cond ((plist-get style 'text) (let ((text (eval (plist-get style 'text)))) (when (stringp text) (fs-paraform-data text)))) (t (sgml-map-content e (function fs-engine) (function fs-paraform-data) nil (function fs-paraform-entity))))) (let ((title (plist-get style 'title))) (when title (setq title (eval title)) (save-excursion (set-buffer fs-buffer) (setq fs-title title)))) (let ((after (plist-get style 'after))) (when after (fs-do-style e after))) (when (plist-get style 'block) (fs-para) (fs-addvspace (or (plist-get style 'bottom) (fs-char 'default-bottom)))))) (defun fs-clear () (setq fs-para-acc "" fs-hang-from nil fs-first-indent nil fs-left-indent nil fs-vspace 0) ) (defun fs-setup-buffer () (save-excursion (let ((orig-filename (buffer-file-name (current-buffer)))) (set-buffer fs-buffer) (erase-buffer) (setq ps-left-header '(fs-title fs-filename)) (make-local-variable 'fs-filename) (setq fs-filename (file-name-nondirectory orig-filename)) (make-local-variable 'fs-title) (setq fs-title "")))) (defun fs-wrapper (buffer-name thunk) (fs-clear) (let ((fs-style (fs-get-style fs-style)) (fs-buffer (get-buffer-create buffer-name))) (fs-setup-buffer) (funcall thunk) (fs-para) (save-excursion (set-buffer fs-buffer) (goto-char (point-min))) fs-buffer)) ;;;###autoload (defun style-format () (interactive) (fs-wrapper "*Formatted*" (lambda () (display-buffer fs-buffer) (fs-engine (sgml-top-element))))) ;;;; Helper functions for use in style sheet (defun fs-element (&rest moves) "Find current or related element." (let ((element fs-current-element)) (while moves (case (pop moves) (parent (setq element (sgml-element-parent element))) (next (setq element (sgml-element-next element))) (child (setq element (sgml-element-content element))))) element)) (defun fs-element-content (&optional e) (unless e (setq e (fs-element))) (let ((fs-para-acc "") fs-first-indent fs-left-indent) (sgml-map-content e (function fs-paraform-phrase) (function fs-paraform-data) nil (function fs-paraform-entity)) fs-para-acc)) (defun fs-attval (name &optional element) (sgml-element-attval (if element element (fs-element)) name)) (defun fs-child-number (&optional element) (let* ((element (or element (fs-element))) (parent (sgml-element-parent element)) (child (sgml-element-content parent)) (number 0)) (while (and child (not (eq child element))) (incf number) (setq child (sgml-element-next child))) number)) (defun fs-element-with-id (id) (block func (let ((element (sgml-top-element))) (while (not (sgml-off-top-p element)) (let ((attlist (sgml-element-attlist element))) (loop for attdecl in attlist if (eq 'ID (sgml-attdecl-declared-value attdecl)) do (if (compare-strings id nil nil (sgml-element-attval element (sgml-attdecl-name attdecl)) nil nil) (return-from func element)))) ;; Next element (if (sgml-element-content element) (setq element (sgml-element-content element)) (while (null (sgml-element-next element)) (setq element (sgml-element-parent element)) (if (sgml-off-top-p element) (return-from func nil))) (setq element (sgml-element-next element))))) nil)) (defun fs-split-tokens (s) "Split a string S into a list of tokens." (let ((result nil)) (sgml-push-to-string s) (while (not (eobp)) (skip-syntax-forward "-") (let ((start (point))) (skip-syntax-forward "^-") (when (/= start (point)) (push (buffer-substring-no-properties start (point)) result)))) (sgml-pop-entity) (nreverse result))) ;;; fs.el ends here ./psgml-1.4.0/psgml-ids.el0000644000076500000240000000565210212356414013522 0ustar dialout;;; psgml-ids.el --- Management of ID/IDREFS for PSGML ;; $Id: psgml-ids.el,v 2.1 2005/02/09 15:29:09 lenst Exp $ ;; Copyright (C) 1999 Jean-Daniel Fekete ;; Author: Jean-Daniel Fekete ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;; Commentary: ;; Provides some extra functions to manage IDs and IDREFs in attibutes (provide 'psgml-ids) (require 'psgml) (require 'psgml-api) (defvar sgml-record-id-p t "Set to non-nil, if you want to record all referenced IDS for completion.") (defvar sgml-id-list nil "List of IDs available for completing IDREFs") ;(make-variable-buffer-local 'sgml-id-list) (defvar sgml-id-alist nil "Alist of IDs available for completing IDREFs") (defvar sgml-id-list-sorted-p nil "Set to T when the sgml-id-list is sorted") (defvar sgml-edit-idrefs-map (let ((map (make-sparse-keymap 'sgml-edit-idrefs-map))) (set-keymap-parent map minibuffer-local-completion-map) (define-key map " " 'self-insert-command) map)) (defun sgml-id-list () (unless sgml-id-list-sorted-p (setq sgml-id-list (sort sgml-id-list #'string-lessp) sgml-id-list-sorted-p t sgml-id-alist nil)) sgml-id-list) (defun sgml-id-alist () (unless sgml-id-alist (setq sgml-id-alist (mapcar #'(lambda (id) (cons id id)) (sgml-id-list)))) sgml-id-alist) (defun sgml-add-id (id) (unless (or (not sgml-record-id-p) (member id sgml-id-list)) (push id sgml-id-list) (setq sgml-id-list-sorted-p nil))) (defun sgml-ids-add-from (element) "Find of all attributes of type ID in ELEMENT and add their value to the sgml-id-list." (let ((asl (sgml-element-attribute-specification-list element)) (adl (sgml-element-attlist element))) (dolist (as asl) (let* ((aname (sgml-attspec-name as)) (value (sgml-attspec-attval as)) (dcl-value (sgml-attdecl-declared-value (sgml-lookup-attdecl aname adl)))) (if (and (eq dcl-value 'ID) value) (sgml-add-id value)))))) (defun sgml-ids-add-current () (interactive) (sgml-ids-add-from (sgml-find-context-of (point)))) (defun sgml-ids-add-all (&optional element) "Find all the ids of elements inside ELEMENT or the top element if not specified" (interactive) (let ((el (or element (sgml-top-element)))) (sgml-map-element-modify (function sgml-ids-add-from) el))) ./psgml-1.4.0/psgml-info.el0000640000076500000240000003301510212356414013664 0ustar dialout;;;; psgml-info.el ;;; Last edited: 2000-11-09 19:23:50 lenst ;;; $Id: psgml-info.el,v 2.16 2005/02/27 17:12:05 lenst Exp $ ;; Copyright (C) 1994, 1995 Lennart Staflin ;; Author: Lennart Staflin ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; This file is an addon to the PSGML package. ;; This file contains some commands to print out information about the ;; current DTD. ;; sgml-list-elements ;; Will list all elements and the attributes declared for the element. ;; sgml-list-attributes ;; Will list all attributes declared and the elements that use them. ;; sgml-list-terminals ;; Will list all elements that can contain data. ;; sgml-list-occur-in-elements ;; Will list all element types and where it can occur. ;; sgml-list-content-elements ;; Will list all element types and the element types that can occur ;; in its content. ;;;; Code: (provide 'psgml-info) (require 'psgml) (require 'psgml-parse) (defconst sgml-attr-col 18) (eval-when-compile (require 'cl)) ;;;; Utility functions (defsubst sgml-add-to-table (row-index elem table) (let ((p (assoc row-index table))) (cond ((null p) (cons (list row-index elem) table)) (t (nconc p (list elem)) table)))) (defsubst sgml-add-last-unique (x l) (unless (memq x l) (nconc l (list x)))) (defun sgml-map-element-types (func) (sgml-need-dtd) (sgml-map-eltypes func (sgml-pstate-dtd sgml-buffer-parse-state) t)) (defun sgml-set-difference (l1 l2) (if (or (null l1) (null l2)) l1 (let ((res nil)) (while l1 (or (member (car l1) l2) (push (car l1) res)) (pop l1)) res))) (defun sgml-union (l1 l2) (cond ((null l1) l2) ((null l2) l1) ((equal l1 l2) l1) (t (or (>= (length l1) (length l2)) (setq l1 (prog1 l2 (setq l2 l1)))) (while l2 (or (member (car l2) l1) (push (car l2) l1)) (pop l2)) l1))) (defun sgml-eltype-refrenced-elements (eltype) "List of element types referenced in the model of ELTYPE." ;; Now with cache. Uses appdata prop re-cache. (or (sgml-eltype-appdata eltype 're-cache) (let* ((res ; result list (eltypes) nil) (states ; list of states (list (sgml-eltype-model eltype))) (agenda ; point into states states)) (cond ((not (sgml-model-group-p (car states))) nil) (t (while agenda (cond ((sgml-normal-state-p (car agenda)) (loop for m in (append (sgml-state-opts (car agenda)) (sgml-state-reqs (car agenda))) do (add-to-list 'res (sgml-move-token m)) (sgml-add-last-unique (sgml-move-dest m) states))) (t ; &-node (sgml-add-last-unique (sgml-and-node-next (car agenda)) states) (loop for dfa in (sgml-and-node-dfas (car agenda)) do (sgml-add-last-unique dfa states)))) (setq agenda (cdr agenda))) (setq res (sort (copy-sequence (sgml-set-difference (sgml-union res (sgml-eltype-includes eltype)) (sgml-eltype-excludes eltype))) (function string-lessp))) (setf (sgml-eltype-appdata eltype 're-cache) res) res))))) ;;;; List elements (defun sgml-list-elements () "List the elements and their attributes in the current DTD." (interactive) (message "Creating table...") (sgml-display-table (sgml-map-element-types (function (lambda (eltype) (cons (sgml-eltype-name eltype) (mapcar (function sgml-attdecl-name) (sgml-eltype-attlist eltype)))))) "Elements" "Element" "Attribute")) ;;;; List attributes (defun sgml-list-attributes () "List the attributes and in which elements they occur." (interactive) (let ((attributes nil)) (message "Creating table...") (sgml-map-element-types (function (lambda (eltype) (loop for a in (sgml-eltype-attlist eltype) do (setq attributes (sgml-add-to-table (sgml-attdecl-name a) (sgml-eltype-name eltype) attributes)))))) (sgml-display-table attributes "Attributes" "Attribute" "Element"))) ;;;; List terminals (defun sgml-list-terminals () "List the elements that can have data in their content." (interactive) (message "Creating table...") (let ((data-models (list sgml-cdata sgml-rcdata sgml-any))) (sgml-display-table (delq nil (sgml-map-element-types (function (lambda (eltype) (if (or (sgml-eltype-mixed eltype) (memq (sgml-eltype-model eltype) data-models)) (list (sgml-eltype-name eltype) (symbol-name (if (sgml-model-group-p (sgml-eltype-model eltype)) 'mixed (sgml-eltype-model eltype))))))))) "Terminals" "Element" "Content"))) ;;;; Element cross reference list (defun sgml-list-content-elements () "List all element types and the element types that can occur in its content." (interactive) (message "Creating table...") (sgml-display-table (sgml-map-element-types (function (lambda (eltype) (cons (sgml-eltype-name eltype) (mapcar (function sgml-eltype-name) (sgml-eltype-refrenced-elements eltype)))))) "Elements referenced by elements" "Element" "Content")) (defun sgml-list-occur-in-elements () "List all element types and where it can occur." (interactive) (message "Creating table...") (let ((cross nil)) (sgml-map-element-types (function (lambda (eltype) (loop for ref in (sgml-eltype-refrenced-elements eltype) do (setq cross (sgml-add-to-table ref (sgml-eltype-name eltype) cross)))))) (sgml-display-table cross "Cross referenced element types" "Element" "Can occur in"))) ;;;; Display table (defun sgml-display-table (table title col-title1 col-title2 &optional width nosort) (or width (setq width sgml-attr-col)) (let ((buf (get-buffer-create (format "*%s*" title)))) (message "Preparing display...") (set-buffer buf) (erase-buffer) (insert col-title1) (indent-to width) (insert col-title2 "\n") (insert-char ?= (length col-title1)) (indent-to width) (insert-char ?= (length col-title2)) (insert "\n") (unless nosort (setq table (sort table (function (lambda (a b) (string< (car a) (car b))))))) (loop for e in table do (insert (format "%s " (car e))) (loop for name in (if nosort (cdr e) (sort (cdr e) (function string-lessp))) do (when (> (+ (length name) (current-column)) fill-column) (insert "\n")) (when (< (current-column) sgml-attr-col) (indent-to width)) (insert name " ")) (insert "\n")) (goto-char (point-min)) (display-buffer buf) (message nil))) ;;;; Describe entity (defun sgml-describe-entity (name) "Describe the properties of an entity as declared in the current DTD." (interactive (let (default input) (sgml-need-dtd) (save-excursion (sgml-with-parser-syntax (unless (sgml-parse-delim "ERO") (skip-chars-backward "^&\"'= \t\n")) (setq default (or (sgml-parse-name t) "")))) (setq input (completing-read (format "Entity name (%s): " default) (sgml-entity-completion-table (sgml-dtd-entities (sgml-pstate-dtd sgml-buffer-parse-state))))) (list (if (equal "" input) default input)))) (with-output-to-temp-buffer "*Help*" (let ((entity (sgml-lookup-entity name (sgml-dtd-entities (sgml-pstate-dtd sgml-buffer-parse-state))))) (or entity (error "Undefined entity")) (princ (format "Entity %s is %s\n" name (cond ((null entity) "undefined") (t (format "a %s entity" (sgml-entity-type entity)))))) (when entity (let ((text (sgml-entity-text entity)) (notation (sgml-entity-notation entity))) (cond ((stringp text) (princ "Defined to be:\n") (princ text)) (t (princ "With external identifier ") (princ (if (car text) "PUBLIC" "SYSTEM")) (when (car text) (princ (format " '%s'" (car text)))) (when (cdr text) (princ (format " '%s'" (cdr text)))) (when notation (princ (format "\nand notation '%s'" notation)))))))))) ;;;; Describe element type (defun sgml-princ-names (names &optional first sep) (setq sep (or sep " ")) (loop with col = 0 for name in names for this-sep = (if first (prog1 first (setq first nil)) sep) do (princ this-sep) (incf col (length this-sep)) (when (and (> col 0) (> (+ col (length name)) fill-column)) (princ "\n ") (setq col 1)) (princ name) (incf col (length name)))) (defun sgml-describe-element-type (et-name) "Describe the properties of an element type as declared in the current DTD." (interactive (let (default input) (sgml-need-dtd) (save-excursion (sgml-with-parser-syntax (unless (sgml-parse-delim "STAGO") (skip-syntax-backward "w_")) (setq default (sgml-parse-name)) (unless (and default (sgml-eltype-defined (sgml-lookup-eltype default))) (setq default nil)))) (setq input (sgml-read-element-type (if default (format "Element type (%s): " default) "Element type: ") sgml-dtd-info default)) (list (sgml-eltype-name input)))) (sgml-need-dtd) (let ((et (sgml-lookup-eltype et-name))) (with-output-to-temp-buffer "*Help*" (princ (format "ELEMENT: %s\n\n" (sgml-eltype-name et))) (princ (format " Start-tag is %s.\n End-tag is %s.\n" (if (sgml-eltype-stag-optional et) "optional" "required") (if (sgml-eltype-etag-optional et) "optional" "required"))) (princ "\nATTRIBUTES:\n") (loop for attdecl in (sgml-eltype-attlist et) do (let ((name (sgml-attdecl-name attdecl)) (dval (sgml-attdecl-declared-value attdecl)) (defl (sgml-attdecl-default-value attdecl))) (when (listp dval) (setq dval (concat (if (eq (first dval) 'NOTATION) "#NOTATION (" "(") (mapconcat (function identity) (second dval) "|") ")"))) (cond ((sgml-default-value-type-p 'FIXED defl) (setq defl (format "#FIXED '%s'" (sgml-default-value-attval defl)))) ((symbolp defl) (setq defl (upcase (format "#%s" defl)))) (t (setq defl (format "'%s'" (sgml-default-value-attval defl))))) (princ (format " %-9s %-30s %s\n" name dval defl)))) ;; ---- (let ((s (sgml-eltype-shortmap et))) (when s (princ (format "\nUSEMAP: %s\n" s)))) ;; ---- (princ "\nCONTENT: ") (cond ((symbolp (sgml-eltype-model et)) (princ (sgml-eltype-model et))) (t (princ (if (sgml-eltype-mixed et) "mixed\n\n" "element\n\n")) (sgml-princ-names (mapcar #'symbol-name (sgml-eltype-refrenced-elements et))))) (let ((incl (sgml-eltype-includes et)) (excl (sgml-eltype-excludes et))) (when (or incl excl) (princ "\n\nEXCEPTIONS:")) (when incl (princ "\n + ") (sgml-princ-names (mapcar #'symbol-name incl))) (when excl (princ "\n - ") (sgml-princ-names (mapcar #'symbol-name excl)))) ;; ---- (princ "\n\nOCCURS IN:\n\n") (let ((occurs-in ())) (sgml-map-eltypes (function (lambda (cand) (when (memq et (sgml-eltype-refrenced-elements cand)) (push cand occurs-in)))) (sgml-pstate-dtd sgml-buffer-parse-state)) (sgml-princ-names (mapcar 'sgml-eltype-name (sort occurs-in (function string-lessp)))))))) ;;;; Print general info about the DTD. (defun sgml-describe-dtd () "Display information about the current DTD." (interactive) (sgml-need-dtd) (let ((elements 0) (entities 0) (parameters 0) (fmt "%20s %s\n") (hdr "")) (sgml-map-eltypes (function (lambda (e) (incf elements))) sgml-dtd-info) (sgml-map-entities (function (lambda (e) (incf entities))) (sgml-dtd-entities sgml-dtd-info)) (sgml-map-entities (function (lambda (e) (incf parameters))) (sgml-dtd-parameters sgml-dtd-info)) (with-output-to-temp-buffer "*Help*" (princ (format fmt "Doctype:" (sgml-dtd-doctype sgml-dtd-info))) (when (sgml-dtd-merged sgml-dtd-info) (princ (format fmt "Compiled DTD:" (car (sgml-dtd-merged sgml-dtd-info))))) (princ (format fmt "Element types:" (format "%d" elements))) (princ (format fmt "Entities:" (format "%d" entities))) (princ (format fmt "Parameter entities:" (format "%d" parameters))) (setq hdr "Files used:") (loop for x in (sgml-dtd-dependencies sgml-dtd-info) if (stringp x) do (princ (format fmt hdr x)) (setq hdr "")) (setq hdr "Undef parameters:") (sgml-map-entities (function (lambda (entity) (when (sgml-entity-marked-undefined-p entity) (princ (format fmt hdr (sgml-entity-name entity))) (setq hdr "")))) (sgml-dtd-parameters sgml-dtd-info))))) (defalias 'sgml-general-dtd-info 'sgml-describe-dtd) ;;; psgml-info.el ends here ./psgml-1.4.0/psgml-lucid.el0000640000076500000240000001474012016747116014044 0ustar dialout;;;; psgml-lucid.el --- Part of SGML-editing mode with parsing support ;; $Id: psgml-lucid.el,v 2.7 2002/04/25 20:50:27 lenst Exp $ ;; Copyright (C) 1994 Lennart Staflin ;; Author: Lennart Staflin ;; William M. Perry ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;;; Part of psgml.el ;;; Menus for use with Lucid Emacs ;;;; Code: (require 'psgml) ;;(require 'easymenu) (eval-and-compile (autoload 'sgml-do-set-option "psgml-edit")) (defvar sgml-max-menu-size (/ (* (frame-height) 2) 3) "*Max number of entries in Tags and Entities menus before they are split into several panes.") ;;;; Pop Up Menus (defun sgml-popup-menu (event title entries) "Display a popup menu." (setq entries (loop for ent in entries collect (vector (car ent) (list 'setq 'value (list 'quote (cdr ent))) t))) (cond ((> (length entries) sgml-max-menu-size) (setq entries (loop for i from 1 while entries collect (let ((submenu (subseq entries 0 (min (length entries) sgml-max-menu-size)))) (setq entries (nthcdr sgml-max-menu-size entries)) (cons (format "%s '%s'-'%s'" title (sgml-range-indicator (aref (car submenu) 0)) (sgml-range-indicator (aref (car (last submenu)) 0))) submenu)))))) (sgml-lucid-get-popup-value (cons title entries))) (defun sgml-range-indicator (string) (substring string 0 (min (length string) sgml-range-indicator-max-length))) (defun sgml-lucid-get-popup-value (menudesc) (let ((value nil) (event nil)) (popup-menu menudesc) (while (popup-up-p) (setq event (next-command-event event)) (cond ((misc-user-event-p event) (cond ((eq (event-object event) 'abort) (signal 'quit nil)) ((eq (event-object event) 'menu-no-selection-hook) nil) (t (eval (event-object event))))) ((button-release-event-p event) ; don't beep twice nil) (t (beep) (message "please make a choice from the menu.")))) value)) (defun sgml-popup-multi-menu (pos title menudesc) "Display a popup menu. MENUS is a list of menus on the form (TITLE ITEM1 ITEM2 ...). ITEM should have to form (STRING EXPR) or STRING. The EXPR gets evaluated if the item is selected." (popup-menu (cons title (loop for menu in menudesc collect (cons (car menu) ; title (loop for item in (cdr menu) collect (if (stringp item) item (vector (car item) (cadr item) t)))))))) ;;;; Lucid menu bar (defun sgml-make-options-menu (vars) (loop for var in vars for type = (sgml-variable-type var) for desc = (sgml-variable-description var) collect (cond ((eq type 'toggle) (vector desc (list 'setq var (list 'not var)) ':style 'toggle ':selected var)) ((consp type) (cons desc (loop for c in type collect (if (atom c) (vector (prin1-to-string c) `(setq ,var ,c) :style 'toggle :selected `(eq ,var ',c)) (vector (car c) `(setq ,var ',(cdr c)) :style 'toggle :selected `(eq ,var ',(cdr c))))))) (t (vector desc `(sgml-do-set-option ',var) t))))) (unless (or (not (boundp 'emacs-major-version)) (and (boundp 'emacs-minor-version) (< emacs-minor-version 10))) (loop for ent on sgml-main-menu if (vectorp (car ent)) do (cond ((equal (aref (car ent) 0) "File Options >") (setcar ent (cons "File Options" (sgml-make-options-menu sgml-file-options)))) ((equal (aref (car ent) 0) "User Options >") (setcar ent (cons "User Options" (sgml-make-options-menu sgml-user-options))))))) ;;;; Key definitions (define-key sgml-mode-map [button3] 'sgml-tags-menu) ;;;; Insert with properties (defun sgml-insert (props format &rest args) (let ((start (point)) tem) (insert (apply (function format) format args)) (remf props 'rear-nonsticky) ; not useful in Lucid ;; Copy face prop from category (when (setq tem (getf props 'category)) (when (setq tem (get tem 'face)) (set-face-underline-p (make-face 'underline) t) (setf (getf props 'face) tem))) (add-text-properties start (point) props) ;; A read-only value of 1 is used for the text after values ;; and this should in Lucid be open at the front. (if (eq 1 (getf props 'read-only)) (set-extent-property (extent-at start nil 'read-only) 'start-open t)))) ;;;; Set face of markup (defun sgml-set-face-for (start end type) (let ((face (cdr (assq type sgml-markup-faces))) o) (loop for e being the extents from start to end do (when (extent-property e 'sgml-type) (cond ((and (null o) (eq type (extent-property e 'sgml-type))) (setq o e)) (t (delete-extent e))))) (cond (o (set-extent-endpoints o start end)) (face (setq o (make-extent start end)) (set-extent-property o 'sgml-type type) (set-extent-property o 'face face) (set-extent-property o 'start-open t) (set-extent-face o face))))) (defun sgml-set-face-after-change (start end &optional pre-len) ;; This should not be needed with start-open t (when sgml-set-face (let ((o (extent-at start nil 'sgml-type))) (cond ((null o)) ((= start (extent-start-position o)) (set-extent-endpoints o end (extent-end-position o))) (t (delete-extent o)))))) ;(defalias 'next-overlay-at 'next-overlay-change) ; fix bug in cl.el (defun sgml-clear-faces () (interactive) (loop for o being the overlays if (extent-property o 'type) do (delete-extent o))) ;;;; Functions not in Lucid Emacs (unless (fboundp 'frame-width) (defalias 'frame-width 'screen-width)) (unless (fboundp 'buffer-substring-no-properties) (defalias 'buffer-substring-no-properties 'buffer-substring)) ;;;; Provide (provide 'psgml-lucid) ;;; psgml-lucid.el ends here ./psgml-1.4.0/psgml-maint.el0000640000076500000240000000601410212356414014040 0ustar dialout;;; psgml-maint.el --- Help functions to maintain PSGML source ;; Copyright (C) 1996 Lennart Staflin ;; Author: Lennart Staflin ;; Version: $Id: psgml-maint.el,v 1.8 2005/02/09 15:28:58 lenst Exp $ ;; Keywords: ;;; This program is free software; you can redistribute it and/or modify ;;; it under the terms of the GNU General Public License as published by ;;; the Free Software Foundation; either version 2, or (at your option) ;;; any later version. ;;; ;;; This program is distributed in the hope that it will be useful, ;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;;; GNU General Public License for more details. ;;; ;;; A copy of the GNU General Public License can be obtained from this ;;; program's author (send electronic mail to lenst@lysator.liu.se) or from ;;; the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA ;;; 02139, USA. ;;; ;;; Commentary: ;; This file contanins commands used during installation and ;; compilation of psgml. ;; psgml-compile-files Compiles the source files. The version of ;; Emacs used for compilation will determine ;; what files are compiled. ;;; Code: (require 'bytecomp) (defconst psgml-common-files '("psgml.el" "psgml-parse.el" "psgml-edit.el" "psgml-dtd.el" "psgml-info.el" "psgml-charent.el" "psgml-api.el" "psgml-sysdep.el" "psgml-ids.el")) (defconst psgml-emacs-files '("psgml-other.el")) (defconst psgml-xemacs-files '("psgml-lucid.el")) (defvar psgml-source-dir nil) (defconst psgml-elisp-source (append psgml-common-files (cond ((or (string-match "Lucid" emacs-version) (string-match "XEmacs" emacs-version)) psgml-xemacs-files) (t psgml-emacs-files)))) (defun psgml-find-source-dir (&optional ask) (if psgml-source-dir t (let ((cand (list "." "./psgml-1.3.2"))) (while cand (if (file-exists-p (expand-file-name "psgml-maint.el" (car cand))) (progn (setq psgml-source-dir (expand-file-name "." (car cand)) cand nil)) (setq cand (cdr cand)))) (if (null psgml-source-dir) (if ask (setq psgml-source-dir (expand-file-name (read-file-name "Where is the psgml source? " nil nil t))) (error "No psgml source in current directory")))))) (defun psgml-compile-files () "Compile the PSGML source files that needs compilation." (interactive) (psgml-find-source-dir (interactive-p)) (let ((default-directory psgml-source-dir) (load-path (cons psgml-source-dir load-path))) (mapcar (function psgml-byte-compile-file) psgml-elisp-source) (message "Done compiling"))) (defun psgml-byte-compile-file (file) (let ((dest (byte-compile-dest-file file))) (if (file-newer-than-file-p file dest) (byte-compile-file file)))) (defun psgml-install-elc () "Print list of elc files to install" (let ((destdir (car command-line-args-left))) (princ (mapconcat (function byte-compile-dest-file) psgml-elisp-source " ")))) ;;; psgml-maint.el ends here ./psgml-1.4.0/psgml-other.el0000640000076500000240000001522010212356414014050 0ustar dialout;;;; psgml-other.el --- Part of SGML-editing mode with parsing support ;; $Id: psgml-other.el,v 2.25 2005/02/27 17:13:20 lenst Exp $ ;; Copyright (C) 1994 Lennart Staflin ;; Author: Lennart Staflin ;; ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;;; Part of psgml.el. Code not compatible with XEmacs. ;;;; Code: (require 'psgml) (require 'easymenu) (eval-when-compile (require 'cl)) (defvar sgml-max-menu-size (/ (* (frame-height) 2) 3) "*Max number of entries in Tags and Entities menus before they are split into several panes.") ;;;; Key Commands ;; Doesn't this work in Lucid? *** (define-key sgml-mode-map [?\M-\C-\ ] 'sgml-mark-element) ;;(define-key sgml-mode-map [S-mouse-3] 'sgml-tags-menu) (define-key sgml-mode-map [S-mouse-3] 'sgml-right-menu) ;;;; Pop Up Menus (defun sgml-popup-menu (event title entries) "Display a popup menu. ENTRIES is a list where every element has the form (STRING . VALUE) or STRING." (let ((menus (sgml-split-long-menus (list (cons title entries))))) (x-popup-menu event (cons title menus)))) (defun sgml-range-indicator (string) (substring string 0 (min (length string) sgml-range-indicator-max-length))) (defun sgml-split-long-menus (menus) (loop for (title . entries) in menus nconc (cond ((> (length entries) sgml-max-menu-size) (loop for i from 1 while entries collect (let ((submenu (copy-sequence entries))) (setcdr (nthcdr (1- (min (length entries) sgml-max-menu-size)) submenu) nil) (setq entries (nthcdr sgml-max-menu-size entries)) (cons (format "%s '%s'.." title (sgml-range-indicator (caar submenu))) submenu)))) (t (list (cons title entries)))))) (defun sgml-popup-multi-menu (event title menus) "Display a popup menu. MENUS is a list of menus on the form (TITLE ITEM1 ITEM2 ...). ITEM should have to form (STRING EXPR) or STRING. The EXPR gets evaluated if the item is selected." (setq menus (sgml-split-long-menus menus)) (unless (cdr menus) (setq menus (list (car menus) '("---" "---")))) (eval (car (x-popup-menu event (cons title menus))))) ;;;; Insert with properties (defvar sgml-write-protect-intagible (not (boundp 'emacs-minor-version))) (defun sgml-insert (props format &rest args) (let ((start (point))) (insert (apply (function format) format args)) (when (and sgml-write-protect-intagible (plist-get props 'intangible)) (plist-put props 'read-only t)) (add-text-properties start (point) props))) ;;;; Set face of markup (defvar sgml-use-text-properties t "Non-nil means use text properties for highlighting, not overlays. Overlays are significantly less efficient in large buffers.") (eval-and-compile (if (boundp 'inhibit-modification-hooks) ; Emacs 21 (defmacro sgml-with-modification-state (&rest body) `(let ((modified (buffer-modified-p)) (inhibit-read-only t) (inhibit-modification-hooks t) (buffer-undo-list t) (deactivate-mark nil)) ,@body (when (not modified) (sgml-restore-buffer-modified-p nil)))) (defmacro sgml-with-modification-state (&rest body) `(let ((modified (buffer-modified-p)) (inhibit-read-only t) (after-change-functions nil) (before-change-functions nil) (buffer-undo-list t) (deactivate-mark nil)) ,@body (when (not modified) (sgml-restore-buffer-modified-p nil)))))) (defun sgml-set-face-for (start end type) (let ((face (cdr (assq type sgml-markup-faces)))) (if (and (null type) sgml-current-tree) (setq face (sgml-element-appdata sgml-current-tree 'face))) (cond (sgml-use-text-properties (sgml-with-modification-state (put-text-property start end 'face face) (when (and sgml-default-nonsticky (< start end)) (put-text-property (1- end) end 'rear-nonsticky '(face))))) (t (let ((current (overlays-at start)) (pos start) old-overlay) (while current (cond ((and (null old-overlay) type (eq type (overlay-get (car current) 'sgml-type))) (setq old-overlay (car current))) ((overlay-get (car current) 'sgml-type) ;;(message "delov: %s" (overlay-get (car current) 'sgml-type)) (delete-overlay (car current)))) (setq current (cdr current))) (while (< (setq pos (next-overlay-change pos)) end) (setq current (overlays-at pos)) (while current (when (overlay-get (car current) 'sgml-type) (delete-overlay (car current))) (setq current (cdr current)))) (cond (old-overlay (move-overlay old-overlay start end) (if (null (overlay-get old-overlay 'face)) (overlay-put old-overlay 'face face))) (face (setq old-overlay (make-overlay start end)) (overlay-put old-overlay 'sgml-type type) (overlay-put old-overlay 'face face)))))))) (defun sgml-set-face-after-change (start end &optional pre-len) ;; If inserting in front of an markup overlay, move that overlay. ;; this avoids the overlay beeing deleted and recreated by ;; sgml-set-face-for. (when (and sgml-set-face (not sgml-use-text-properties)) (loop for o in (overlays-at start) do (cond ((not (overlay-get o 'sgml-type))) ((= start (overlay-start o)) (move-overlay o end (overlay-end o))))))) (defun sgml-fix-overlay-after-change (overlay flag start end &optional size) (message "sfix(%s): %d-%d (%s)" flag start end size) (overlay-put overlay 'front-nonsticky t) (when nil (move-overlay overlay end (overlay-end overlay)))) (defun sgml-clear-faces () (interactive) (dolist (o (overlays-in (point-min) (point-max))) (if (overlay-get o 'sgml-type) (delete-overlay o)))) ;;;; Emacs before 19.29 (unless (fboundp 'buffer-substring-no-properties) (defalias 'buffer-substring-no-properties 'buffer-substring)) ;;;; Provide (provide 'psgml-other) ;;; psgml-other.el ends here ./psgml-1.4.0/psgml-parse.el0000640000076500000240000044352012016747246014064 0ustar dialout;;;; psgml-parse.el --- Parser for SGML-editing mode with parsing support ;; $Id: psgml-parse.el,v 2.99 2005/02/27 17:13:07 lenst Exp $ ;; Copyright (C) 1994, 1995, 1996, 1997, 1998 Lennart Staflin ;; Author: Lennart Staflin ;; Acknowledgment: ;; The catalog and XML parsing code was contributed by ;; David Megginson ;; This program is free software; you can redistribute it and/or ;; modify it under the terms of the GNU General Public License ;; as published by the Free Software Foundation; either version 2 ;; of the License, or (at your option) any later version. ;; ;; This program is distributed in the hope that it will be useful, ;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ;; GNU General Public License for more details. ;; ;; You should have received a copy of the GNU General Public License ;; along with this program; if not, write to the Free Software ;; Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ;;;; Commentary: ;; Part of major mode for editing the SGML document-markup language. ;;;; Code: (require 'psgml) (require 'psgml-sysdep) (require 'psgml-ids) ; just for sgml-add-id ;;; Interface to psgml-dtd (eval-and-compile (autoload 'sgml-do-usemap-element "psgml-dtd") (autoload 'sgml-write-dtd "psgml-dtd") (autoload 'sgml-check-dtd-subset "psgml-dtd") ) (eval-when-compile (require 'cl)) ;;;; Advise to do-auto-fill (defvar sgml-auto-fill-inhibit-function nil "If non-nil, it should be a function of no arguments. The functions is evaluated before the standard auto-fill function, `do-auto-fill', tries to fill a line. If the function returns a true value the auto-fill is inhibited.") ;;(defadvice do-auto-fill (around disable-auto-fill-hook activate) ;; (or (and sgml-auto-fill-inhibit-function ;; (funcall sgml-auto-fill-inhibit-function)) ;; ad-do-it)) ;;;; Variables (defvar sgml-psgml-pi-enable-outside-dtd nil) ;;; Hooks (defvar sgml-open-element-hook nil "The hook run by `sgml-open-element'. Theses functions are called with two arguments, the first argument is the opened element and the second argument is the attribute specification list. It is probably best not to refer to the content or the end-tag of the element.") (defvar sgml-close-element-hook nil "The hook run by `sgml-close-element'. These functions are invoked with `sgml-current-tree' bound to the element just parsed.") (defvar sgml-doctype-parsed-hook nil "This hook is called after the doctype has been parsed. It can be used to load any additional information into the DTD structure.") (defvar sgml-sysid-resolve-functions nil "A list of functions for resolving sysids. Each function should take one argument, the system identifier of an entity. If the function can handle that identifier, it should insert the text of the entity into the current buffer at point and return t. If the system identifier is not handled the function should return nil.") ;;; Internal variables (defconst sgml-pcdata-token (intern "#PCDATA")) (defvar sgml-computed-map nil "Internal representation of entity search map.") (defvar sgml-used-entity-map nil "Value of `sgml-current-entity-map' used to compute the map in `sgml-compute-map'.") (defvar sgml-last-element nil "Used to keep information about position in element structure between commands.") (defconst sgml-users-of-last-element '(sgml-beginning-of-element sgml-end-of-element sgml-up-element sgml-backward-up-element sgml-backward-element sgml-forward-element sgml-down-element sgml-show-context sgml-next-data-field ) "List of commands that set the variable `sgml-last-element'.") (defvar sgml-parser-syntax nil "Syntax table used during parsing.") (defvar sgml-ecat-assoc nil "Assoc list caching parsed ecats.") (defvar sgml-catalog-assoc nil "Assoc list caching parsed catalogs.") ;;; Variables dynamically bound to affect parsing (defvar sgml-throw-on-warning nil "Set to a symbol other than nil to make `sgml-log-warning' throw to that symbol.") (defvar sgml-throw-on-error nil "Set to a symbol other than nil to make `sgml-error' throw to that symbol.") (defvar sgml-show-warnings nil "Set to t to show warnings.") (defvar sgml-close-element-trap nil "Can be nil for no trap, an element or t for any element. Tested by `sgml-close-element' to see if the parse should be ended.") (defvar sgml-goal 0 "Point in buffer to parse up to.") (defvar sgml-shortref-handler (function sgml-handle-shortref) "Function called by parser to handle a short reference. Called with the entity as argument. The start and end of the short reference is `sgml-markup-start' and point.") (defvar sgml-data-function nil "Function called with parsed data.") (defvar sgml-entity-function nil "Function called with entity referenced at current point in parse.") (defvar sgml-pi-function nil "Function called with parsed processing instruction.") (defvar sgml-signal-data-function nil "Called when some data characters are conceptually parsed. E.g. a data entity reference.") (defvar sgml-throw-on-element-change nil "Throw tag.") ;;; Global variables active during parsing (defvar sgml-parsing-dtd nil "This variable is bound to t while parsing a DTD (subset).") (defvar sgml-rs-ignore-pos nil "Set to position of last parsing start in current buffer.") (make-variable-buffer-local 'sgml-rs-ignore-pos) (defvar sgml-dtd-info nil "Holds the `sgml-dtd' structure describing the current DTD.") (defvar sgml-current-namecase-general t "Value of `sgml-namecase-general' in main buffer. Valid during parsing.") (defvar sgml-current-omittag nil "Value of `sgml-omittag' in main buffer. Valid during parsing.") (defvar sgml-current-shorttag nil "Value of `sgml-shorttag' in main buffer. Valid during parsing.") (defvar sgml-current-localcat nil "Value of `sgml-local-catalogs' in main buffer. Valid during parsing.") (defvar sgml-current-local-ecat nil "Value of `sgml-local-ecat-files' in main buffer. Valid during parsing.") (defvar sgml-current-top-buffer nil "The buffer of the document entity, the main buffer. Valid during parsing. This is used to find current directory for catalogs.") (defvar sgml-current-state nil "Current state in content model or model type if CDATA, RCDATA or ANY.") (defvar sgml-current-shortmap nil "The current active short reference map.") (defvar sgml-current-tree nil "Current parse tree node, identifies open element.") (defvar sgml-previous-tree nil "Previous tree node in current tree. This is nil if no previous node.") (defvar sgml-last-buffer nil "Buffer where last parse was ended. Used for restarting parser at the point where it left of.") (defvar sgml-markup-type nil "Contains the type of markup parsed last. The value is a symbol: nil - pcdata or space CDATA - CDATA or RCDATA comment - comment declaration doctype - doctype declaration end-tag ignored - ignored marked section ms-end - marked section start, if not ignored ms-start - marked section end, if not ignored pi - processing instruction sgml - SGML declaration start-tag entity - general entity reference param - parameter reference shortref- short reference mdecl - markup declaration") (defvar sgml-top-tree nil "Root node of parse tree during parsing.") (defvar sgml-markup-tree nil "Tree node of markup parsed. In case markup closed element this is different from `sgml-current-tree'. Only valid after `sgml-parse-to'.") (defvar sgml-markup-start nil "Start point of markup being parsed.") (defvar sgml-conref-flag nil "Set by `sgml-parse-attribute-specification-list' if a CONREF attribute is parsed.") (defvar sgml-no-elements nil "Number of declared elements.") ;;; Vars used in *param* buffers (defvar sgml-previous-buffer nil) (defvar sgml-current-eref nil "This is the entity reference used to enter current entity. If this is nil, then current entity is main buffer.") (defvar sgml-current-file nil "This is the file name of the current entity.") (defvar sgml-scratch-buffer nil "The global value of this variable is the first scratch buffer for entities. The entity buffers can have a buffer local value for this variable to point to the next scratch buffer.") (defvar sgml-last-entity-buffer nil) ;;; For loading DTD (eval-and-compile (defconst sgml-max-single-octet-number 250 "Octets greater than this is the first of a two octet coding.")) (defvar sgml-read-token-vector nil) ; Vector of symbols used to decode ; token numbers. (defvar sgml-read-nodes nil) ; Vector of nodes used when reading ; a finite automaton. ;; Buffer local variables (defvar sgml-loaded-dtd nil "File name corresponding to current DTD.") (make-variable-buffer-local 'sgml-loaded-dtd) (defvar sgml-current-element-name nil "Name of current element for mode line display.") (make-variable-buffer-local 'sgml-current-element-name) (defvar sgml-dtd-less nil "Non-nil means the document doesn't have a DTD. Applicable to XML.") (make-variable-buffer-local 'sgml-dtd-less) ;;;; Build parser syntax table (setq sgml-parser-syntax (make-syntax-table)) (let ((i 0)) (while (< i 256) (modify-syntax-entry i " " sgml-parser-syntax) (setq i (1+ i)))) (mapconcat (function (lambda (c) (modify-syntax-entry c "w" sgml-parser-syntax))) "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrtsuvwxyz" "") (mapconcat (function (lambda (c) (modify-syntax-entry c "_" sgml-parser-syntax))) "-.0123456789" "") ;;(progn (set-syntax-table sgml-parser-syntax) (describe-syntax)) (defconst xml-parser-syntax (let ((tab (make-syntax-table))) (let ((i 0)) (while (< i 128) (modify-syntax-entry i " " tab) (setq i (1+ i)))) (mapconcat (function (lambda (c) (modify-syntax-entry c "w" tab))) "_:ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrtsuvwxyz" "") (mapconcat (function (lambda (c) (modify-syntax-entry c "_" tab))) ;; Fixme: what's the non-ASCII character doing here? -- fx "-.0123456789·" "") tab)) ;;(progn (set-syntax-table xml-parser-syntax) (describe-syntax)) (defmacro sgml-with-parser-syntax (&rest body) `(let ((normal-syntax-table (syntax-table)) (cb (current-buffer))) (set-syntax-table (if sgml-xml-p xml-parser-syntax sgml-parser-syntax)) (unwind-protect (progn ,@body) (setq sgml-last-buffer (current-buffer)) (set-buffer cb) (set-syntax-table normal-syntax-table)))) (defmacro sgml-with-parser-syntax-ro (&rest body) ;; Should only be used for parsing .... `(let ((normal-syntax-table (syntax-table)) (cb (current-buffer)) (buffer-modified (buffer-modified-p))) (set-syntax-table (if sgml-xml-p xml-parser-syntax sgml-parser-syntax)) (unwind-protect (progn ,@body) (setq sgml-last-buffer (current-buffer)) (set-buffer cb) (set-syntax-table normal-syntax-table) (sgml-restore-buffer-modified-p buffer-modified) (sgml-debug "Restoring buffer mod: %s" buffer-modified)))) (defun sgml-set-buffer-multibyte (flag) (cond ((featurep 'xemacs) flag) ((and (boundp 'emacs-major-version) (>= emacs-major-version 20)) (set-buffer-multibyte (if (eq flag 'default) default-enable-multibyte-characters flag))) ((boundp 'MULE) (set 'mc-flag flag)) (t flag))) ;; Probably better. -- fx ;; (eval-and-compile ;; (if (fboundp 'set-buffer-multibyte) ;; (defalias 'sgml-set-buffer-multibyte ;; (if (fboundp 'set-buffer-multibyte) ;; 'set-buffer-multibyte ;; 'identity)))) ;;;; State machine ;; From the parsers POV a state is a mapping from tokens (in sgml it ;; is primitive state tokens) to states. The pairs of the mapping is ;; called moves. ;; DFAs are always represented by the start state, which is a ;; normal state. Normal states contain moves of two types: ;; 1. moves for required tokens, 2. moves for optional tokens. ;; By design these are keept in two different sets. ;; [Alt: they could perhaps have been keept in one set but ;; marked in different ways.] ;; The and-model groups creates too big state machines, therefor ;; there is a datastruture called and-node. ;; An and-node is a specification for a dfa that has not been computed. ;; It contains a set of dfas that all have to be traversed before going ;; to the next state. The and-nodes are only stored in moves and are ;; not seen by the parser. When a move is taken the and-node is converted ;; to an and-state. ;; An and-state keeps track of which dfas still need to be ;; traversed and the state of the current dfa. ;; move = ;; node = normal-state | and-node ;; and-node = ;; where: dfas is a set of normal-state ;; next is a normal-state ;; State = normal-state | and-state ;; The parser only knows about the state type. ;; normal-state = ;; where: opts is a set of moves for optional tokens ;; reqs is a set of moves for required tokens ;; and-state = ;; where: substate is a normal-state ;; dfas is a set of states ;; next is the next state ;; The and-state is only used during the parsing. ;; Primitiv functions to get data from parse state need ;; to know both normal-state and and-state. ;;; Representations: ;;move: (token . node) (defmacro sgml-make-move (token node) `(cons ,token ,node)) (defmacro sgml-move-token (x) `(car ,x)) (defmacro sgml-move-dest (x) `(cdr ,x)) ;; set of moves: list of moves (defmacro sgml-add-move-to-set (token node set) `(cons (cons ,token ,node) ,set)) (defmacro sgml-moves-lookup (token set) `(assq ,token ,set)) ;; normal-state: ('normal-state opts . reqs) (defsubst sgml-make-state () (cons 'normal-state (cons nil nil))) (defmacro sgml-normal-state-p (s) `(eq (car ,s) 'normal-state)) (defmacro sgml-state-opts (s) `(cadr ,s)) (defmacro sgml-state-reqs (s) `(cddr ,s)) (defmacro sgml-state-final-p (s) `(null (sgml-state-reqs ,s))) ;; adding moves ;; *** Should these functions check for ambiguity? ;; What if adding a optional move for a token that has a ;; required move? ;; What about the other way? (defsubst sgml-add-opt-move (s token dest) (or (sgml-moves-lookup token (sgml-state-opts s)) (setf (sgml-state-opts s) (sgml-add-move-to-set token dest (sgml-state-opts s))))) (defsubst sgml-add-req-move (s token dest) (or (sgml-moves-lookup token (sgml-state-reqs s)) (setf (sgml-state-reqs s) (sgml-add-move-to-set token dest (sgml-state-reqs s))))) (defsubst sgml-make-primitive-content-token (token) (let ((s1 (sgml-make-state)) (s2 (sgml-make-state))) (sgml-add-req-move s1 token s2) s1)) ;;and-state: (state next . dfas) (defsubst sgml-make-and-state (state dfas next) (cons state (cons next dfas))) (defsubst sgml-step-and-state (state and-state) (cons state (cdr and-state))) (defsubst sgml-and-state-substate (s) (car s)) (defsubst sgml-and-state-dfas (s) (cddr s)) (defsubst sgml-and-state-next (s) (cadr s)) ;;and-node: (next . dfas) (defsubst sgml-make-and-node (dfas next) (cons next dfas)) (defmacro sgml-and-node-next (n) `(car ,n)) (defmacro sgml-and-node-dfas (n) `(cdr ,n)) ;;; Using states (defsubst sgml-final (state) (if (sgml-normal-state-p state) (sgml-state-final-p state) (sgml-final-and state))) (defun sgml-final-and (state) (and (sgml-final (sgml-and-state-substate state)) (loop for s in (sgml-and-state-dfas state) always (sgml-state-final-p s)) (sgml-state-final-p (sgml-and-state-next state)))) ;; get-move: State x Token --> State|nil (defsubst sgml-get-move (state token) "Return a new state or nil, after traversing TOKEN from STATE." (cond ((symbolp state) nil) ;if EMPTY slips thru... ((sgml-normal-state-p state) (let ((c (or (sgml-moves-lookup token (sgml-state-opts state)) (sgml-moves-lookup token (sgml-state-reqs state))))) (if c (let ((dest (sgml-move-dest c))) (if (sgml-normal-state-p dest) dest ;; dest is a and-node (sgml-next-sub-and (sgml-and-node-dfas dest) token (sgml-and-node-next dest))))))) (t ;state is a and-state (sgml-get-and-move state token)))) (defun sgml-get-and-move (state token) ;; state is a and-state (let ((m (sgml-get-move (sgml-and-state-substate state) token))) (cond (m (cons m (cdr state))) ((sgml-final (sgml-and-state-substate state)) (sgml-next-sub-and (sgml-and-state-dfas state) token (sgml-and-state-next state)))))) (defun sgml-next-sub-and (dfas token next) "Compute the next state, choosing from DFAS and moving by TOKEN. If this is not possible, but all DFAS are final, move by TOKEN in NEXT." (let ((allfinal t) (l dfas) (res nil) s1 s2) (while (and l (not res)) (setq s1 (car l) allfinal (and allfinal (sgml-state-final-p s1)) s2 (sgml-get-move s1 token) res (and s2 (sgml-make-and-state s2 (remq s1 dfas) next)) l (cdr l))) (cond (res) (allfinal (sgml-get-move next token))))) (defsubst sgml-tokens-of-moves (moves) (mapcar (function (lambda (m) (sgml-move-token m))) moves)) (defun sgml-required-tokens (state) (if (sgml-normal-state-p state) (sgml-tokens-of-moves (sgml-state-reqs state)) (or (sgml-required-tokens (sgml-and-state-substate state)) (loop for s in (sgml-and-state-dfas state) nconc (sgml-tokens-of-moves (sgml-state-reqs s))) (sgml-tokens-of-moves (sgml-state-reqs (sgml-and-state-next state)))))) (defun sgml-optional-tokens (state) (if (sgml-normal-state-p state) (sgml-tokens-of-moves (sgml-state-opts state)) (nconc (sgml-optional-tokens (sgml-and-state-substate state)) (if (sgml-final (sgml-and-state-substate state)) (loop for s in (sgml-and-state-dfas state) nconc (sgml-tokens-of-moves (sgml-state-opts s)))) (if (loop for s in (sgml-and-state-dfas state) always (sgml-state-final-p s)) (sgml-tokens-of-moves (sgml-state-opts (sgml-and-state-next state))))))) ;;;; Attribute Types ;;; Basic Types ;; name = string attribute names are lisp strings ;; attval = string attribute values are lisp strings ;;; Attribute Declaration Type ;; attdecl = ;; This is the result of the ATTLIST declarations in the DTD. ;; All attribute declarations for an element is the elements ;; attlist. ;;; Attribute Declaration Operations ;; sgml-make-attdecl: name declared-value default-value -> attdecl ;; sgml-attdecl-name: attdecl -> name ;; sgml-attdecl-declared-value: attdecl -> declared-value ;; sgml-attdecl-default-value: attdecl -> default-value ;;; Attribute Declaration List Type ;; attlist = attdecl* ;;; Attribute Declaration List Operations ;; sgml-lookup-attdecl: name x attlist -> attdecl ;;; Declared Value Type ;; declared-value = (token-group | notation | simpel) ;; token-group = nametoken+ ;; notation = nametoken+ ;; simple = symbol lisp symbol corresponding to SGML type ;;; Declared Value Operations ;; sgml-declared-value-token-group: declared-value -> list of symbols ;; sgml-declared-value-notation: declared-value -> list of symbols ;; (empty list if not token-group/notation) ;;; Default Value Type ;; default-value = (required | implied | conref | specified ) ;; implied, conref = constant symbol ;; specified = (fixed | normal) ;; fixed, normal = attval ;;; Default Value Operations ;; sgml-default-value-attval: default-value -> (attval | nil) ;; sgml-default-value-type-p: type x default-value -> cond ;;; Attribute Specification Type ;; attspec = ;; This is the result of parsing an attribute specification. ;; sgml-make-attspec: name x attval -> attspec ;; sgml-attspec-name: attspec -> name ;; sgml-attspec-attval: attspec -> attval ;;; Attribute Specification List Type ;; asl = attspec* ;; aka. attribute value list ;;; Code ;;; attdecl representation = (name declared-value default-value) (defun sgml-make-attdecl (name dcl-value default-value) (list name dcl-value default-value)) (defun sgml-attdecl-name (attdecl) (car attdecl)) (defun sgml-attdecl-declared-value (attdecl) "The declared value of ATTDECL. It may be a symbol or (name-token-group (NAME1 ... NAMEn)) or (notation (NOT1 ... NOTn))" (cadr attdecl)) (defun sgml-attdecl-default-value (attdecl) "The default value of ATTDECL. The default value is either a symbol (REQUIRED | IMPLIED | CURRENT | CONREF) or a list with first element nil or symbol `FIXED' and second element the value." (car (cddr attdecl))) ;;; attlist representation = (attspec*) (defun sgml-lookup-attdecl (name attlist) "Return the attribute declaration for NAME in ATTLIST." (assoc name attlist)) (defun sgml-attribute-with-declared-value (attlist declared-value) "Find the first attribute in ATTLIST that has DECLARED-VALUE." (let ((found nil)) (while (and attlist (not found)) (when (equal declared-value (sgml-attdecl-declared-value (car attlist))) (setq found (car attlist))) (setq attlist (cdr attlist))) found)) ;;; declared-value representation ;; token-group = (name-token (symbol+)) ;; notation = (notation (symbol+)) ;; simple = symbol lisp symbol correspoinding to SGML type (defun sgml-make-declared-value (type &optional names) "Make a declared-value of TYPE. TYPE should be a symbol. If TYPE is name-token-group or notation NAMES should be a list of symbols." (if (consp names) (list type names) type)) (defun sgml-declared-value-token-group (declared-value) "Return the name token group for the DECLARED-VALUE. This applies to name token groups. For other declared values nil is returned." (and (consp declared-value) (eq 'name-token-group (car declared-value)) (cadr declared-value))) (defun sgml-declared-value-notation (declared-value) "Return the list of notation names for the DECLARED-VALUE. This applies to notation declared value. For other declared values nil is returned." (and (consp declared-value) (eq 'NOTATION (car declared-value)) (cadr declared-value))) ;;; default-value representation = symbol | ((nil | 'fixed) attval) (defun sgml-make-default-value (type &optional attval) (if attval (list type attval) type)) (defun sgml-default-value-attval (default-value) "Return the actual default value of the declared DEFAULT-VALUE. The actual value is a string. Return nil if no actual value." (and (consp default-value) (cadr default-value))) (defun sgml-default-value-type-p (type default-value) "Return true if DEFAULT-VALUE is of TYPE. Where TYPE is a symbol, one of REQUIRED, IMPLIED, CONREF, or FIXED." (or (eq type default-value) (and (consp default-value) (eq type (car default-value))))) ;;; attspec representation = (symbol . string) (defun sgml-make-attspec (name attval) "Create an attspec from NAME and ATTVAL. Special case, if ATTVAL is nil this is an implied attribute." (cons name attval)) ;; sgml-attspec-name: attspec -> name (defun sgml-attspec-name (attspec) (car attspec)) ;; sgml-attspec-attval: attspec -> attval (defun sgml-attspec-attval (attspec) "Return the value of attribute specification ATTSPEC. If ATTSPEC is nil, nil is returned." (cdr attspec)) ;;; asl representaion = (attspec*) (defun sgml-lookup-attspec (name asl) (assoc name asl)) ;;;; Element content types ;; The content of an element is defined as ;; (125 declared content | 126 content model), ;; 125 declared content = "CDATA" | "RCDATA" | "EMPTY" ;; 126 content model = (127 model group | "ANY"), ;; (65 ps+, 138 exceptions)? ;; I represent a model group with the first state of a corresponding finite ;; automaton (this is a cons). Exceptions are handled separately. ;; The other content types are represented by symbols. (defsubst sgml-model-group-p (model) (consp model)) (defconst sgml-cdata 'CDATA) (defconst sgml-rcdata 'RCDATA) (defconst sgml-empty 'EMPTY) (defconst sgml-any 'ANY) ;;;; External identifier ;; extid = (pubid? sysid? dir) ;; Representation as (pubid sysid . dir) ;; where pubid = nil | string ;; sysid = nil | string ;; dir = string (defun sgml-make-extid (pubid sysid &optional pubid-ok) (and sgml-xml-p (not pubid-ok) pubid (not sysid) (sgml-error "XML requires a system ID after a public ID")) (cons pubid (cons sysid default-directory))) (defun sgml-extid-pubid (extid) (car extid)) (defun sgml-extid-sysid (extid) (if (consp (cdr extid)) (cadr extid) (cdr extid))) (defun sgml-extid-dir (extid) "Directory where EXTID was declared." (if (consp (cdr extid)) (cddr extid) nil)) (defun sgml-extid-expand (file extid) "Expand file name FILE in the context of EXTID." (let ((sgml-system-path (cons (sgml-extid-dir extid) sgml-system-path))) (or (sgml-extid-expand-2 file sgml-system-path) (expand-file-name file (sgml-extid-dir extid))))) (defun sgml-extid-expand-2 (file directories) (cond ((null directories) nil) (t (let ((f (expand-file-name file (car directories)))) (if (file-exists-p f) f (sgml-extid-expand-2 file (cdr directories))))))) ;;;; DTD ;; DTD = (doctype, eltypes, parameters, entities, shortmaps, ;; notations, dependencies, merged) ;; DTDsubset ~=~ DTD, but doctype is unused ;; ;; doctype = name ;; eltypes = oblist ;; parameters = entity* ;; entities = entity* ;; shortmaps = (name, shortmap)* ;; dependencies = file* ;; merged = Compiled-DTD? where Compiled-DTD = (file, DTD) (defstruct (sgml-dtd (:type vector) (:constructor sgml-make-dtd (doctype))) doctype ; STRING, name of doctype (eltypes ; OBLIST, element types defined (sgml-make-eltype-table)) (parameters ; ALIST (sgml-make-entity-table)) (entities ; ALIST (sgml-make-entity-table)) (shortmaps ; ALIST (sgml-make-shortref-table)) (notations ; ?? nil) (dependencies ; LIST nil) (merged ; (file . DTD) nil) (undef-entities ; LIST of entity names nil)) ;;;; Element type objects ;; An element type object contains the information about an element type ;; obtained from parsing the DTD. ;; An element type object is represented by a symbol in a special oblist. ;; A table of element type objects is represented by a oblist. ;;; Element type objects (defsubst sgml-eltype-name (et) (symbol-name et)) (defsubst sgml-eltype-defined (et) (fboundp et)) (defsubst sgml-eltype-token (et) "Return a token for the element type." et) (defsubst sgml-token-eltype (token) "Return the element type corresponding to TOKEN." token) (defmacro sgml-prop-fields (&rest names) (cons 'progn (loop for n in names collect `(defmacro ,(intern (format "sgml-eltype-%s" n)) (et) (list 'get et '',n))))) (sgml-prop-fields ;;flags ; optional tags and mixed ; (perhaps in value field) ;;model ; Content type ; (perhaps in function field) attlist ; List of defined attributes includes ; List of included elements excludes ; List of excluded elements shortmap ; Associated shortref map ; nil if none and 'empty if #empty ) (defmacro sgml-eltype-flags (et) `(symbol-value ,et)) (defun sgml-eltype-model (et) (if (fboundp et) (symbol-function et) sgml-any)) (defsetf sgml-eltype-model fset) (defun sgml-eltype-stag-optional (et) (= 1 (logand (sgml-eltype-flags et) 1))) (defun sgml-eltype-etag-optional (et) (/= 0 (logand 2 (sgml-eltype-flags et)))) (defsubst sgml-eltype-mixed (et) (< 3 (sgml-eltype-flags et))) (defsetf sgml-eltype-stag-optional (et) (f) (list 'sgml-set-eltype-flag et 1 f)) (defsetf sgml-eltype-etag-optional (et) (f) (list 'sgml-set-eltype-flag et 2 f)) (defsetf sgml-eltype-mixed (et) (f) (list 'sgml-set-eltype-flag et 4 f)) (defun sgml-set-eltype-flag (et mask f) (setf (sgml-eltype-flags et) (logior (logand (if (boundp et) (sgml-eltype-flags et) 0) (lognot mask)) (if f mask 0)))) (defun sgml-maybe-put (sym prop val) (when val (put sym prop val))) (defsetf sgml-eltype-includes (et) (l) (list 'sgml-maybe-put et ''includes l)) (defsetf sgml-eltype-excludes (et) (l) (list 'sgml-maybe-put et ''excludes l)) (defmacro sgml-eltype-appdata (et prop) "Get application data from element type ET with name PROP. PROP should be a symbol, reserved names are: flags, model, attlist, includes, excludes, conref-regexp, mixed, stag-optional, etag-optional." `(get ,et ,prop)) (defun sgml-eltype-all-miscdata (et) (loop for p on (symbol-plist et) by (function cddr) unless (memq (car p) '(model flags includes excludes)) nconc (list (car p) (cadr p)))) (defun sgml-eltype-set-all-miscdata (et miscdata) (setf (symbol-plist et) (nconc (symbol-plist et) miscdata))) (defun sgml-make-eltype (name) (let ((et (make-symbol name))) (setf (sgml-eltype-flags et) 0) et)) ;;; Element type tables (defun sgml-make-eltype-table () "Make an empty table of element types." (make-vector 73 0)) (defun sgml-eltype-table-empty (eltype-table) (loop for x across eltype-table always (eq x 0))) (defun sgml-merge-eltypes (eltypes1 eltypes2) "Return the merge of two element type tables ELTYPES1 and ELTYPES2. This may change ELTYPES1, ELTYPES2 is unchanged. Returns the new table." (if (sgml-eltype-table-empty eltypes1) eltypes2 (progn (mapatoms (function (lambda (sym) (let ((et (intern (symbol-name sym) eltypes1))) (unless (fboundp et) ; not yet defined by (sgml-read-peek) sgml-max-single-octet-number) (+ (* (- (sgml-read-octet) (eval-when-compile (1+ sgml-max-single-octet-number))) 256) (sgml-read-octet) sgml-max-single-octet-number) (sgml-read-octet))) (defun sgml-read-sexp () (prog1 (let ((standard-input (current-buffer))) (read)) (skip-chars-forward " \t") (forward-char 1))) (defsubst sgml-read-token () (aref sgml-read-token-vector (sgml-read-number))) (defsubst sgml-read-node-ref () (aref sgml-read-nodes (sgml-read-octet))) (defun sgml-read-model-seq () (loop repeat (sgml-read-number) collect (sgml-read-model))) (defun sgml-read-token-seq () (loop repeat (sgml-read-number) collect (sgml-read-token))) (defun sgml-read-moves () (loop repeat (sgml-read-number) collect (sgml-make-move (sgml-read-token) (sgml-read-node-ref)))) (defun sgml-read-model () (let* ((n (sgml-read-number)) (sgml-read-nodes (make-vector n nil))) (loop for i below n do (aset sgml-read-nodes i (sgml-make-state))) (loop for e across sgml-read-nodes do (cond ((eq 255 (sgml-read-peek)) ; a and-node (sgml-read-octet) ; skip (setf (sgml-and-node-next e) (sgml-read-node-ref)) (setf (sgml-and-node-dfas e) (sgml-read-model-seq))) (t ; a normal-state (setf (sgml-state-opts e) (sgml-read-moves)) (setf (sgml-state-reqs e) (sgml-read-moves))))) (aref sgml-read-nodes 0))) (defun sgml-read-content () (let ((c (sgml-read-octet))) (cond ((eq c 0) sgml-cdata) ((eq c 1) sgml-rcdata) ((eq c 2) sgml-empty) ((eq c 3) sgml-any) ((eq c 4) nil) ((eq c 128) (sgml-read-model))))) (defun sgml-read-decode-flag (flag mask) (not (zerop (logand flag mask)))) (defun sgml-read-element (et) (sgml-eltype-set-all-miscdata et (sgml-read-sexp)) (let ((flags (sgml-read-octet))) (unless (= flags 128) (setf (sgml-eltype-flags et) flags (sgml-eltype-model et) (sgml-read-content) (sgml-eltype-includes et) (sgml-read-token-seq) (sgml-eltype-excludes et) (sgml-read-token-seq))))) (defun sgml-read-dtd () "Decode the saved DTD in current buffer, return the DTD." (let ((gc-cons-threshold (max gc-cons-threshold 500000)) (file-version (sgml-read-sexp)) dtd) (cond ((equal file-version '(sgml-saved-dtd-version 7)) (setq dtd (sgml-bdtd-read-dtd))) ;; Something else (t (error "Unknown file format for saved DTD: %s" file-version))) dtd)) (defun sgml-load-dtd (file) "Load a saved DTD from FILE." (interactive (let ((tem (expand-file-name (or sgml-default-dtd-file (sgml-default-dtd-file))))) (list (read-file-name "Load DTD from: " (file-name-directory tem) tem t (file-name-nondirectory tem))))) (setq sgml-loaded-dtd nil) ; Allow reloading of DTD ;; Search for 'file' on the sgml-system-path [ndw] (let ((real-file (car (apply 'nconc (mapcar (lambda (dir) (let ((f (expand-file-name file dir))) (if (file-exists-p f) (list f)))) (cons "." sgml-system-path)))))) (or real-file (error "Saved DTD file %s not found" file)) (let ((cb (current-buffer)) (tem nil) (dtd nil) (l (buffer-list)) (find-file-type ; Allways binary (function (lambda (fname) 1)))) ;; Search loaded buffer for a already loaded DTD (while (and l (null tem)) (set-buffer (car l)) (if (equal sgml-loaded-dtd real-file) (setq tem (current-buffer))) (setq l (cdr l))) (cond (tem ; loaded DTD found (setq dtd (sgml-pstate-dtd sgml-buffer-parse-state))) (t ; load DTD from file (set-buffer cb) (sgml-push-to-entity real-file) (message "Loading DTD from %s..." real-file) (setq dtd (sgml-read-dtd)) (message "Loading DTD from %s...done" real-file) (sgml-pop-entity))) (set-buffer cb) (sgml-set-initial-state dtd) (setq sgml-default-dtd-file file) (setq sgml-loaded-dtd real-file)))) ;;;; Binary coded DTD module ;;; Works on the binary coded compiled DTD (bdtd) ;;; bdtd-load: cfile dtdfile ents -> bdtd ;;; bdtd-merge: bdtd dtd -> dtd? ;;; bdtd-read-dtd: bdtd -> dtd ;;; Implement by letting bdtd be implicitly the current buffer and ;;; dtd implicit in sgml-dtd-info. (defun sgml-bdtd-load (cfile dtdfile ents) "Load the compiled dtd from CFILE into the current buffer. If this file does not exist, is of an old version or out of date, a new compiled dtd will be created from file DTDFILE and parameter entity settings in ENTS." ;;(Assume the current buffer is a scratch buffer and is empty) (sgml-debug "Trying to load compiled DTD from %s..." cfile) (sgml-set-buffer-multibyte nil) (or (and (file-readable-p cfile) (let ((find-file-type ; Always binary (function (lambda (fname) 1))) (coding-system-for-read 'binary)) ;; fifth arg to insert-file-contents is not available in early ;; v19. (insert-file-contents cfile nil nil nil)) (equal '(sgml-saved-dtd-version 7) (sgml-read-sexp)) (or (sgml-up-to-date-p cfile (sgml-read-sexp)) (if (eq 'ask sgml-recompile-out-of-date-cdtd) (not (y-or-n-p "Compiled DTD is out of date, recompile? ")) (not sgml-recompile-out-of-date-cdtd)))) (sgml-compile-dtd dtdfile cfile ents))) (defun sgml-up-to-date-p (file dependencies) "Check if FILE is newer than all files in the list DEPENDENCIES. If DEPENDENCIES contains the symbol t, FILE is not considered newer." (if (memq t dependencies) nil (loop for f in dependencies always (file-newer-than-file-p file f)))) (defun sgml-compile-dtd (dtd-file to-file ents) "Construct a binary code compiled dtd from DTD-FILE and write it to TO-FILE. The dtd will be constructed with the parameter entities set according to ENTS. The bdtd will be left in the current buffer. The current buffer is assumed to be empty to start with." (message "Recompiling DTD file %s..." dtd-file) (let* ((sgml-dtd-info (sgml-make-dtd nil)) (parameters (sgml-dtd-parameters sgml-dtd-info)) (sgml-parsing-dtd t)) (push dtd-file (sgml-dtd-dependencies sgml-dtd-info)) (loop for (name . val) in ents do (sgml-entity-declare name parameters 'text val)) (sgml-push-to-entity dtd-file) (sgml-check-dtd-subset) (sgml-debug "sgml-compile-dtd: poping entity") (sgml-pop-entity) (erase-buffer) (sgml-write-dtd sgml-dtd-info to-file) t)) (defun sgml-check-entities (params1 params2) "Check that PARAMS1 is compatible with PARAMS2." (block check-entities (sgml-map-entities (function (lambda (entity) (let ((other (sgml-lookup-entity (sgml-entity-name entity) params2))) (unless (or (null other) (equal entity other)) (message "Parameter %s in compiled DTD has wrong value;\ is '%s' should be '%s'" (sgml-entity-name entity) (sgml-entity-text other) (sgml-entity-text entity)) (return-from check-entities nil))))) params1) t)) (defun sgml-bdtd-merge () "Merge the binary coded dtd in the current buffer with the current dtd. The current dtd is the variable `sgml-dtd-info'. Return t if the merge was successful or nil if failed." (goto-char (point-min)) (sgml-read-sexp) ; skip filev (let ((dependencies (sgml-read-sexp)) (parameters (sgml-read-sexp)) (gc-cons-threshold (max gc-cons-threshold 500000)) temp) ;; Check compatibility of parameters (and (sgml-check-entities (sgml-dtd-parameters sgml-dtd-info) parameters) (progn ;; Do the merger (sgml-message "Reading compiled DTD...") (sgml-merge-entity-tables (sgml-dtd-parameters sgml-dtd-info) parameters) (setf (sgml-dtd-dependencies sgml-dtd-info) (nconc (sgml-dtd-dependencies sgml-dtd-info) dependencies)) ;; Doctype (setq temp (sgml-read-sexp)) (when (and temp (null (sgml-dtd-doctype sgml-dtd-info))) (setf (sgml-dtd-doctype sgml-dtd-info) temp)) ;; Element type names -- read and create token vector (setq temp (sgml-read-number)) ; # eltypes (setq sgml-read-token-vector (make-vector (1+ temp) nil)) (aset sgml-read-token-vector 0 sgml-pcdata-token) (loop for i from 1 to temp do (aset sgml-read-token-vector i (sgml-lookup-eltype (sgml-read-sexp)))) ;; Element type descriptions (loop for i from 1 to (sgml-read-number) do (sgml-read-element (aref sgml-read-token-vector i))) (sgml-merge-entity-tables (sgml-dtd-entities sgml-dtd-info) (sgml-read-sexp)) (sgml-merge-shortmaps (sgml-dtd-shortmaps sgml-dtd-info) (sgml-read-sexp)) (setf (sgml-dtd-notations sgml-dtd-info) (sgml-read-sexp)) t)))) (defun sgml-bdtd-read-dtd () "Create and return a dtd from the binary coded dtd in the current buffer." (let ((sgml-dtd-info (sgml-make-dtd nil))) (sgml-bdtd-merge) sgml-dtd-info)) ;;;; Set markup type (defsubst sgml-set-markup-type (type) "Set the type of the markup parsed to TYPE. The markup starts at position given by variable `sgml-markup-start' and ends at point." (when (and sgml-set-face (null sgml-current-eref)) (sgml-set-face-for sgml-markup-start (point) type)) (setq sgml-markup-type type)) ;;;; Parsing delimiters (eval-and-compile (defconst sgml-delimiters '("AND" "&" "COM" "--" "CRO" "&#" "DSC" "]" "DSO" "[" "DTGC" "]" "DTGO" "[" "ERO" "&" "ETAGO" "" "MDO" "" "PIO" "" "VI" "=" ;; Some combinations "MS-START" "" ; MSC MDC ;; XML stuff "XML-ECOM" "-->" ; end an XML comment "XML-PIC" "?>" ; end an XML processing instruction "XML-SCOM" "\n") (forward-line -3))) (let* ((endpos (save-excursion (search-forward (format "\n%send:" prefix)))) (varpos (search-forward (format "\n%s%s:" prefix var) endpos t))) (cond (varpos (delete-region (point) (save-excursion (end-of-line 1) (point))) (insert (format "%S" val) suffix)) (t (goto-char endpos) (beginning-of-line 1) (insert prefix (format "%s:%S" var val) suffix ?\n))))))) (defun sgml-valid-option (var) (let ((type (sgml-variable-type var)) (val (symbol-value var))) (cond ((eq 'string type) (stringp val)) ((eq 'list-or-string type) (or (stringp val) (consp val))) (t t)))) (defun sgml-save-options () "Save user options for SGML mode that have buffer local values." (interactive) (loop for var in sgml-file-options do (when (sgml-valid-option var) (sgml-set-local-variable var (symbol-value var))))) ;;;; Run hook with args (unless (fboundp 'run-hook-with-args) (defun run-hook-with-args (hook &rest args) "Run HOOK with the specified arguments ARGS. HOOK should be a symbol, a hook variable. If HOOK has a non-nil value, that value may be a function or a list of functions to be called to run the hook. If the value is a function, it is called with the given arguments and its return value is returned. If it is a list of functions, those functions are called, in order, with the given arguments ARGS. It is best not to depend on the value return by `run-hook-with-args', as that may change." (and (boundp hook) (symbol-value hook) (let ((value (symbol-value hook))) (if (and (listp value) (not (eq (car value) 'lambda))) (mapcar '(lambda (foo) (apply foo args)) value) (apply value args)))))) ;;;; SGML mode: template functions (defun sgml-markup (entry text) (cons entry `(lambda () (interactive) (sgml-insert-markup ,text)))) (defun sgml-insert-markup (text) (let ((end (sgml-mouse-region)) before after old-text) (when end (setq old-text (buffer-substring (point) end)) (delete-region (point) end)) (setq before (point)) (if (stringp text) (insert text) (eval text)) (setq after (point)) (goto-char before) (when (search-forward "\r" after t) (delete-char -1)) (when old-text (insert old-text)))) (defun sgml-mouse-region () (let (start end) (cond (sgml-running-lucid (cond ((null (mark-marker)) nil) (t (setq start (region-beginning) end (region-end))))) ((and transient-mark-mode mark-active) (setq start (region-beginning) end (region-end))) ((and mouse-secondary-overlay (eq (current-buffer) (overlay-buffer mouse-secondary-overlay))) (setq start (overlay-start mouse-secondary-overlay) end (overlay-end mouse-secondary-overlay)) (delete-overlay mouse-secondary-overlay))) (when start (goto-char start)) end)) ;;;; SGML mode: indentation (defun sgml-indent-or-tab () "Indent line in proper way for current major mode." (interactive) (if (null sgml-indent-step) (insert-tab) (funcall indent-line-function))) ;;;; Bug reporting (eval-and-compile (autoload 'reporter-submit-bug-report "reporter")) (defun sgml-submit-bug-report () "Submit via mail a bug report on PSGML." (interactive) (and (y-or-n-p "Do you really want to submit a report on PSGML? ") (reporter-submit-bug-report psgml-maintainer-address (concat "psgml.el " psgml-version) (list 'major-mode 'sgml-always-quote-attributes 'sgml-auto-activate-dtd 'sgml-auto-insert-required-elements 'sgml-balanced-tag-edit 'sgml-catalog-files 'sgml-declaration 'sgml-doctype 'sgml-ecat-files 'sgml-indent-data 'sgml-indent-step 'sgml-leave-point-after-insert 'sgml-live-element-indicator 'sgml-local-catalogs 'sgml-local-ecat-files 'sgml-markup-faces 'sgml-minimize-attributes 'sgml-normalize-trims 'sgml-omittag 'sgml-omittag-transparent 'sgml-parent-document 'sgml-public-map 'sgml-set-face 'sgml-shorttag 'sgml-namecase-general 'sgml-tag-region-if-active 'sgml-use-text-properties )))) ;;;; SGML mode: syntax table (defvar sgml-mode-syntax-table (let ((s (copy-syntax-table text-mode-syntax-table))) (modify-syntax-entry ?< "." s) (modify-syntax-entry ?> "." s) s)) ;;;; SGML mode: keys and menus (if sgml-mode-map () (setq sgml-mode-map (make-sparse-keymap))) (defvar sgml-prefix-f-map (make-sparse-keymap)) (defvar sgml-prefix-u-map (make-sparse-keymap)) (define-key sgml-mode-map "\C-c\C-f" sgml-prefix-f-map) (define-key sgml-mode-map "\C-c\C-u" sgml-prefix-u-map) ;;; Key commands (define-key sgml-mode-map "\t" 'sgml-indent-or-tab) ;(define-key sgml-mode-map "<" 'sgml-insert-tag) (define-key sgml-mode-map ">" 'sgml-close-angle) (define-key sgml-mode-map "/" 'sgml-slash) (define-key sgml-mode-map "\C-c#" 'sgml-make-character-reference) (define-key sgml-mode-map "\C-c-" 'sgml-untag-element) (define-key sgml-mode-map "\C-c+" 'sgml-insert-attribute) (define-key sgml-mode-map "\C-c/" 'sgml-insert-end-tag) (define-key sgml-mode-map "\C-c<" 'sgml-insert-tag) (define-key sgml-mode-map "\C-c=" 'sgml-change-element-name) (define-key sgml-mode-map "\C-c\C-a" 'sgml-edit-attributes) (define-key sgml-mode-map "\C-c\C-c" 'sgml-show-context) (define-key sgml-mode-map "\C-c\C-d" 'sgml-next-data-field) (define-key sgml-mode-map "\C-c\C-e" 'sgml-insert-element) (define-key sgml-mode-map "\C-c\C-f\C-e" 'sgml-fold-element) (define-key sgml-mode-map "\C-c\C-f\C-r" 'sgml-fold-region) (define-key sgml-mode-map "\C-c\C-f\C-s" 'sgml-fold-subelement) (define-key sgml-mode-map "\C-c\C-f\C-x" 'sgml-expand-element) (define-key sgml-mode-map "\C-c\C-i" 'sgml-add-element-to-element) (define-key sgml-mode-map "\C-c\C-k" 'sgml-kill-markup) (define-key sgml-mode-map "\C-c\r" 'sgml-split-element) (define-key sgml-mode-map "\C-c\C-n" 'sgml-up-element) (define-key sgml-mode-map "\C-c\C-o" 'sgml-next-trouble-spot) (define-key sgml-mode-map "\C-c\C-p" 'sgml-load-doctype) (define-key sgml-mode-map "\C-c\C-q" 'sgml-fill-element) (define-key sgml-mode-map "\C-c\C-r" 'sgml-tag-region) (define-key sgml-mode-map "\C-c\C-s" 'sgml-show-structure) ;(define-key sgml-mode-map "\C-c\C-t" 'sgml-list-valid-tags) (define-key sgml-mode-map "\C-c\C-t" 'sgml-show-current-element-type) (define-key sgml-mode-map "\C-c\C-u\C-a" 'sgml-unfold-all) (define-key sgml-mode-map "\C-c\C-u\C-d" 'sgml-custom-dtd) (define-key sgml-mode-map "\C-c\C-u\C-e" 'sgml-unfold-element) (define-key sgml-mode-map "\C-c\C-u\C-l" 'sgml-unfold-line) (define-key sgml-mode-map "\C-c\C-u\C-m" 'sgml-custom-markup) (define-key sgml-mode-map "\C-c\C-v" 'sgml-validate) (define-key sgml-mode-map "\C-c\C-w" 'sgml-what-element) (define-key sgml-mode-map "\C-c\C-z" 'sgml-trim-and-leave-element) (define-key sgml-mode-map "\e\C-a" 'sgml-beginning-of-element) (define-key sgml-mode-map "\e\C-e" 'sgml-end-of-element) (define-key sgml-mode-map "\e\C-f" 'sgml-forward-element) (define-key sgml-mode-map "\e\C-b" 'sgml-backward-element) (define-key sgml-mode-map "\e\C-d" 'sgml-down-element) (define-key sgml-mode-map "\e\C-u" 'sgml-backward-up-element) (define-key sgml-mode-map "\e\C-k" 'sgml-kill-element) (define-key sgml-mode-map "\e\C-@" 'sgml-mark-element) ;;(define-key sgml-mode-map [?\M-\C-\ ] 'sgml-mark-element) (define-key sgml-mode-map [(meta control h)] 'sgml-mark-current-element) (define-key sgml-mode-map "\e\C-t" 'sgml-transpose-element) (define-key sgml-mode-map "\M-\t" 'sgml-complete) ;;;; Menu bar (easy-menu-define sgml-main-menu sgml-mode-map "Main menu" '("SGML" ["Parse DTD" sgml-parse-prolog t] ("DTD Info" ["General DTD info" sgml-general-dtd-info t] ["Describe element type" sgml-describe-element-type t] ["Describe entity" sgml-describe-entity t] ["List elements" sgml-list-elements t] ["List attributes" sgml-list-attributes t] ["List terminals" sgml-list-terminals t] ["List content elements" sgml-list-content-elements t] ["List occur in elements" sgml-list-occur-in-elements t]) ("Insert Markup" ["Insert Element" sgml-element-menu t] ["Insert Start-Tag" sgml-start-tag-menu t] ["Insert End-Tag" sgml-end-tag-menu t] ["End Current Element" sgml-insert-end-tag t] ["Tag Region" sgml-tag-region-menu t] ["Insert Attribute" sgml-attrib-menu t] ["Insert Entity" sgml-entities-menu t] ["Add Element to Element" sgml-add-element-menu t] ("Insert DTD") ("Custom markup" "---")) "--" ["Show Context" sgml-show-context t] ["What Element" sgml-what-element t] ["List Valid Tags" sgml-list-valid-tags t] ["Validate" sgml-validate t] "--" ("Move" ["Next trouble spot" sgml-next-trouble-spot t] ["Next data field" sgml-next-data-field t] ["Forward element" sgml-forward-element t] ["Backward element" sgml-backward-element t] ["Up element" sgml-up-element t] ["Down element" sgml-down-element t] ["Backward up element" sgml-backward-up-element t] ["Beginning of element" sgml-beginning-of-element t] ["End of element" sgml-end-of-element t]) ("View" ["Fold Element" sgml-fold-element t] ["Fold Subelement" sgml-fold-subelement t] ["Unfold Line" sgml-unfold-line t] ["Unfold Element" sgml-unfold-element t] ["Expand" sgml-expand-element t] ["Fold Region" sgml-fold-region t] ["Unfold All" sgml-unfold-all t] ["Hide Tags" sgml-hide-tags t] ["Hide Attributes" sgml-hide-attributes t] ["Show All Tags" sgml-show-tags t]) "--" ["Normalize Document" sgml-normalize t] ["Normalize Element" sgml-normalize-element t] ["Expand All Short References" sgml-expand-all-shortrefs (not sgml-xml-p)] ["Expand Entity Reference" sgml-expand-entity-reference t] ["Make Character Reference" sgml-make-character-reference t] ["Unmake Character Reference" (sgml-make-character-reference t) t] ["Fill Element" sgml-fill-element t] ["Change Element Name..." sgml-change-element-name t] ["Edit Attributes..." sgml-edit-attributes t] ["Kill Markup" sgml-kill-markup t] ["Kill Element" sgml-kill-element t] ["Untag Element" sgml-untag-element t] ["Trim and leave element" sgml-trim-and-leave-element t] ["Decode Character Entities" sgml-charent-to-display-char t] ["Encode Characters" sgml-display-char-to-charent t] "--" ("File Options" "---") ("User Options" "---") ["Reset Buffer" normal-mode t] ["Submit Bug Report" sgml-submit-bug-report t] )) (defun sgml-options-menu-items (vars) (mapcar (lambda (var) (let ((desc (format "%s [%s]" (sgml-variable-description var) (sgml-option-value-indicator var))) (type (sgml-variable-type var))) (cond ((consp type) (cons desc (mapcar (lambda (c) (vector (if (consp c) (car c) (format "%s" c)) `(setq ,var ',(if (consp c) (cdr c) c)) t)) type))) (t (vector desc `(sgml-do-set-option ',var) t))))) vars)) (defun sgml-option-value-indicator (var) (let ((type (sgml-variable-type var)) (val (symbol-value var))) (cond ((eq type 'toggle) (if val "Yes" "No")) ((eq type 'string) (if (stringp val) (substring val 0 (min (length val) 4)) "-")) ((and (atom type) val) "...") ((consp type) (or (car (rassq val type)) val)) (t "-")))) (defvar sgml-last-options-menu-values ()) (defun sgml-any-option-changed (oldvalues vars) (not (loop for val in oldvalues for var in vars always (eq val (symbol-value var))))) (defun sgml-update-options-menu (menuname option-vars &optional save-func) (let ((last-values (assoc menuname sgml-last-options-menu-values))) (when (or (null last-values) (sgml-any-option-changed (cdr last-values) option-vars)) (condition-case err (easy-menu-change '("SGML") menuname (nconc (sgml-options-menu-items option-vars) (if save-func (list "---" (vector (format "Save %s" menuname) save-func t))))) (error (message "Error in update menu: %s" err))) (unless last-values (setq last-values (cons menuname nil)) (push last-values sgml-last-options-menu-values)) (setf (cdr last-values) (mapcar (function symbol-value) option-vars))))) (defun sgml-update-all-options-menus () (sgml-update-options-menu "File Options" sgml-file-options 'sgml-save-options) (sgml-update-options-menu "User Options" sgml-user-options) nil) (defun sgml-compute-insert-dtd-items () (loop for e in sgml-custom-dtd collect (vector (first e) `(sgml-doctype-insert ,(cadr e) ',(cddr e)) t))) (defun sgml-compute-custom-markup-items () (loop for e in sgml-custom-markup collect (vector (first e) `(sgml-insert-markup ,(cadr e)) t))) (defun sgml-build-custom-menus () "Build custom parts of Markup and DTD menus." (let ((button3 (lookup-key (current-local-map) [button3]))) (unless (or (null button3) (numberp button3)) (local-set-key [button3] button3)) (when sgml-custom-dtd (easy-menu-change '("SGML" "Insert Markup") "Insert DTD" (sgml-compute-insert-dtd-items))) (when sgml-custom-markup (easy-menu-change '("SGML" "Insert Markup") "Custom markup" (sgml-compute-custom-markup-items)))) nil) ;;;; Post command hook (defvar sgml-auto-activate-dtd-tried nil) (make-variable-buffer-local 'sgml-auto-activate-dtd-tried) (defvar sgml-buffer-parse-state nil "If the buffers DTD has been activated this contains the parser state. The parser state has been created with `sgml-make-pstate' and contains the information about the DTD and the parse tree. This parse state is actually only the state that persists between commands.") (make-variable-buffer-local 'sgml-buffer-parse-state) (eval-and-compile ; Interface to psgml-parse (loop for fun in '(sgml-need-dtd sgml-update-display sgml-fontify-buffer sgml-subst-expand sgml-declaration) do (autoload fun "psgml-parse"))) (defun sgml-command-post () (when (and (null sgml-buffer-parse-state) sgml-auto-activate-dtd (null sgml-auto-activate-dtd-tried) (not (zerop (buffer-size))) (looking-at ".*<")) (setq sgml-auto-activate-dtd-tried t) (ignore-errors (sgml-need-dtd) (sgml-fontify-buffer 0))) (when sgml-buffer-parse-state (sgml-update-display))) ;;;; SGML mode: major mode definition ;;; This section is mostly from sgml-mode by James Clark. ;;;###autoload (defun sgml-mode () "Major mode for editing SGML. \\Makes > display the matching <. Makes / display matching /. Use \\[sgml-validate] to validate your document with an SGML parser. You can find information with: \\[sgml-show-context] Show the nesting of elements at cursor position. \\[sgml-list-valid-tags] Show the tags valid at cursor position. Insert tags with completion of contextually valid tags with \\[sgml-insert-tag]. End the current element with \\[sgml-insert-end-tag]. Insert an element (i.e. both start and end tag) with \\[sgml-insert-element]. Or tag a region with \\[sgml-tag-region]. To tag a region with the mouse, use transient mark mode or secondary selection. Structure editing: \\[sgml-backward-element] Moves backwards over the previous element. \\[sgml-forward-element] Moves forward over the next element. \\[sgml-down-element] Move forward and down one level in the element structure. \\[sgml-backward-up-element] Move backward out of this element level. \\[sgml-beginning-of-element] Move to after the start tag of the current element. \\[sgml-end-of-element] Move to before the end tag of the current element. \\[sgml-kill-element] Kill the element following the cursor. Finding interesting positions \\[sgml-next-data-field] Move forward to next point where data is allowed. \\[sgml-next-trouble-spot] Move forward to next point where something is amiss with the structure. Folding and unfolding \\[sgml-fold-element] Fold the lines comprising the current element, leaving the first line visible. \\[sgml-fold-subelement] Fold the elements in the content of the current element. Leaving the first line of every element visible. \\[sgml-unfold-line] Show hidden lines in current line. User options: sgml-omittag Set this to reflect OMITTAG in the SGML declaration. sgml-shorttag Set this to reflect SHORTTAG in the SGML declaration. sgml-namecase-general Set this to reflect NAMECASE GENERAL in the SGML declaration. sgml-auto-insert-required-elements If non-nil, automatically insert required elements in the content of an inserted element. sgml-omittag-transparent If non-nil, will show legal tags inside elements with omitable start tags and legal tags beyond omitable end tags. sgml-leave-point-after-insert If non-nil, the point will remain after inserted tag(s). sgml-warn-about-undefined-elements If non-nil, print a warning when a tag for a undefined element is found. sgml-max-menu-size Max number of entries in Tags and Entities menus before they are split into several panes. sgml-always-quote-attributes If non-nil, quote all attribute values inserted after finishing edit attributes. sgml-minimize-attributes Determines minimization of attributes inserted by edit-attributes. sgml-normalize-trims If non-nil, sgml-normalize will trim off white space from end of element when adding end tag. sgml-indent-step How much to increment indent for every element level. sgml-indent-data If non-nil, indent in data/mixed context also. sgml-set-face If non-nil, psgml will set the face of parsed markup. sgml-markup-faces The faces used when the above variable is non-nil. sgml-public-map Mapping from public identifiers to file names. sgml-offer-save If non-nil, ask about saving modified buffers before \\[sgml-validate] is run. All bindings: \\{sgml-mode-map}" (interactive) (kill-all-local-variables) (setq sgml-xml-p nil) (setq local-abbrev-table sgml-mode-abbrev-table) (use-local-map sgml-mode-map) (setq mode-name "SGML") (setq major-mode 'sgml-mode) ;; A start or end tag by itself on a line separates a paragraph. ;; This is desirable because SGML discards a newline that appears ;; immediately after a start tag or immediately before an end tag. (set (make-local-variable 'paragraph-separate) (if sgml-have-re-char-clases "^[ \t\n]*$\\|\ ^[ \t]*$" "^[ \t\n]*$\\|\ ^[ \t]*$")) (set (make-local-variable 'paragraph-start) paragraph-separate) (set-syntax-table sgml-mode-syntax-table) (make-local-variable 'comment-start) (setq comment-start "") (make-local-variable 'comment-indent-function) (setq comment-indent-function 'sgml-comment-indent) (make-local-variable 'comment-start-skip) ;; This will allow existing comments within declarations to be ;; recognized. [Does not work well with auto-fill, Lst/940205] ;;(setq comment-start-skip "--[ \t]*") (setq comment-start-skip " You can also put a line at the top of the file to tell emacs to use sgml mode: For XML replace `sgml' with `xml' in the above examples. But remember that you can't have a comment before the _SGML declaration_ or the _XML declaration_.  File: psgml.info, Node: Entity manager, Next: Validate, Prev: Invoke, Up: Top The Entity Manager ****************** SGML can refer to an external file (really entity) with an _external identifier_, this is a _public identifier_ or a _system identifier_, or both. A typical public identifier looks like PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" where "ISO 8879:1986" is the owner, "ENTITIES" is the text class and "Added Latin 1" is the text description (and "EN" is language). A system identifier looks like SYSTEM "htmlplus.dtd" where "htmlplus.dtd" is a system-specific identifier. To map external identifiers to file names, PSGML first searches entity catalog files and then search the list of file name templates in the variable `sgml-public-map'. The catalog format is according to SGML/Opens resolution on entity management. The catalog consists of a series of entries and comments. A comment is delimited by `--' like in a markup declaration. The entry types recognized are described in the following table. `public PUBID FILE' The FILE will be used for the entity text of an entity with the public identifier PUBID. `entity NAME FILE' The FILE will be used for the entity text of an entity with the name NAME. If the NAME starts with a `%' the rest of the name will be matched against parameter entities. `doctype NAME FILE' The FILE will be used for the entity text of an entity used as external subset of a document declaration with NAME as document type name. `sgmldecl FILE' Used to specify a default SGML declaration. Recognized but not used by PSGML other than to pass to an external validation command (`sgml-validate-command'). When PSGML is looking for the file containing an external entity, the following things will be tried in order: 1. Try the system identifier, as a file name, if there is a system identifier and the variable `sgml-system-identifiers-are-preferred' is non-`nil' and there is no elements containing `%s' in `sgml-public-map'. If the system identifier is a relative file name it will be relative to the directory containing the defining entity. 2. Look thru each catalog in `sgml-local-catalogs' and `sgml-catalog-files' in order. For each catalog look first for entries matching the public identifier, if any. Then look for other matching entries in the order they appear in the catalog. Currently an entry will be ignored if it is matching but its file is non-existent or unreadable. (This is under reconsideration, perhaps it should signal error instead). 3. Try the system identifier, if any, as a file name. If `sgml-system-identifiers-are-preferred' is `nil' and there is no elements containing `%s' in `sgml-public-map'. 4. Try the entries in `sgml-public-map'. Using the catalogs are preferred. The `sgml-public-map' may disappear in a future version of PSGML (not soon though). The `sgml-public-map' variable can contain a list of file name templates where `%P' will be substituted with the whole public identifier, owner is substituted for `%O', public text class for `%C', and public text description for `%D'. The text class will be converted to lower case and the owner and description will be transliterated according to the variable `sgml-public-transliterations'. The templates in the list is tried in order until an existing file is found. The `sgml-public-map' is modeled after `sgmls' environment variable `SGML_PATH' and psgml understand the following substitution characters: %%, %N, %P, %S, %Y, %C, %L, %O, %T, and %V. The default value of `sgml-public-map' is taken from the environment variable `SGML_PATH'. Given the public identifier above and the file name template `/usr/local/lib/sgml/%o/%c/%d', the resulting file name is /usr/local/lib/sgml/ISO_8879:1986/entities/Added_Latin_1 Note: blanks are transliterated to `_' (and also `/' to `%') and the text class is down cased. - User Option: sgml-catalog-files This is a list of catalog entry files. The files are in the format defined in the SGML Open Draft Technical Resolution on Entity Management. The Emacs variable is initialized from the environment variable `SGML_CATALOG_FILES' or if this variable is undefined the default is ("CATALOG" "/usr/local/lib/sgml/CATALOG") - User Option: sgml-local-catalogs A list of SGML entity catalogs to be searched first when parsing the buffer. This is used in addition to `sgml-catalog-files', and `sgml-public-map'. This variable is automatically local to the buffer. - User Option: sgml-system-identifiers-are-preferred If `nil', PSGML will look up external entities by searching the catalogs in `sgml-local-catalogs' and `sgml-catalog-files' and only if the entity is not found in the catalogs will a given system identifier be used. If the variable is non-nil and a system identifier is given, the system identifier will be used for the entity. If no system identifier is given the catalogs will searched. - User Option: sgml-public-map This should be a list of file name templates. This variable is initialized from the environment variable `SGML_PATH'. This is the same environment variable that `sgmls' uses. If the environment variable is undefined the default is ("%S" "/usr/local/lib/sgml/%o/%c/%d")  File: psgml.info, Node: Validate, Next: SGML declaration, Prev: Entity manager, Up: Top Running an external SGML parser ******************************* PSGML can not validate an SGML document (see below what it can and can't do). If you have a validating SGML parser, like `sgmls', you can run the parser on your file with the command `C-c C-v' (`sgml-validate'). Some variables control this function: - User Option: sgml-validate-command The shell command to validate an SGML document. This is a `format' control string that by default should contain two `%s' conversion specifications: the first will be replaced by the value of `sgml-declaration' (or the empty string, if nil); the second will be replaced by the current buffer's file name (or the empty string, if nil). If `sgml-validate-files' is non-nil, the format string should contain one `%s' conversion specification for each element of its result. If sgml-validate-command is a list, then every element should be a string. The strings will be tried in order and `%'-sequences in the string will be replaced according to the list below, if the string contains `%'-sequences with no replacement value the next string will be tried. `%b' means the visited file of the current buffer `%s' means the SGML declaration specified in the sgml-declaration variable `%d' means the file containing the DOCTYPE declaration, if not in the buffer The default value is `nsgmls -s %s %s'. - User Option: sgml-validate-files If non-nil, a function of no arguments that returns a list of file names. These file names will serve as the arguments to the `sgml-validate-command' format control string instead of the defaults. - User Option: sgml-declaration The name of the SGML declaration file. - User Option: sgml-offer-save If non-nil, `C-c C-v' (`sgml-validate') will ask about saving modified buffers before running the validate command. The default value is `t'. The built-in parser can find some markup errors. The command `C-c C-o' (`sgml-next-trouble-spot') is the best way to use the built-in parser for this. To check the whole file go to the beginning of the buffer and use `C-c C-o'. Some of the markup errors not found are: * Errors in the SGML declaration. * Errors in attribute specifications. * Omitted start-tags for empty elements.  File: psgml.info, Node: SGML declaration, Next: Managing the DTD, Prev: Validate, Up: Top SGML Declaration **************** PSGML does not understand the SGML declaration, it accepts one in the file but it is ignored. If you have the SGML declaration in another file you can make `sgmls' use it when you use the `C-c C-v' (`sgml-validate') command (*note Validate::). PSGML has some options in what features it uses and what markup it creates. You have to set these options to make PSGML's behavior consistent with your SGML declaration and personal preferences. - User Option: sgml-omittag Set this to `t' if the SGML declaration has `OMITTAG YES' and to `nil' otherwise. - User Option: sgml-shorttag Set this to `t' if the SGML declaration has `SHORTTAG YES' and to `nil' otherwise. - User Option: sgml-namecase-general Set this to `t' if the SGML declaration has `NAMECASE GENERAL YES' and to `nil' otherwise. I.e., this controls whether names, except entity names, will be case insensitive (translated to upper case). - User Option: sgml-always-quote-attributes If non-nil, quote all attribute values inserted after finishing edit attributes. If this variable is `nil' and `sgml-shorttag' is non-`nil', attribute values that consists of only name characters will not be quoted. - User Option: sgml-minimize-attributes Determines minimization of attributes inserted by edit-attributes. If non-nil, omit attribute name if the attribute value is from a token group. If `max', omit attributes with default value. Minimization will only be done if they produce legal SGML (assuming `sgml-omittag' and `sgml-shorttag' are set correctly).  File: psgml.info, Node: Managing the DTD, Next: Edit, Prev: SGML declaration, Up: Top Document Type Declaration ************************* PSGML needs to know about the DTD you are using for many of its commands. If you do not have a `DOCTYPE' declaration in your file, PSGML will try assume that there is one of the form where NAME is the value of `sgml-default-doctype-name', if the value is non-`nil', else the GI of the first tag will be used. PSGML will try to parse the document type declaration the first time you do something that needs to parse the document or immediately if the variable `sgml-auto-activate-dtd' is `t'. You can also initiate the parsing of the document type declaration with the command `sgml-parse-prolog'. Big DTDs take some time to parse. When the DTD has been parsed or loaded the name of the document element will be displayed in the mode line inside brackets. If there was an error parsing the DTD or there is no DTD, the mode line will display `[ANY]' (*** this is not really correct! a DTD will be established even if there are missing entities, it may even be empty). * Menu: * Precompiled DTD Subsets:: * Using a Split Document:: * Inserting a DOCTYPE:: * Information from the DTD:: * Customizing DTD::  File: psgml.info, Node: Precompiled DTD Subsets, Next: Using a Split Document, Prev: Managing the DTD, Up: Managing the DTD Precompiled DTD Subsets ======================= If parsing the DTD takes too long time you can arrange to have PSGML cache an internal complied version of the DTD. Caching can be done of DTD fragments in favourable situations. It is possible to have an external DTD subset cached but still have an internal DTD subset as long as the internal subset does not define parameter entities that affect the parsing of the external subset (*** what is the exact conditions?, probably you can't use the cached external subset if the internal subset defines parameter entities that are also defined in the external subset with another value). To enable caching you have to create special catalog files, hereafter called ECAT files due to (temporary) lack of imagination. These catalogs have similar syntax to the entity catalogs and there are two variables containing lists of catalogs to search: `sgml-ecat-files' and `sgml-local-ecat-files'. The ECAT files can contain the following types of entries: `file DTDFILE ENTITYDEF CFILE' The DTDFILE is the name of a file containing a DTD subset that should be cached in CFILE. The ENTITYDEF is optional and if given have the following syntax: [ NAME1 LITERAL1 NAME2 LITERAL2 ... ] Using ENTITYDEF will modify the DTD subset by defining the parameter entity with name NAME1 to be LITERAL1, .... The cached version of the subset will be created with those entity definitions, and when PSGML search for a matching cached subset will check that the parameter entities in ENTITYDEF has been defined with those values before trying to use `cfile'. `public PUBID ENTITYDEF CFILE' Cache the DTD subset with public identifier PUBID in file CFILE. - User Option: sgml-recompile-out-of-date-cdtd If non-`nil', out of date compiled DTDs will be automatically recompiled. If the value is `ask', PSGML will ask before recompiling. A `nil' value will cause PSGML to silently load an out of date compiled DTD. A DTD that refers to undefined external entities is always out of date, thus in such case it can be useful to set this variable to `nil'. Previous versions of PSGML have had another way of speeding up DTD parsing. This code remains in this version of PSGML, but is not actively maintained and may disappear in the future. You can save the parsed DTD in a file using the command `M-x sgml-save-dtd'. Next time PSGML can load that file instead of parsing the DTD. For PSGML to find the saved DTD you must either save the DTD using the default name or do a `M-x sgml-save-options' after saving the DTD. To directly use an already parsed and saved DTD, load the file containing the saved DTD with the command `M-x sgml-load-dtd'. - User Option: sgml-default-dtd-file This is the default file name for saved DTD. This is set by `sgml-mode' to the buffer file name less extension plus the extension `.ced', if that file exists. Can be changed in the Local variables section of the file.  File: psgml.info, Node: Using a Split Document, Next: Inserting a DOCTYPE, Prev: Precompiled DTD Subsets, Up: Managing the DTD Using a Split Document ====================== You can have the `DOCTYPE' declaration in another file by setting `sgml-doctype' to the other file. - User Option: sgml-parent-document Used when the current file is part of a bigger document. The variable describes how the current file's content fit into the element hierarchy. The variable should have the form (PARENT-FILE CONTEXT-ELEMENT* TOP-ELEMENT (HAS-SEEN-ELEMENT*)?) PARENT-FILE is a string, the name of the file containing the document entity. CONTEXT-ELEMENT is a string, that is the name of an element type. It can occur 0 or more times and is used to set up exceptions and short reference map. Good candidates for these elements are the elements open when the entity pointing to the current file is used. TOP-ELEMENT is a string that is the name of the element type of the top level element in the current file. The file should contain one instance of this element, unless the last (lisp) element of sgml-parent-document is a list. If it is a list, the top level of the file should follow the content model of top-element. HAS-SEEN-ELEMENT is a string that is the name of an element type. This element is satisfied in the content model of top-element.  File: psgml.info, Node: Inserting a DOCTYPE, Next: Information from the DTD, Prev: Using a Split Document, Up: Managing the DTD Inserting a DOCTYPE =================== *** Describe the DTD menu in general. Describe customized entries for special DTDs. Mention `C-c C-u C-d' for inserting a DOCTYPE from keyboard. If you change the doctype you must execute `sgml-parse-prolog', changes in the doctype are not automatically recognized. - User Option: sgml-custom-dtd Menu entries to be added to the DTD menu. The value should be a list of entries to be added to the DTD menu. Every entry should be a list. The first element of the entry is a string used as the menu entry. The second element is a string containing a doctype declaration (this can be nil if no doctype). The rest of the list should be a list of variables and values. For backward compatibility a single string instead of a variable is assigned to `sgml-default-dtd-file'. All variables are made buffer local and are also added to the buffers local variables list. When an entry is selected from the DTD menu, the doctype declaration will be inserted, the variables will be set to the values in the entry and a local variables list will be created in the buffer. Example: (("HTML" nil sgml-default-dtd-file "~/sgml/html.ced" sgml-omittag nil sgml-shorttag nil) ("HTML+" "" "~/sgml/htmlplus.ced" sgml-omittag t sgml-shorttag nil) ("DOCBOOK" "" "~/sgml/docbook.ced" sgml-omittag nil sgml-shorttag t)))  File: psgml.info, Node: Information from the DTD, Next: Customizing DTD, Prev: Inserting a DOCTYPE, Up: Managing the DTD Information from the DTD ======================== PSGML can list various information about the current DTD. The following commands can be used via `M-x' and can also be found in the DTD menu. `sgml-describe-dtd' Display information about the current DTD. `sgml-describe-element-type' Describe the properties of an element type as declared in the current DTD. `sgml-describe-entity' Describe the properties of an entity as declared in the current DTD. `sgml-list-elements' Will list all elements and the attributes declared for the element. `sgml-list-attributes' Will list all attributes declared and the elements that use them. `sgml-list-terminals' Will list all elements that can contain data. `sgml-list-occur-in-elements' Will list all element types and where it can occur. `sgml-list-content-elements' Will list all element types and the element types that can occur in its content.  File: psgml.info, Node: Customizing DTD, Prev: Information from the DTD, Up: Managing the DTD Customizing DTD =============== PSGML can be customized by process instructions starting with "PSGML" in the DTD. Generally this associates some information with element types. E.g., if `sgml-fill-element' should skip the element type or if the content should be displayed with a special font. The general syntax is `' Note: in XML the ending delimiter is `?>', in SGML mode a trailing `?' will be ignored if preceded by a space. Where GI is the element type, PROP is a propery described below, and VALUE is the value for the property. The first part from `PSGML' to GI is read with current setting for `NAMECASE GENERAL', i.e., case insensitive for normal SGML but case sensitive in XML mode. The PROP and VALUE is read using Emacs Lisp conventions, i.e. case sensitive and VALUE is a lisp expression (not evaluated). Example Properties `nofill' Set to either `t' or `nil'. If `t' the elements of this type will be ignored when filling with `sgml-fill-element'. Note that Emacs normal filling functions will not honor this. `font' Set to the name of an Emacs face. Should be a face that exists in Emacs. E.g. `bold', `italic', `fixed-pitch'. The content of elements of this type will be displayed in that face. `attnames' Set to a list of attribute names. E.g., `attnames=("ID" "CLASS" "ONCLICK")'. This controls the attributes included when using the `sgml-edit-attributes' (`C-c C-a') command. Only the attributes in the list will be included and in that order. You can also end the list with a `*' to include all attributes, but the listed attributes will be on the top. E.g., `attnames=("ID" "CLASS" "ONCLICK" *)'. Note: that the attribute names need to be written with the correct case and in string quotes. `structure' Control if element is included in `sgml-show-structure' (`C-c C-s'). If set to `t', the element is included and if set to `ignore' it will not be included. *Note Showing information: Information. `help-text' Should be a string. The string will be displayed by `sgml-show-current-element-type' (`C-c C-t').  File: psgml.info, Node: Edit, Next: Display, Prev: Managing the DTD, Up: Top Commands for editing ******************** * Menu: * Insert:: Inserting Markup * Complete:: Markup completion * Information:: Showing information * Indent:: Indentation according to structure * Move:: Move in the element structure * Attributes:: Editing attributes * Change and delete:: Changing and deleting markup * Translating characters and entities::  File: psgml.info, Node: Insert, Next: Complete, Prev: Edit, Up: Edit Inserting Markup ================ The commands that insert start-tags works only if the document has an associated DTD. Keyboard commands for inserting: `C-c <' Will ask, for the tag to insert, in the mini-buffer with completion on the tags that are valid at point (`sgml-insert-tag'). If `sgml-auto-insert-required-elements' is non-nil, tags for elements required between the inserted tags will also be inserted. The list of valid tags, computed for a position in the buffer, will contain: 1. The end-tag for the current element, if it can be ended at the position. Furthermore it will contain end-tags for enclosing elements if the necessary omissible end-tag declarations have been made in the DTD. 2. The start-tags of all elements that could occur after point. If `sgml-omittag-transparent' is nil, the above will be limited to the elements that can occur within the current element. `C-c C-e' Insert start and end-tags for an element (`sgml-insert-element'). The name of the element is read from the mini-buffer with completion on valid elements. If `sgml-insert-end-tag-on-new-line' is non-nil or the element has element content, the end-tag will be inserted on a new line after the start-tag. If `sgml-omittag-transparent' is nil, the list of valid elements will only contain the elements that can be in the content of the current element. Required elements in the content will be automatically inserted if the option `sgml-auto-insert-required-elements' is non-nil. When the content model demands an element but there is more than one to choose from, a comment can be inserted with the available choices if the option `sgml-insert-missing-element-comment' is non-nil. `C-c C-i' Inserts a new element in the current element where it is legal. Prompts for element name with completion. The completion list contains all elements that could be added to the current element somewhere, without making the content invalid. This assumes that the content is valid to begin with. Currently this list only has regular elements, not inclusions. The new element will be inserted as late as possible in the current element (unless prefix argument is given, then as early as possible.) `C-c C-r' Makes the region into a new element (`sgml-tag-region'). Reads element name from mini-buffer with completion as for `C-c C-e'. `C-c /' Inserts an end-tag for the current element (`sgml-insert-end-tag'). `C-c RET' Split the current element at point. If repeated, the containing element will be split before the beginning of then current element. Typical use is to start a new paragraph element when inside a paragraph. `C-c +' Read attribute name and value from mini-buffer and insert attribute specification (`sgml-insert-attribute'). If point is immediately after a start-tag, this command operates on that start-tag. Otherwise the command will operate on the element after point. The attribute name will be read with completion. If the attribute has a token list as declared value the attribute value will also be read with completion. The prompt for attribute value will typically look like: Value for ATTRIBUTE (TYPE Default: CURRENT VALUE): `C-c C-u C-m' Give keyboard access to the customized part of the Markup menu. Emacs will prompt for the markup to insert using the menu line as selector. (See SGML-CUSTOM-MARKUP below.) Menu bar: `Markup' Selecting from this menu will insert markup. The menu contains sub menus with tags and with entities, some other markup and a user defined section. Sub menus: `Insert element' Pops up a menu of valid elements and insert start and end-tags for the selected element. Selections from the menu works like the `C-c C-e' command. `Insert start-tag' Pops up a menu of valid start-tags and insert the selected tag. The menu has the same start-tags as the completion list for `C-c <'. `Insert end-tag' Pops up a menu of valid end-tags and insert the selected tag. `Tag region' Pops up a menu of valid elements and tag the region with the selection. Selections from the menu works like the `C-c C-r' command. `Insert entity' Menu of all general entities defined in the DTD. `Add Element to Element' Pops up a menu of all elements valid somewhere in the current element. The menu contains all elements that could be added to the current element somewhere, without making the content invalid. The new element will be inserted as late as possible in the current element. `Insert attribute' Pops up a menu with all the attributes of an element. The element is either the one which start-tag is immediately before point or the element after point. Selecting from this menu edits the attribute specification list for the element. The menu has a sub menu for every attribute which declared value is a token list. The rest of the attributes are collected in one sub menu. For the token list attributes, selecting a value will insert that attribute-value pair. Selecting some other attribute reads the attribute-value from the mini-buffer and inserts the attribute value pair. A menu is also available directly with a mouse button click in the buffer. In GNU Emacs it is the first mouse button combined with shift (`S-'). In Lucid Emacs it is bound to the third mouse button. The mouse button click will pop-up a menu of valid tags or a menu of attributes if the point is in a start-tag. The attributes menu works as the "Insert attribute" menu from the menu-bar. The tags list is the list of valid tags described above for command `C-c <'. Selection from the tags menu works like the `C-c <' command, with the following exception: You can tag a region, with start and end-tag. There are two ways to indicate the region to mark: 1. Use the normal mouse commands to mark region. For this to work you must either use "transient mark mode" (*note Transient Mark Mode: (emacs)Transient Mark.) or set the option `sgml-tag-region-if-active' to non-nil (don't set this unless you are sure that you want it). 2. Alternatively make a secondary selection, this is done by holding down the meta key and using the mouse buttons. *Note Secondary selection: (emacs)Secondary selection. Some window managers intercept these events, which makes it hard use the secondary selection in Emacs. - User Option: sgml-balanced-tag-edit If non-nil, inserting a start-tag using the context menu will also insert the corresponding end-tag. - User Option: sgml-auto-insert-required-elements If non-nil, automatically inserts required elements in the content of an inserted element. - User Option: sgml-omittag-transparent If non-nil, will show legal tags inside elements with omissible start-tags and legal tags beyond omissible end-tags. - User Option: sgml-tag-region-if-active If non-nil, the `Insert tags' menu will tag a region if the region is considered active by emacs. If nil, region must be active and `transient-mark-mode' must be on for the region to be tagged. - User Option: sgml-custom-markup Menu entries to be added to the Markup menu. The value should be a list of lists of two strings. The first string is the menu line and the second string is the text inserted when the menu item is selected. The second string can contain a `\r' where the cursor should be left. Also, if a selection is made according to the same rules as for the `S-mouse-1' menu, the selection is replaced with the second string and `\r' is replaced with the selection. Example: (("Version1" "") ("New page" "")) - User Option: sgml-insert-missing-element-comment If non-nil, and sgml-auto-insert-required-elements also true, `sgml-insert-element' will insert a comment if there is an element required but there is more than one to choose from. - User Option: sgml-insert-end-tag-on-new-line If non-nil, `sgml-insert-element' will put the end-tag on a new line after the start-tag. Useful on slow terminals if you find the end-tag after the cursor irritating.  File: psgml.info, Node: Complete, Next: Information, Prev: Insert, Up: Edit Markup completion ================= If you are typing in markup directly, `M-TAB' will help you by completing a tag name, an entity name or a markup declaration name. If you type `M-TAB' after a plain word, `ispell-complete-word' will be invoked instead. If you have typed (-!- marks the position of point) &At-!- and type `M-TAB' (assuming you use the `ISOLat1' entity set) you get: Ã-!-  File: psgml.info, Node: Information, Next: Indent, Prev: Complete, Up: Edit Showing information =================== Commands for showing information obtained by parsing the buffer. `C-c C-c' Shows in the message area: context at point, if in a tag or in mixed content and the open elements (`sgml-show-context'). The form of the string is controled by the user option `sgml-show-context-function'. `C-c C-w' Shows what element the character after point (under the cursor) belongs to; also shows context of element (`sgml-what-element'). `C-c C-t' Show information about the current element type and the valid element following the point. `C-c C-s' Show the major element structure in a separate buffer (`*Document structure*'). That buffer can be used to navigate the document, like an Occur buffer (*note Other Search-and-Loop Commands: (emacs)Other Repeating Search.). The structure shows container elements and the text of the first child element (if it is not a container). This works best for document types which uses containers and title structure (e.g. `
Heder ..
'). PSGML uses a heuristic rule to identify container elements: it should have element content and be non empty. You can configure exceptions from this rule using a process instruction in the DTD (*note Customizing DTD::). To include an element type EL1 that would otherwise be excluded: To exclude an element type EL2 that would otherwise be included: List contextually valid tags (`sgml-list-valid-tags'). Displays information about current element, all valid end-tags, valid start-tags in current element, and start-tags valid at this point but in other elements together with the tags omitted. - User Option: sgml-show-context-function The value shold be a function that generates a string from an element and the current markup type (if any). There are two ready made functions for this. The function `sgml-show-context-standard', the default, generates a string like `#PCDATA in para in chapter in book'. The function `sgml-show-context-backslash' generates a string like `book\chapter\para'.  File: psgml.info, Node: Indent, Next: Move, Prev: Information, Up: Edit Indentation according to structure ================================== You can indent a line according to the depth of element nesting at the beginning of the line. To indent the current line use `'. You can also use `' (`newline-and-indent') to start a new line with correct indentation. - User Option: sgml-indent-step How much to increment indent for every element level. If nil, no indentation. If this is nil, `' will insert a tab instead of indenting. - User Option: sgml-indent-data If non-nil, indent in data/mixed context also.  File: psgml.info, Node: Move, Next: Attributes, Prev: Indent, Up: Edit Move in the element structure ============================= These commands move in the element structure. The commands uses knowledge of SGML syntax, and if available the specific DTD. `C-M-a' Move to the (content) beginning of the current element (`sgml-beginning-of-element'). `C-M-e' Move to the (content) end of the current element (`sgml-end-of-element'). `C-M-f' Move forward by element (`sgml-forward-element'). `C-M-b' Move backward by element (`sgml-backward-element'). `C-M-u' Move up to before current element (`sgml-backward-up-element'). `C-c C-n' Move up to after current element (`sgml-up-element'). `C-M-d' Move down to the (content) beginning of the next element (`sgml-down-element'). `C-c C-d' Move to the next place where data is allowed (`sgml-next-data-field'). You can also move to the next place where there is some structural error with `C-c C-o' (*note Validate::).  File: psgml.info, Node: Attributes, Next: Change and delete, Prev: Move, Up: Edit Editing attributes ================== If you want to change the attributes of a start-tag you can simply edit them directly in the buffer. Or you can place the cursor at or after the start-tag and use the `sgml-edit-attributes' command, available from the `SGML'-menu or on `C-c C-a'. This will create a new Emacs window with all possible attributes listed in the form ATTRIBUTE NAME = CURRENT VALUE. The CURRENT VALUE may be shown as `#DEFAULT' if the attribute has not been given a value in the start-tag. The list also contains the attributes declaration as a comment. Note also that the CURRENT VALUE is show without eventual quotes. It is now possible to edit the attribute values. You can move to the next attribute with `'. If you want to let an attribute have its default value use `C-c C-d', this will insert a `#DEFAULT' in the value field. If Emacs is running in an X window, the `#DEFAULT' will be underlined to distinguish it from normal values. Finish the editing with `C-c C-c'; this will replace the attribute values in the main buffer with those edited. Note that values will be quoted as needed. If you want to abort the editing, you can remove the window with `C-x 0' or if you want it neat, kill the buffer and remove the window. Some other keys are: `C-a' Go to the beginning of the value field (`sgml-edit-attrib-field-start'). `C-e' Go to the end of the value field (`sgml-edit-attrib-field-end'). `C-c C-k' Clear the value field (`sgml-edit-attrib-clear'). `C-c C-d' Set the value field to `#DEFAULT' (`sgml-edit-attrib-default'). This is a special value that will make the attribute be implied.  File: psgml.info, Node: Change and delete, Next: Translating characters and entities, Prev: Attributes, Up: Edit Changing and deleting markup ============================ `C-c =' Change the name of the current element (`sgml-change-element-name'). Tries to translate attribute specifications. An attribute will be translated to an attribute with the same name. If the new element has no attribute with the same name, the attribute will be ignored. If there is an attribute with the same name but different declared content, a warning is given. ID attributes are handled specially, an attribute with declared value ID will always be translated to the attribute with declared value ID. `C-c C-k' Kill next tag, markup declaration or process instruction (`sgml-kill-markup'). `C-M-k' Kill the element following the cursor (`sgml-kill-element'). `C-c -' Remove tags from current element (`sgml-untag-element'). `C-c #' Convert character after point to a character reference (`sgml-make-character-reference'). If called with a numeric argument, convert a character reference back to a normal character. `C-c C-q' Fills an element as a paragraph (`sgml-fill-element'). This is a substitute for the normal `fill-paragraph'. The command uses heuristics to decide what should be a paragraph. 1. If point is in an element content, recursively fill the sub-elements. 2. Find the biggest element with mixed content containing point. 3. If the above element is mixed but contains elements with pure element content then fill what is between the pure elements as paragraphs and fill the pure elements recursively. `M-x sgml-expand-all-shortrefs' Short references to text entities are expanded to the replacement text of the entity other short references are expanded into general entity references. If argument, TO-ENTITY, is non-`nil', or if called interactive with numeric prefix argument, all short references are replaced by generally entity references. `M-x sgml-normalize' Normalize the document in the buffer. This will 1. expand short references, 2. insert missing tags, 3. replace minimized tags with full tags, 4. fix attribute specification lists according to options set. There is one argument, TO-ENTITY, with the same meaning as for `sgml-expand-all-shortrefs'. There is one option for the normalize command. With its default value, normalize may actually change the data content of some elements. But only by removing some white-space from the end of elements with omitted end-tags. - User Option: sgml-normalize-trims If non-nil, `sgml-normalize' will trim off white space from end of element when adding end-tag. Default: `t'.  File: psgml.info, Node: Translating characters and entities, Prev: Change and delete, Up: Edit Translating between characters and entity references ==================================================== Set the variable `sgml-display-char-list-filename' to a file that contains mappings between all characters present in the presentation character set, and their "standard replacement text" names, e.g. "å" -> "[aring ]", e.t.c. The default value for this variable is `iso88591.map'. Then use the functions (also in the Modify menu) `sgml-charent-to-display-char' `sgml-display-char-to-charent' to translate between entities and characters.  File: psgml.info, Node: Display, Next: Miscellaneous options, Prev: Edit, Up: Top Appearance of text in the buffer ******************************** * Menu: * Fold:: Folding editing * Hiding markup:: * Highlight:: Highlighting markup  File: psgml.info, Node: Fold, Next: Hiding markup, Prev: Display, Up: Display Folding editing =============== With these commands you can make parts of the text temporarily invisible to make it easier to see the overall structure of your text. When folding a region all the lines but the first will be invisible. The first line of the region will still be visible with an ellipsis at the end. *Note Outline Mode: (emacs)Outline Mode. `C-c C-f C-r' The region between point and mark will be folded (`sgml-fold-region'). `C-c C-f C-e' The region between the start and end of the current element will be folded (`sgml-fold-element'). This command can also fold the SGML declaration or the DOCTYPE declaration. `C-c C-f C-s' Fold all the sub elements of the current element (`sgml-fold-subelement'). `C-c C-s' `C-c C-u C-l' Unfold the current line, assuming it is the first line of a folded region (`sgml-unfold-line'). `C-c C-u C-e' Make all lines in current element visible (`sgml-unfold-element'). `C-c C-u C-a' Make all lines in current buffer visible (`sgml-unfold-all'). `C-c C-f C-x' Unfold current element and then fold the subelements (`sgml-expand-element'). If the current element is folded this expands what is visible.  File: psgml.info, Node: Hiding markup, Next: Highlight, Prev: Fold, Up: Display Hiding markup ============= *** Describe hide-tags  File: psgml.info, Node: Highlight, Prev: Hiding markup, Up: Display Highlighting markup =================== PSGML can highlight the markup giving the markup a different "face" (*note Using Multiple Typefaces: (emacs)Faces.). The highlighting will only be done if the variable `sgml-set-face' is non-`nil'. The default settings make tags bold and comments italic, but this can be modified with the variable `sgml-markup-faces'. When highlighting is on PSGML will parse after every command until the whole buffer has been parsed or user event occurs. To remove the highlighting type `M-x sgml-clear-faces'. - User Option: sgml-set-face If non-nil, psgml will set the face of parsed markup. - User Option: sgml-markup-faces A list of markup to face mappings. Each element looks like `(MARKUP-TYPE . FACE)'. Possible values for MARKUP-TYPE is: `comment' comment declaration `doctype' doctype declaration `end-tag' end-tag `ignored' ignored marked section `ms-start' marked section end, if not ignored `ms-end' marked section start, if not ignored `pi' processing instruction `sgml' SGML declaration `start-tag' start-tag `entity' entity reference `shortref' short reference  File: psgml.info, Node: Miscellaneous options, Next: Bugs, Prev: Display, Up: Top Miscellaneous options ********************* *** describe sgml-save-options - User Option: sgml-ignore-undefined-elements Start-tags for undefined elements will either be ignored, if `sgml-ignore-undefined-elements' is `t', or assumed to be acceptable in the current element and defined with `O O ANY' - User Option: sgml-range-indicator-max-length Maximum number of characters used from the first and last entry of a sub-menu to indicate the range of that menu. This is used for long menus of elements, tags or entities that are split into `sgml-max-menu-size' big sub-menus.  File: psgml.info, Node: Bugs, Next: Index, Prev: Miscellaneous options, Up: Top Bugs **** If you encounter something that you think is a bug, please report it. Try to include a clear description of the undesired behaviour. A test case that exhibits the bug, would also be useful. You can report a bug with the command `M-x sgml-submit-bug-report'. When PSGML needs contextual information it parses the document up to the point. During the parsing, it builds a parse tree. The parse tree is used to initialize the next parse, to avoid having to parse things already parsed. Changes to the buffer is supposed to prune the tree of all outdated information. But if you get strange complaints from the parser, try and back up a bit and use `C-c C-o' (`sgml-next-trouble-spot').  File: psgml.info, Node: Index, Prev: Bugs, Up: Top Index ***** * Menu: * : Indent. * <1>: Indent. * : Attributes. * C-a: Attributes. * C-c #: Change and delete. * C-c +: Insert. * C-c -: Change and delete. * C-c /: Insert. * C-c <: Insert. * C-c =: Change and delete. * C-c C-a: Attributes. * C-c C-c <1>: Attributes. * C-c C-c: Information. * C-c C-d <1>: Attributes. * C-c C-d <2>: Move. * C-c C-d: Attributes. * C-c C-e: Insert. * C-c C-f C-e: Fold. * C-c C-f C-r: Fold. * C-c C-f C-s: Fold. * C-c C-f C-x: Fold. * C-c C-i: Insert. * C-c C-k <1>: Change and delete. * C-c C-k: Attributes. * C-c C-n: Move. * C-c C-o: Validate. * C-c C-q: Change and delete. * C-c C-r: Insert. * C-c C-s <1>: Information. * C-c C-s: Fold. * C-c C-t: Information. * C-c C-u C-a: Fold. * C-c C-u C-d: Inserting a DOCTYPE. * C-c C-u C-e: Fold. * C-c C-u C-l: Fold. * C-c C-u C-m: Insert. * C-c C-v: Validate. * C-c C-w: Information. * C-c RET: Insert. * C-e: Attributes. * C-M-a: Move. * C-M-b: Move. * C-M-d: Move. * C-M-e: Move. * C-M-f: Move. * C-M-k: Change and delete. * C-M-u: Move. * case sensitivity: SGML declaration. * CONCUR: Introduction. * DATATAG: Introduction. * DOCTYPE: Managing the DTD. * DTD <1>: Managing the DTD. * DTD: Information from the DTD. * Element: Information from the DTD. * entity: Information from the DTD. * entity catalog: Entity manager. * external identifier: Entity manager. * invoke: Invoke. * LINK: Introduction. * M-TAB: Complete. * major mode: Invoke. * NAMECASE GENERAL: SGML declaration. * newline-and-indent: Indent. * OMITTAG: SGML declaration. * public identifier: Entity manager. * RANK: Introduction. * S-: Insert. * SGML Declaration: Introduction. * sgml-add-element-to-element: Insert. * sgml-always-quote-attributes: SGML declaration. * sgml-auto-activate-dtd: Managing the DTD. * sgml-auto-insert-required-elements: Insert. * sgml-backward-element: Move. * sgml-backward-up-element: Move. * sgml-balanced-tag-edit: Insert. * sgml-beginning-of-element: Move. * sgml-catalog-files: Entity manager. * sgml-change-element-name: Change and delete. * sgml-charent-to-display-char: Translating characters and entities. * sgml-clear-faces: Highlight. * sgml-complete: Complete. * sgml-custom-dtd: Inserting a DOCTYPE. * sgml-custom-markup: Insert. * sgml-declaration: Validate. * sgml-default-doctype-name: Managing the DTD. * sgml-default-dtd-file: Precompiled DTD Subsets. * sgml-describe-dtd: Information from the DTD. * sgml-describe-element-type: Information from the DTD. * sgml-describe-entity: Information from the DTD. * sgml-display-char-to-charent: Translating characters and entities. * sgml-doctype: Using a Split Document. * sgml-down-element: Move. * sgml-ecat-files: Precompiled DTD Subsets. * sgml-edit-attrib-clear: Attributes. * sgml-edit-attrib-default: Attributes. * sgml-edit-attrib-field-end: Attributes. * sgml-edit-attrib-field-start: Attributes. * sgml-edit-attributes: Attributes. * sgml-end-of-element: Move. * sgml-expand-all-shortrefs: Change and delete. * sgml-expand-element: Fold. * sgml-fill-element: Change and delete. * sgml-fold-element: Fold. * sgml-fold-region: Fold. * sgml-fold-subelement: Fold. * sgml-forward-element: Move. * sgml-ignore-undefined-elements: Miscellaneous options. * sgml-indent-data: Indent. * sgml-indent-or-tab: Indent. * sgml-indent-step: Indent. * sgml-insert-attribute: Insert. * sgml-insert-element: Insert. * sgml-insert-end-tag: Insert. * sgml-insert-end-tag-on-new-line: Insert. * sgml-insert-missing-element-comment: Insert. * sgml-insert-tag: Insert. * sgml-kill-element: Change and delete. * sgml-kill-markup: Change and delete. * sgml-list-attributes: Information from the DTD. * sgml-list-content-elements: Information from the DTD. * sgml-list-elements: Information from the DTD. * sgml-list-occur-in-elements: Information from the DTD. * sgml-list-terminals: Information from the DTD. * sgml-list-valid-tags: Information. * sgml-load-dtd: Precompiled DTD Subsets. * sgml-local-catalogs: Entity manager. * sgml-local-ecat-files: Precompiled DTD Subsets. * sgml-make-character-reference: Change and delete. * sgml-markup-faces: Highlight. * sgml-max-menu-size: Miscellaneous options. * sgml-minimize-attributes: SGML declaration. * sgml-mode: Invoke. * sgml-namecase-general: SGML declaration. * sgml-next-data-field: Move. * sgml-next-trouble-spot: Validate. * sgml-normalize: Change and delete. * sgml-normalize-trims: Change and delete. * sgml-offer-save: Validate. * sgml-omittag: SGML declaration. * sgml-omittag-transparent: Insert. * sgml-parent-document: Using a Split Document. * sgml-parse-prolog: Managing the DTD. * sgml-public-map: Entity manager. * sgml-range-indicator-max-length: Miscellaneous options. * sgml-recompile-out-of-date-cdtd: Precompiled DTD Subsets. * sgml-save-dtd: Precompiled DTD Subsets. * sgml-set-face: Highlight. * sgml-shorttag: SGML declaration. * sgml-show-context: Information. * sgml-show-context-function: Information. * sgml-show-current-element-type: Information. * sgml-show-structure: Information. * sgml-split-element: Insert. * sgml-system-identifiers-are-preferred: Entity manager. * sgml-tag-region: Insert. * sgml-tag-region-if-active: Insert. * sgml-unfold-all: Fold. * sgml-unfold-element: Fold. * sgml-unfold-line: Fold. * sgml-untag-element: Change and delete. * sgml-up-element: Move. * sgml-validate: Validate. * sgml-validate-command: Validate. * sgml-validate-files: Validate. * sgml-what-element: Information. * SHORTTAG: SGML declaration. * start up: Invoke. * system identifier: Entity manager.  Tag Table: Node: Top983 Node: Introduction1778 Node: Install4382 Node: Invoke6226 Node: Entity manager7276 Node: Validate12823 Node: SGML declaration15349 Node: Managing the DTD17107 Node: Precompiled DTD Subsets18406 Node: Using a Split Document21596 Node: Inserting a DOCTYPE23152 Node: Information from the DTD24931 Node: Customizing DTD26022 Node: Edit28382 Node: Insert28951 Node: Complete37699 Node: Information38199 Node: Indent40553 Node: Move41215 Node: Attributes42263 Node: Change and delete44052 Node: Translating characters and entities47006 Node: Display47669 Node: Fold47953 Node: Hiding markup49291 Node: Highlight49434 Node: Miscellaneous options50808 Node: Bugs51518 Node: Index52316  End Tag Table ./psgml-1.4.0/psgml.ps0000750000076500000240000060173610212356414012772 0ustar dialout%!PS-Adobe-2.0 %%Creator: dvips(k) 5.86 Copyright 1999 Radical Eye Software %%Title: psgml.dvi %%Pages: 26 %%PageOrder: Ascend %%BoundingBox: 0 0 596 842 %%EndComments %DVIPSWebPage: (www.radicaleye.com) %DVIPSCommandLine: dvips psgml.dvi -o psgml.ps %DVIPSParameters: dpi=600, compressed %DVIPSSource: TeX output 2001.11.08:2358 %%BeginProcSet: texc.pro %! /TeXDict 300 dict def TeXDict begin/N{def}def/B{bind def}N/S{exch}N/X{S N}B/A{dup}B/TR{translate}N/isls false N/vsize 11 72 mul N/hsize 8.5 72 mul N/landplus90{false}def/@rigin{isls{[0 landplus90{1 -1}{-1 1}ifelse 0 0 0]concat}if 72 Resolution div 72 VResolution div neg scale isls{ landplus90{VResolution 72 div vsize mul 0 exch}{Resolution -72 div hsize mul 0}ifelse TR}if Resolution VResolution vsize -72 div 1 add mul TR[ matrix currentmatrix{A A round sub abs 0.00001 lt{round}if}forall round exch round exch]setmatrix}N/@landscape{/isls true N}B/@manualfeed{ statusdict/manualfeed true put}B/@copies{/#copies X}B/FMat[1 0 0 -1 0 0] N/FBB[0 0 0 0]N/nn 0 N/IEn 0 N/ctr 0 N/df-tail{/nn 8 dict N nn begin /FontType 3 N/FontMatrix fntrx N/FontBBox FBB N string/base X array /BitMaps X/BuildChar{CharBuilder}N/Encoding IEn N end A{/foo setfont}2 array copy cvx N load 0 nn put/ctr 0 N[}B/sf 0 N/df{/sf 1 N/fntrx FMat N df-tail}B/dfs{div/sf X/fntrx[sf 0 0 sf neg 0 0]N df-tail}B/E{pop nn A definefont setfont}B/Cw{Cd A length 5 sub get}B/Ch{Cd A length 4 sub get }B/Cx{128 Cd A length 3 sub get sub}B/Cy{Cd A length 2 sub get 127 sub} B/Cdx{Cd A length 1 sub get}B/Ci{Cd A type/stringtype ne{ctr get/ctr ctr 1 add N}if}B/id 0 N/rw 0 N/rc 0 N/gp 0 N/cp 0 N/G 0 N/CharBuilder{save 3 1 roll S A/base get 2 index get S/BitMaps get S get/Cd X pop/ctr 0 N Cdx 0 Cx Cy Ch sub Cx Cw add Cy setcachedevice Cw Ch true[1 0 0 -1 -.1 Cx sub Cy .1 sub]/id Ci N/rw Cw 7 add 8 idiv string N/rc 0 N/gp 0 N/cp 0 N{ rc 0 ne{rc 1 sub/rc X rw}{G}ifelse}imagemask restore}B/G{{id gp get/gp gp 1 add N A 18 mod S 18 idiv pl S get exec}loop}B/adv{cp add/cp X}B /chg{rw cp id gp 4 index getinterval putinterval A gp add/gp X adv}B/nd{ /cp 0 N rw exit}B/lsh{rw cp 2 copy get A 0 eq{pop 1}{A 255 eq{pop 254}{ A A add 255 and S 1 and or}ifelse}ifelse put 1 adv}B/rsh{rw cp 2 copy get A 0 eq{pop 128}{A 255 eq{pop 127}{A 2 idiv S 128 and or}ifelse} ifelse put 1 adv}B/clr{rw cp 2 index string putinterval adv}B/set{rw cp fillstr 0 4 index getinterval putinterval adv}B/fillstr 18 string 0 1 17 {2 copy 255 put pop}for N/pl[{adv 1 chg}{adv 1 chg nd}{1 add chg}{1 add chg nd}{adv lsh}{adv lsh nd}{adv rsh}{adv rsh nd}{1 add adv}{/rc X nd}{ 1 add set}{1 add clr}{adv 2 chg}{adv 2 chg nd}{pop nd}]A{bind pop} forall N/D{/cc X A type/stringtype ne{]}if nn/base get cc ctr put nn /BitMaps get S ctr S sf 1 ne{A A length 1 sub A 2 index S get sf div put }if put/ctr ctr 1 add N}B/I{cc 1 add D}B/bop{userdict/bop-hook known{ bop-hook}if/SI save N @rigin 0 0 moveto/V matrix currentmatrix A 1 get A mul exch 0 get A mul add .99 lt{/QV}{/RV}ifelse load def pop pop}N/eop{ SI restore userdict/eop-hook known{eop-hook}if showpage}N/@start{ userdict/start-hook known{start-hook}if pop/VResolution X/Resolution X 1000 div/DVImag X/IEn 256 array N 2 string 0 1 255{IEn S A 360 add 36 4 index cvrs cvn put}for pop 65781.76 div/vsize X 65781.76 div/hsize X}N /p{show}N/RMat[1 0 0 -1 0 0]N/BDot 260 string N/Rx 0 N/Ry 0 N/V{}B/RV/v{ /Ry X/Rx X V}B statusdict begin/product where{pop false[(Display)(NeXT) (LaserWriter 16/600)]{A length product length le{A length product exch 0 exch getinterval eq{pop true exit}if}{pop}ifelse}forall}{false}ifelse end{{gsave TR -.1 .1 TR 1 1 scale Rx Ry false RMat{BDot}imagemask grestore}}{{gsave TR -.1 .1 TR Rx Ry scale 1 1 false RMat{BDot} imagemask grestore}}ifelse B/QV{gsave newpath transform round exch round exch itransform moveto Rx 0 rlineto 0 Ry neg rlineto Rx neg 0 rlineto fill grestore}B/a{moveto}B/delta 0 N/tail{A/delta X 0 rmoveto}B/M{S p delta add tail}B/b{S p tail}B/c{-4 M}B/d{-3 M}B/e{-2 M}B/f{-1 M}B/g{0 M} B/h{1 M}B/i{2 M}B/j{3 M}B/k{4 M}B/w{0 rmoveto}B/l{p -4 w}B/m{p -3 w}B/n{ p -2 w}B/o{p -1 w}B/q{p 1 w}B/r{p 2 w}B/s{p 3 w}B/t{p 4 w}B/x{0 S rmoveto}B/y{3 2 roll p a}B/bos{/SS save N}B/eos{SS restore}B end %%EndProcSet TeXDict begin 39158280 55380996 1000 600 600 (psgml.dvi) @start %DVIPSBitmapFont: Fa cmbxti10 14.4 1 /Fa 1 47 df<13FCEA03FF000F13804813C05AA25AA2B5FCA31480A214006C5A6C5A6C5A EA0FE0121271912B>46 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fb cmr9 9 11 /Fb 11 121 df<14C01301EB0380EB0F00130E5B133C5B5BA2485A485AA212075B120F90 C7FC5AA2121E123EA3123C127CA55AB0127CA5123C123EA3121E121FA27E7F12077F1203 A26C7E6C7EA213787F131C7F130FEB0380EB01C01300124A79B71E>40 D<12C07E1270123C121C7E120F6C7E6C7EA26C7E6C7EA27F1378137C133C133EA2131E13 1FA37F1480A5EB07C0B0EB0F80A514005BA3131E133EA2133C137C137813F85BA2485A48 5AA2485A48C7FC120E5A123C12705A5A124A7CB71E>I73 D<153FEC0FFFA3EC007F81AEEB07F0EB3FFCEBFC0F3901 F003BF3907E001FF48487E48487F8148C7FCA25A127E12FEAA127E127FA27E6C6C5BA26C 6C5B6C6C4813803A03F007BFFC3900F81E3FEB3FFCD90FE0130026357DB32B>100 DI105 D<3903F01FC000FFEB7FF09038F1E0FC9038F3807C3907F7007EEA03FE497FA25BA25BB3 486CEB7F80B538C7FFFCA326217EA02B>110 DI115 D<1330A51370A313F0A21201A212031207381FFFFEB5FCA23803F000AF1403A814073801 F806A23800FC0EEB7E1CEB1FF8EB07E0182F7FAD1E>I120 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fc cmmi10 10.95 1 /Fc 1 64 df<1403A44A7EA84A7EA400F0163CD8FF80EC07FCD83FFE9038C1FFF0000FB7 12C000031600C615FC011F14E001071480010149C7FC9038007FF8A24A7EA2497FA29038 03FCFF4A7E49486C7EECE01F49486C7EEC800749486C7E013E6D7E013C13004914780170 14384980014014082E2C81AC2D>63 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fd cmbx10 12 28 /Fd 28 123 df<923B1FFF8001FFC00203B5D8F01F13F0021FDAF87F13FC027F91B67E90 2701FFF803ECC3FF49D9C001EBFE0790270FFE000349481380494815F84A4913F0494815 E0495AA201FF4C6C13004A6D6E5A735A70EC00707092C7FCAABA12FCA5C601E0C701E0C8 FCB3B0007F9026FFC07FEBFFF0A549467EC543>11 DI45 D<903801FFF8011FEBFF 80017F14E090B612F8489038807FFC3A03FE001FFE486CEB07FF486E7F0280806F7FA36F 7F6C90C7FCA26C5AEA00F890C8FCA2150F021FB5FC0103B6FC131F017F13C03901FFFC00 4813E0000F13804890C7FC485A5B485AA2485AA45DA26C6C5BED07BF6C6C010F13FC6CB4 90391F3FFFE06C9026C0FE1F13F06CEBFFFC6CECF007C66CD9E00113E0010790C9FC342F 7DAD38>97 DIIII<913801FFC0021F13F0027F13FC49B57E49EBC3FF903807FE074948481380 EB1FF8EB3FF0EB7FE0A349486C13006F5A6F5AED007093C7FCAAB612FCA5C601E0C8FCB3 B0007FEBFFE0A529467DC523>I<902601FFF013FF010FD9FE031380013FD9FF8F13C090 B812E048D9C07F13BF489039001FF83F4848EB0FFC4848EB07FE001F9238FF1FC0496DEB 0F8094C7FC003F82A7001F93C7FCA26D5B000F5D6C6C495A6C6C495A6C9038C07FF04890 B55A1680D8078F49C8FC018113F0D80F80CAFCA47F7F13F890B612E016FEEEFFC06C16F0 836C826C82831207481780D81FF8C77ED83FE014074848020113C000FF8149157FA56D15 FF007F17806D5C6C6C4A1300D81FFCEC0FFE6CB4EC3FFC6C9039E001FFF8000190B612E0 6C6C1580010F02FCC7FCD9007F138033427DAC39>II<13FCEA03FF4813804813C0A248 13E0A66C13C0A26C13806C1300EA00FC90C7FCA9EB7FC0EA7FFFA512037EB3AFB6FCA518 467CC520>I107 DI<90287FC003 FF80EB07FFB5011F01F0013F13E0037F6D90B57E92B56C4880913DC1FC1FFE03F83FFC91 3DC3E00FFF07C01FFE00039026C7C00790398F800FFF6CD9CF00EC9E0002DE6D01BC7F02 FC03F81580A24A5D4A5DA34A5DB3A7B600C1B60083B6FCA5582D7CAC5F>I<903A7FC003 FF80B5011F13F0037F7F92B57E9139C1FC1FFE9139C3E00FFF00039026C7C0077F6CEBCF 0002DE7F02FC81A25C5CA35CB3A7B600C1B61280A5392D7CAC40>II<90397FC01FFCB590B512C002C314F0 02CF14FC9139DFF03FFF9126FF800F138000039026FE000313C06C496D13E002F015F04A 7FEF7FF8A218FC173F18FEA3EF1FFFAB18FE173FA318FC177F18F817FF6E15F06E4913E0 6E4913C06E4913806E6C4813009238E07FFE02EFB55A02E314F002E01480DB1FF8C7FC92 C9FCADB612C0A538407DAC40>II<90397F803FC0B5EBFFF0028313F8028713FC91388FE7FE91389F8FFF0003EB9E0F6C 13BCA214F8A29138F007FEED03FC9138E001F892C7FCA35CB3A5B612C0A5282D7DAC2F> I<90391FFE078090B512DF000314FF5A380FF803381FE000D83F80133F127F90C7121FA2 48140FA27FA201E090C7FC13F8EBFFC06C13FEECFFC06C14F015FC6C806C806C15800001 15C07E011F14E01301D9000713F014000078147F00F8143F151F6C140FA37E6C15E0151F 6D14C06D133F01F0EB7F809039FC03FF0090B55A00FC5CD8F83F13F0D8F00790C7FC242F 7CAD2D>IIIII<007F B590387FFFF8A5C601F890380FF8006D6CEB07E0013F4A5A6D6C131F6E495A6D6D48C7FC 6DEBC0FE6DEBC1FC6DEBE1F8EDF3F06DEBFFE0806E5B6E5B93C8FC6E7F6E7F6E7FA24A7F 4A7F4A7FEDBFFEEC3F1F91387E0FFF02FE8049486C7F49486C7F49487E49486C7F4A8049 486D7E49C76C7ED9FF80131FB500F090B512FEA5372C7EAB3C>I<007FB5398007FFFCA5 000101F0C7EA7F806CEE3E006E147E017F157C8017FC013F5D6E1301011F5D6E13036D5D ED80076D5DEDC00F6D5D15E0161F6D92C7FC6F5A6D143EEDF87E027F137CEDFCFC023F5B 15FF6E5BA36E5BA26E5BA26E5BA26E90C8FCA26E5AA2157CA215FC5D1401000F5C383FC0 03D87FE05B1407D8FFF05B140F5D141F4AC9FC387FE07E495A383F87F8EBFFF06C5B0007 1380D801FCCAFC36407EAB3C>I<001FB7128017C0A39026FE001F138001F05B49491300 495C49495A48485A4A5B5E4A5B003E5B4A5B5E4A90C7FC5CC7485A5D495B5B495B5D4990 38C007C05B49138015004948130F01FF1580485B5C4849131F5A485B4A133F4849137F48 15FF48EB000349011F1300B8FCA37E2A2C7DAB33>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fe cmti10 10.95 24 /Fe 24 122 df<933807FF80043F13E09338FE00F8DB01F0133EDB07E0130E4B48131F4C 137F031F14FF4BC7FCA218FE157E1878180015FE5DA31401A25DA414030103B712F0A218 E0903A0003F000070207140F4B14C0A3171F020F15805DA2173F1800141F5D5F177EA214 3F92C712FE5FA34A1301027EECF81CA3160302FEECF03C4A1538A21878187013014A0101 13F018E0933800F1C0EF7F804948EC1F0094C7FCA35C1307A2001E5B127F130F00FF5BA2 49CAFC12FEEAF81EEA703CEA7878EA1FF0EA07C0385383BF33>12 D<120FEA3FC0127FA212FFA31380EA7F00123C0A0A77891C>46 D<9339FF8001C0030F13 E0033F9038F803809239FF807E07913A03FC001F0FDA0FF0EB071FDA1FC0ECBF00DA7F80 6DB4FC4AC77E495AD903F86E5A495A130F4948157E4948157C495A13FF91C9FC48481678 12035B1207491670120FA2485A95C7FC485AA3127F5BA312FF5BA30303B512FC90C7FCA2 DB000190C7FCA25FA216035FA316076C5E7FA2003F150F6D5D121F6D141F000F153F6C6C 4A5A6C6C14F76C6CEB01E36CB4EB07C1903A7FC03F81C090391FFFFE00010701F890C8FC 010013803A4272BF46>71 D<49B612C0A25FD9000390C8FC5D5DA314075DA3140F5DA314 1F5DA3143F5DA3147F5DA314FF92C9FCA35B5CA313035C18C0EF01E0010716C05C170318 80130F4A140718005F131F4A141EA2173E013F5D4A14FC1601017F4A5A16074A131F01FF ECFFF0B8FCA25F333E7BBD39>76 D<49B5933807FFFC496062D90003F0FC00505ADBBF80 5E1A771AEF1407033F923801CFE0A2F1039F020FEE071F020E606F6C140E1A3F021E161C 021C04385BA2F1707F143C023804E090C7FCF001C0629126780FE0495A02705FF00700F0 0E0114F002E0031C5BA2F03803010116704A6C6C5D18E019070103ED01C00280DA03805B A2943807000F13070200020E5C5FDB03F8141F495D010E4B5CA24D133F131E011CDAF9C0 5CEEFB80197F013C6DB4C7FC013895C8FC5E01784A5C13F8486C4A5CD807FE4C7EB500F0 4948B512FE16E01500563E7BBD52>I<92391FE00380ED7FFC913A01FFFE0700913907F0 1F8F91390FC007DF4AC66CB4FC023E6D5A4A130014FC495A4948147CA2495AA2010F1578 5CA3011F1570A46E91C7FCA2808014FE90380FFFE015FC6DEBFF8016E06D806D806D6C7F 141F02037FEC003FED07FF1501A281A282A212075A167E120EA2001E15FE5EA25E003E14 015E003F14034B5A486C5C150F6D495A6D49C8FCD8F9F0137C39F8FE01F839F03FFFF0D8 E00F13C026C001FEC9FC314279BF33>83 D<91B690383FFFFC605E020101E0010F13006E 49EB07F84C6D5A19C06F6C495A96C7FC033F140E705B183C031F5C705B4D5A030F5C7048 5A4DC8FC0307130EEEFC1E5F03035BEEFE705F6F6C5A5FA26F90C9FC83A2707EA216FF4B 7F5DED079FEE1FF0150EED1C0F03387F1578EDF007DA01E07F15C09138038003DA07007F 140E021E13014A805C02707F4A81495A4948147F01078249C8FC013F6F7E496C147F2603 FFC049487EB500F8011FEBFFE0A261463E7CBD44>88 D<147E49B47E903907C1C3809039 1F80EFC090383F00FF017E137F4914804848133F485AA248481400120F5B001F5C157E48 5AA215FE007F5C90C7FCA21401485C5AA21403EDF0385AA21407EDE078020F1370127C02 1F13F0007E013F13E0003E137FECF3E1261F01E313C03A0F8781E3803A03FF00FF00D800 FC133E252977A72E>97 DIIII<1478EB01FCA21303A314F8EB00E01400AD137C48B4FC38 038F80EA0707000E13C0121E121CEA3C0F1238A2EA781F00701380A2EAF03F140012005B 137E13FE5BA212015BA212035B1438120713E0000F1378EBC070A214F0EB80E0A2EB81C0 1383148038078700EA03FEEA00F8163E79BC1C>105 D108 DIII<90 3903E001F890390FF807FE903A1E7C1E0F80903A1C3E3C07C0013C137801389038E003E0 EB783F017001C013F0ED80019038F07F0001E015F8147E1603000113FEA2C75AA2010114 0717F05CA20103140F17E05CA20107EC1FC0A24A1480163F010F15005E167E5E131F4B5A 6E485A4B5A90393FB80F80DA9C1FC7FCEC0FFCEC03E049C9FCA2137EA213FEA25BA21201 A25BA21203A2387FFFE0B5FCA22D3A80A72E>I114 DI< EB01C0EB03F01307A25CA2130FA25CA2131FA25CA2133FA291C7FCA2007FB51280B6FC15 00D8007EC7FC13FEA25BA21201A25BA21203A25BA21207A25BA2120FA25BA2121F141C13 80A2003F133C1438EB0078147014F05C495AEA1F03495A6C48C7FCEA07FCEA01F0193A78 B81E>I<137C48B4141C26038F80137EEA0707000E7F001E15FE121CD83C0F5C12381501 EA781F007001805BA2D8F03F1303140000005D5B017E1307A201FE5C5B150F1201495CA2 151F0003EDC1C0491481A2153F1683EE0380A2ED7F07000102FF13005C01F8EBDF0F0000 9038079F0E90397C0F0F1C90391FFC07F8903907F001F02A2979A731>I<903903F001F8 90390FFC07FE90393C1E0E0F9026780F1C138001F0EBB83FD801E013F89039C007F07FEA 0380000714E0D9000F140048151C000E4AC7FCA2001E131FA2C75BA2143F92C8FCA35C14 7EA314FE4A131CA30101143C001E1538003F491378D87F811470018314F000FF5D903907 7801C039FE0F7C033A7C0E3C078027783C1E1EC7FC391FF80FFC3907E003F029297CA72A >120 D<137C48B4143826038F8013FCEA0707000E7F001E1401001C15F8EA3C0F123815 03D8781F14F000701380A2D8F03F1307020013E012005B017E130F16C013FE5B151F1201 491480A2153F000315005BA25D157EA315FE5D00011301EBF8030000130790387C1FF8EB 3FF9EB07E1EB00035DA21407000E5CEA3F80007F495AA24A5AD8FF0090C7FC143E007C13 7E00705B387801F0383803E0381E0FC06CB4C8FCEA03F8263B79A72C>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Ff cmr8 8 15 /Ff 15 118 df45 D<130C133C137CEA03FC12FFEAFC7C1200B3 B113FE387FFFFEA2172C7AAB23>49 D<4A7E4A7EA34A7EA24A7EA3EC1BF81419A2EC30FC A2EC70FEEC607EA24A7EA349486C7EA2010380EC000FA201066D7EA3496D7EA2011FB57E A29038180001496D7EA349147EA201E0147F4980A20001ED1F801203000716C0D80FF0EC 3FE0D8FFFC0103B5FCA2302F7EAE35>65 DI68 DII76 D82 D<007FB712F8A29039000FC003007C15000070 1638A200601618A200E0161CA248160CA5C71500B3A94A7E011FB512E0A22E2D7EAC33> 84 D101 D<2607C07FEB07F03BFFC3FFC03FFC 903AC783F0783F3C0FCE01F8E01F803B07DC00F9C00F01F8D9FF8013C04990387F000749 137EA249137CB2486C01FEEB0FE03CFFFE0FFFE0FFFEA2371E7E9D3C>109 D111 D<3801FE183807FFB8381E01F8EA3C00481378 481338A21418A27E7EB41300EA7FF06CB4FC6C13C06C13F0000113F838001FFC130138C0 007E143EA26C131EA27EA26C133CA26C137838FF01F038E3FFC000C0130017207E9E1C> 115 D117 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fg cmsy9 9 2 /Fg 2 106 df104 D<126012F07EA21278127CA27EA2 121E121FA26C7EA212077FA26C7EA212017FA26C7EA21378137CA27FA2131E131FA2EB0F 80A2130714C0A41480130FA2EB1F00A2131E133EA25BA2137813F8A2485AA25B1203A248 5AA25B120FA248C7FCA2121E123EA25AA2127812F8A25A1260124A7CB71E>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fh cmsltt10 10.95 38 /Fh 38 123 df<021E131E023F133F03801380A2027F137FA203001300A24A5BA24A5BA2 01011301A202FC5B0007B712E04816F05AA37E6C16E03B000FE00FE000A2011F131FA202 C05BA2013F133FA202805BA2017F137FA2020090C7FC007FB612FE82B81280A36C16005E 2703F803F8C7FC00071307A201F05BA3000F130FA201E05BA401C05B6C486C5A2C387AB7 30>35 D<007FB612E0B712F016F8A316F06C15E02507769E30>45 D<173C173E177F17FFA2EE01FE160317FCEE07F8160F17F0EE1FE0A2EE3FC0167F1780EE FF005D5E4B5A15075E4B5AA24B5A153F5E4B5A15FF93C7FC4A5A14035D4A5AA24A5A141F 5D4A5A147F5D4AC8FCA2495A13035C495A130F5C495A133F5C495AA249C9FC5A5B485A12 075B485A121F5B485AA2485A12FF90CAFC5A127E123C30477CBE30>47 DII<000FB712C04816E017F0A317E06C 16C0CBFCA7003FB7FC481680B8FCA37E6C16002C157AA530>61 D65 D<013FB512F84914FF17C017E017F07F903A03F8001FF81607EE03FCA2160113075CA4EE 03F8130F4A130717F0EE0FE0161FEE7FC0011F903801FF8091B5EAFE005E16F016FC8249 ECFF80913880007FEE3FC0EE1FE0160FA2017F15F091C71207A549EC0FE05BA2EE1FC016 3FEE7F80000115FF49491300ED07FE003FB65A485DB75A5E6C15806C02FCC7FC2E387EB7 30>I<913903FC01E091391FFF81F0027F13E391B512F7010314FF5B49130790261FF801 13E049487ED97FC0137F495A91C7123F485A484815C0A2485A5B120F5B001FED1F804915 00003F92C7FC5BA3127F90CAFCA45A5AA716F86C4A7EA26C14035EA26D1307003F5D6D13 0F001F4A5A6D133F6C6C495A6D495A2607FF0790C7FC6CEBFFFE6C5C6C5C6D13E0011F13 80D907FCC8FC2C3A78B830>I<013FB7FC49168090B812C0A27F7FD903F8C7EA3F80A417 7F13074A150083171E94C7FCA2130F5CED01E04B7E821507131F91B55AA55B9138800FE0 A46F5A017F90C9FC91CAFCA417F0494A7E491403A416071201495DA2003FB7FC5AB8FCA2 6C5E6C5E32387EB730>69 D77 D<017FB57E90B612F016FC82826D1580902607F00113C09238007FE0163F161FEE0FF013 0F4A1307A5011FEC0FE05CEE1FC0163FEE7F8016FF013F010313009138800FFE91B55A5E 16E05E4980829138001FF815076F7E15015B5BA500011403495CA2177817FCEEF9FE0003 16FC4914F1A2267FFF8013FBB500C0EBFFF817F0816F13E06C49EB7FC0C9EA3F002F397E B730>82 D<913907FC01E091393FFF81F091B512E3010314FB4914FF5B90381FFC079026 3FF00113E0ECC0004948137F49C7123F5BA24848EC1FC0A5EE0F806D91C7FCA27F6C7F14 F86DB47E6D13F86D13FF6D14C06D80010080021F7F02017FEC001FED03FE1501A26F7EA3 D80F8080121F6D5C003F5D5BA26D13015E1503486C495A6D495A6D133F9039FF80FFE091 B55A5E00FE92C7FC486C13FC011F13F0D8780113802C3A7BB830>I<001FB712E04816F0 17F8A35A903A001FC007F0A4160F48133F48028013E0007E1507003CED03C0C791C7FCA2 147F92C8FCA55C5CA513015CA513035CA513075CA5130F5CA20007B57E48804880A26C5C 6C5C2D3877B730>I<903803FF80011F13F0017F13FC90B57E4880488149C67F49133F48 486D7E0003140F5BC65A90C77FA25EA2EC3FFF0107B5FC133F90B6FC1203485D48EBE01F 381FFE00EA3FF0D87FC0133F5B48C75B5AA2157FA215FF6C4990C7FCEB8007267FE07F13 FE90B7FC6C16806C14BF6C020F130000039038F803FEC601C0C8FC292A79A830>97 DIIIII<913907F801FE913A3F FF0FFF804A13BF49B712C05B5B90260FFC0FEB1F8090271FF007F8130049486C6CC7FCEC C001EB7F801400A25B5BA315034B5A7F6D495A9138803FE090383FE0FF49B55A90B65A93 C8FC4814FC01F913F09038F87F80000390CAFC5BA27F120190B512FCEDFF8016E04815F8 488148813A1FF00007FFD83FC01300498048C86C7E007E151F12FE5AA2163F94C7FC5E5E 6C4A5AD87F80EB07FC6D131F3A3FFC01FFF86CB612E06C5D6C92C8FC000114FC6C6C13F0 010F90C9FC323E7EA730>II<15E0EC03F8140781A35D6E5A6E5A91 C8FCA990B512C048805AA27E7EEB001F5DA5143F5DA5147F92C7FCA55C5CA513015CA200 7FB61280B712C016E0A216C06C1580233979B830>I107 D<90383FFFF8497F81A37F90380001 FCA514035DA514075DA5140F5DA5141F5DA5143F5DA5147F92C7FCA55C5CA2003FB612F0 4815F8B712FCA26C15F86C15F026387BB730>I<913903F001F83B01FF0FFC07FE489039 BFFE1FFF91B5007F138093B5FC18C06C9039FC3FFE1F3B003FF81FFC0F02E013F002C013 E0A2028013C09139003F801F491680A2017E1400A401FE49133F49017E1400A5000102FE 5B4949137EA50003010114FE01F0495BA23C3FFE07FF03FF80486C48018713C0B5009F01 CF13E0A26C010F018713C06C486C01031380332881A730>IIII<91383FE00F903A01FFF81F800107EB FE3F011F13FF4914FF5B9038FFF03F48EB800F48496C1300D807FC7F48487F5B485A4848 7F5E5B127F90C8FC15015A485DA41503A25E6C1407150F6C141F7F6C6C133FEDFFF0381F F001EBFC0F6CB6FC7E6C14EF6CEC8FE039007FFE0FEB0FF090C7FC151F5EA5153F5EA591 381FFFFE4A7F5CA2806E5B293C7AA730>II<91387F F838903903FFFE7C011FEBFFFC5B5B90B6FC48EBC01F3903FC0007491303484814F85BA3 ED01F06D90C7FCEA03FEEBFFF06CEBFF806C14F06D13FC011F13FF01071480D9007F13C0 020113E0EC001F001FEC0FF06D1307003F1403A27FA21507486CEB0FE0151F6DEB3FC090 39FC03FF8090B6FC1600B612FC00FC5C013F13E0267807FEC7FC262A79A830>III<3B3FFFC07FFF80486DB512C0B515E0A26C16C06C496C13803B03F00007 F0006D5C150F00015D151F5E153F6D91C7FC5D0000147E15FE5D140101FE5BA290387E03 F0A24A5AA24A5A137F4A5A133F4AC8FCA2147E14FE5C131F5CA25C6D5A2B2778A630>I< 3B3FFFC01FFFE0486D4813F0B515F8A26C16F06C496C13E0D807E0C7EA7E00A35EA34B5A A34B5A143E147F4A485A13E1A249495A158FEBC7EF9138CF9F8014DF13CF029F90C7FC15 BFEBDF8FEC0FBEA201FE13FE5D13FCA25D496C5A3903E003E02D2779A630>I<903AFFFE 07FFF0486D4813F84816FCA26C16F86C496C13F0903A07F001FC006D6C485A6D6C485A4B 5A6D6C485A4B5ADA7F7FC7FC157EEC3FFE6E5A5D6E5A5DA24A7E143F4A7EA2ECFCFCEB01 F8903803F07E903807E07F49487E011F8090383F801FD97F007F01FE6D7E263FFFC0B5FC 4801E11480B515C0A26C16806C01C014002E277DA630>I<017FB612F090B712F85AA317 F0D803FCC7EA3FE049EC7FC0EEFF80923803FE004B5A6C48495AC8485AED7FC04B5A4A90 C7FC4A5A4A5AEC1FF04A5A4A5A4A5A4990C8FCEB07FC495A495A4948130F4948EB1F8048 48C713C04848143F485A48481580485A007FB7FCA3B8FC6C16005E2D277DA630>122 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fi cmtt10 10.95 83 /Fi 83 127 df<121C127FEAFF80B3EA7F00B2123EC7FCA8121C127FA2EAFF80A3EA7F00 A2121C09396DB830>33 D<00101304007C131F00FEEB3F80A26C137FA248133FB2007E14 00007C7F003C131E00101304191C75B830>I<903907C007C0A2496C487EA8011F131FA2 02C05BA3007FB7FCA2B81280A36C16006C5D3A007F807F80A2020090C7FCA9495BA2003F 90B512FE4881B81280A36C1600A22701FC01FCC7FCA300031303A201F85BA76C486C5AA2 29387DB730>I37 DII<141E147F14FF5BEB03FEEB07FCEB0FF0EB1FE0EB3FC0EB7F80EBFF00485A5B 12035B485A120F5BA2485AA2123F5BA2127F90C7FCA412FEAD127FA47F123FA27F121FA2 6C7EA27F12076C7E7F12017F6C7EEB7F80EB3FC0EB1FE0EB0FF0EB07FCEB03FEEB01FF7F 147F141E184771BE30>I<127812FE7E7F6C7E6C7EEA0FF06C7E6C7E6C7E6C7EEB7F8013 3F14C0131FEB0FE014F01307A2EB03F8A214FC1301A214FE1300A4147FAD14FEA4130114 FCA2130314F8A2EB07F0A2130F14E0EB1FC0133F1480137FEBFF00485A485A485A485AEA 3FE0485A485A90C7FC5A1278184778BE30>I<14E0497E497EA60038EC0380007EEC0FC0 D8FF83EB3FE001C3137F9038F3F9FF267FFBFB13C06CB61280000FECFE00000314F86C5C 6C6C13C0011F90C7FC017F13C048B512F04880000F14FE003FECFF80267FFBFB13C026FF F3F913E09038C3F87F0183133FD87E03EB0FC00038EC0380000091C7FCA66D5A6D5A2327 7AAE30>I<143EA2147FAF007FB7FCA2B81280A36C1600A2C76CC8FCAF143EA229297DAF 30>I<007FB612F0A2B712F8A36C15F0A225077B9E30>45 D<120FEA3FC0EA7FE0A2EAFF F0A4EA7FE0A2EA3FC0EA0F000C0C6E8B30>I<16F01501ED03F8A21507A2ED0FF0A2ED1F E0A2ED3FC0A2ED7F80A2EDFF00A24A5AA25D1403A24A5AA24A5AA24A5AA24A5AA24A5AA2 4AC7FCA2495AA25C1303A2495AA2495AA2495AA2495AA2495AA249C8FCA2485AA25B1203 A2485AA2485AA2485AA2485AA2485AA248C9FCA25AA2127CA225477BBE30>I<14FE9038 07FFC0497F013F13F8497F90B57E48EB83FF4848C6138049137F4848EB3FC04848EB1FE0 49130F001F15F0491307A24848EB03F8A290C712014815FCA400FEEC00FEAD6C14016C15 FCA36D1303003F15F8A26D1307001F15F0A26D130F6C6CEB1FE0A26C6CEB3FC06C6CEB7F 806D13FF2601FF8313006CEBFFFE6D5B6D5B010F13E06D5BD900FEC7FC273A7CB830>I< EB03C0497EA2130FA2131FA2133F137F13FF1203123FB5FCA213EF138FEA7E0F1200B3B0 003FB512F84814FCB612FEA26C14FC6C14F81F3977B830>I III<000FB612804815C05AA316800180C8 FCAEEB83FF019F13C090B512F015FC8181D9FE0313809039F0007FC049133F0180EB1FE0 6CC7120F000E15F0C81207A216F81503A31218127EA2B4FC150716F048140F6C15E06C14 1F6DEB3FC06D137F3A3FE001FF80261FFC0F13006CB55A6C5C6C5C6C14E06C6C1380D90F FCC7FC25397BB730>II<127CB712FC16FEA416FC48C7EA0FF816F0ED1FE0007C EC3FC0C8EA7F80EDFF00A24A5A4A5A5D14075D140F5D4A5AA24A5AA24AC7FCA25C5C1301 5CA213035CA213075CA4495AA6131F5CA96D5A6DC8FC273A7CB830>I<49B4FC011F13F0 017F13FC90B57E0003ECFF804815C048010113E03A1FF8003FF049131FD83FC0EB07F8A2 4848EB03FC90C71201A56D1303003F15F86D13076C6CEB0FF06C6CEB1FE0D807FCEB7FC0 3A03FF83FF806C90B512006C6C13FC011F13F0497F90B512FE48802607FE0013C0D80FF8 EB3FE0D81FE0EB0FF04848EB07F8491303007F15FC90C712014815FE481400A66C14016C 15FC6D1303003F15F86D1307D81FF0EB1FF06D133F3A0FFF01FFE06C90B512C06C1580C6 ECFE006D5B011F13F0010190C7FC273A7CB830>I<49B4FC010F13E0013F13F890B57E48 80488048010113803A0FFC007FC0D81FF0EB3FE04848131F49EB0FF048481307A290C7EA 03F85A4815FC1501A416FEA37E7E6D1303A26C6C13076C6C130F6D133FD80FFC13FF6CB6 FC7E6C14FE6C14F9013FEBE1FC010F138190380060011400ED03F8A2150716F0150F000F 15E0486C131F486CEB3FC0157FEDFF804A1300EC07FE391FF01FFC90B55A6C5C6C5C6C14 80C649C7FCEB3FF0273A7CB830>I<120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA 0F00C7FCAF120FEA3FC0EA7FE0A2EAFFF0A4EA7FE0A2EA3FC0EA0F000C276EA630>II<16F01503ED07F8151F157FEDFFF014034A13C0021F1380 91383FFE00ECFFF8495B010713C0495BD93FFEC7FC495A3801FFF0485B000F13804890C8 FCEA7FFC5BEAFFE05B7FEA7FF87FEA1FFF6C7F000313E06C7F38007FFC6D7E90380FFF80 6D7F010113F06D7FEC3FFE91381FFF80020713C06E13F01400ED7FF8151F1507ED03F015 00252F7BB230>I<007FB7FCA2B81280A36C16006C5DCBFCA7003FB612FE4881B81280A3 6C1600A229157DA530>I<1278127EB4FC13C07FEA7FF813FEEA1FFF6C13C000037F6C13 F86C6C7EEB1FFF6D7F010313E06D7F9038007FFC6E7E91380FFF806E13C0020113F080ED 3FF8151F153FEDFFF05C020713C04A138091383FFE004A5A903801FFF0495B010F138049 90C7FCEB7FFC48485A4813E0000F5B4890C8FCEA7FFE13F8EAFFE05B90C9FC127E127825 2F7BB230>II<147F4A7EA2497FA4497F14F7A401077F14E3A3010F7FA314 C1A2011F7FA490383F80FEA590387F007FA4498049133F90B6FCA34881A39038FC001F00 038149130FA4000781491307A2D87FFFEB7FFFB56CB51280A46C496C130029397DB830> 65 D<007FB512F0B612FE6F7E82826C813A03F8001FF815076F7E1501A26F7EA615015E A24B5A1507ED1FF0ED7FE090B65A5E4BC7FC6F7E16E0829039F8000FF8ED03FC6F7E1500 167FA3EE3F80A6167F1700A25E4B5A1503ED1FFC007FB6FCB75A5E16C05E6C02FCC7FC29 387EB730>I<91387F803C903903FFF03E49EBFC7E011F13FE49EBFFFE5B9038FFE07F48 EB801F3903FE000F484813075B48481303A2484813015B123F491300A2127F90C8FC167C 16005A5AAC7E7EA2167C6D14FE123FA27F121F6D13016C6C14FCA26C6CEB03F86D13076C 6CEB0FF03901FF801F6C9038E07FE06DB512C06D14806D1400010713FC6D13F09038007F C0273A7CB830>I<003FB512E04814FCB67E6F7E6C816C813A03F8007FF0ED1FF8150F6F 7E6F7E15016F7EA2EE7F80A2163F17C0161FA4EE0FE0AC161F17C0A3163F1780A2167F17 005E4B5A15034B5A150F4B5AED7FF0003FB65A485DB75A93C7FC6C14FC6C14E02B387FB7 30>I<007FB7FCB81280A47ED803F8C7123FA8EE1F0093C7FCA4157C15FEA490B5FCA6EB F800A4157C92C8FCA5EE07C0EE0FE0A9007FB7FCB8FCA46C16C02B387EB730>I<003FB7 12804816C0B8FCA27E7ED801FCC7121FA8EE0F8093C7FCA5153E157FA490B6FCA69038FC 007FA4153E92C8FCAE383FFFF8487FB5FCA27E6C5B2A387EB730>I<02FF13F00103EBC0 F8010F13F1013F13FD4913FF90B6FC4813C1EC007F4848133F4848131F49130F485A4913 07121F5B123F491303A2127F90C7FC6F5A92C8FC5A5AA892B5FC4A14805CA26C7F6C6D14 00ED03F8A27F003F1407A27F121F6D130F120F7F6C6C131FA2D803FE133F6C6C137FECC1 FF6C90B5FC7F6D13FB010F13F30103EBC1F0010090C8FC293A7DB830>I<3B3FFF800FFF E0486D4813F0B56C4813F8A26C496C13F06C496C13E0D803F8C7EAFE00B290B6FCA601F8 C7FCB3A23B3FFF800FFFE0486D4813F0B56C4813F8A26C496C13F06C496C13E02D387FB7 30>I<007FB6FCB71280A46C1500260007F0C7FCB3B3A8007FB6FCB71280A46C15002138 79B730>I75 D<383FFFF8487FB57EA26C5B6C5BD801FCC9FCB3B0EE0F80EE1FC0 A9003FB7FC5AB8FCA27E6C16802A387EB730>III<90383FFFE048B512FC000714FF48 15804815C04815E0EBF80001E0133FD87F80EB0FF0A290C71207A44815F8481403B3A96C 1407A26C15F0A36D130FA26D131F6C6CEB3FE001F813FF90B6FC6C15C06C15806C150000 0114FCD8003F13E0253A7BB830>I<007FB512F0B612FE6F7E16E0826C813903F8003FED 0FFCED03FE15016F7EA2821780163FA6167F17005EA24B5A1503ED0FFCED3FF890B6FC5E 5E16804BC7FC15F001F8C9FCB0387FFFC0B57EA46C5B29387EB730>I<003FB57E4814F0 B612FC15FF6C816C812603F8017F9138003FF0151F6F7E15071503821501A515035E1507 150F4B5A153F4AB45A90B65A5E93C7FC5D8182D9F8007FED3FE0151F150F821507A817F8 EEF1FCA53A3FFF8003FB4801C0EBFFF8B56C7E17F06C496C13E06C49EB7FC0C9EA1F002E 397FB730>82 D<90390FF803C0D97FFF13E048B512C74814F74814FF5A381FF80F383FE0 01497E4848137F90C7123F5A48141FA2150FA37EED07C06C91C7FC7F7FEA3FF0EA1FFEEB FFF06C13FF6C14E0000114F86C80011F13FF01031480D9003F13C014019138007FE0151F ED0FF0A2ED07F8A2007C140312FEA56C140716F07F6DEB0FE06D131F01F8EB3FC001FF13 FF91B51280160000FD5CD8FC7F13F8D8F81F5BD878011380253A7BB830>I<003FB712C0 4816E0B8FCA43AFE003F800FA8007CED07C0C791C7FCB3B1011FB5FC4980A46D91C7FC2B 387EB730>I<3B7FFFC007FFFCB56C4813FEA46C496C13FCD803F8C7EA3F80B3B16D147F 00011600A36C6C14FE6D13016D5CEC800390393FE00FF890391FF83FF06DB55A6D5C6D5C 6D91C7FC9038007FFCEC1FF02F3980B730>II<3A3FFF01FFF84801837F02C77FA202835B6C01 015B3A01FC007F806D91C7FC00005C6D5BEB7F01EC81FCEB3F8314C3011F5B14E7010F5B 14FF6D5BA26D5BA26D5BA26D90C8FCA4497FA2497FA2815B81EB0FE781EB1FC381EB3F81 81EB7F0081497F49800001143F49800003141F49800007140FD87FFEEB7FFFB590B51280 80A25C6C486D130029387DB730>88 DI<001FB612FC4815FE5AA490C7EA03FCED07 F816F0150FED1FE016C0153FED7F80003E1500C85A4A5A5D14034A5A5D140F4A5A5D143F 4A5A92C7FC5C495A5C1303495A5C130F495A5C133F495A91C8FC5B4848147C4914FE1203 485A5B120F485A5B123F485A90B6FCB7FCA46C15FC27387CB730>I<007FB5FCB61280A4 150048C8FCB3B3B3A5B6FC1580A46C140019476DBE30>I<127CA212FEA27EA26C7EA26C 7EA26C7EA26C7EA26C7EA26C7EA212017FA26C7EA26D7EA26D7EA26D7EA26D7EA26D7EA2 6D7EA2130180A26D7EA26E7EA26E7EA26E7EA26E7EA26E7EA26E7EA2140181A26E7EA2ED 7F80A2ED3FC0A2ED1FE0A2ED0FF0A2ED07F8A21503A2ED01F0150025477BBE30>I<007F B5FCB61280A47EC7123FB3B3B3A5007FB5FCB6FCA46C140019477DBE30>I<007FB612F0 A2B712F8A36C15F0A225077B7D30>95 D97 DII<913801FFE04A7F5C A28080EC0007AAEB03FE90381FFF874913E790B6FC5A5A481303380FFC00D81FF0133F49 131F485A150F4848130790C7FCA25AA25AA87E6C140FA27F003F141F6D133F6C7E6D137F 390FF801FF2607FE07EBFFC06CB712E06C16F06C14F76D01C713E0011F010313C0D907FC C8FC2C397DB730>I<49B4FC010713E0011F13F8017F7F90B57E488048018113803A07FC 007FC04848133FD81FE0EB1FE0150F484814F0491307127F90C7FCED03F85A5AB7FCA516 F048C9FC7E7EA27F003FEC01F06DEB03F86C7E6C7E6D1307D807FEEB1FF03A03FFC07FE0 6C90B5FC6C15C0013F14806DEBFE00010713F8010013C0252A7CA830>IIII< 14E0EB03F8A2497EA36D5AA2EB00E091C8FCA9381FFFF8487F5AA27E7EEA0001B3A9003F B612C04815E0B7FCA27E6C15C023397AB830>III<387FFFF8B57EA47EEA0001B3B3A8007FB612F0B712F8A46C15F025387BB7 30>I<02FC137E3B7FC3FF01FF80D8FFEF01877F90B500CF7F15DF92B57E6C010F138726 07FE07EB03F801FC13FE9039F803FC01A201F013F8A301E013F0B3A23C7FFE0FFF07FF80 B548018F13C0A46C486C01071380322881A730>II< 49B4FC010F13E0013F13F8497F90B57E0003ECFF8014013A07FC007FC04848EB3FE0D81F E0EB0FF0A24848EB07F8491303007F15FC90C71201A300FEEC00FEA86C14016C15FCA26D 1303003F15F86D13076D130F6C6CEB1FF06C6CEB3FE06D137F3A07FF01FFC06C90B51280 6C15006C6C13FC6D5B010F13E0010190C7FC272A7CA830>II<49B413F8010FEBC1FC013F13F14913FD48B6FC5A4813 81390FFC007F49131F4848130F491307485A491303127F90C7FC15015A5AA77E7E15037F A26C6C1307150F6C6C131F6C6C133F01FC137F3907FF01FF6C90B5FC6C14FD6C14F9013F 13F1010F13C1903803FE0190C7FCAD92B512F84A14FCA46E14F82E3C7DA730>II<90381FFC1E48B5129F000714FF5A5A5A387FF007EB800100FEC7FC4880A46C143E 007F91C7FC13E06CB4FC6C13FC6CEBFF806C14E0000114F86C6C7F01037F9038000FFF02 001380007C147F00FEEC1FC0A2150F7EA27F151F6DEB3F806D137F9039FC03FF0090B6FC 5D5D00FC14F0D8F83F13C026780FFEC7FC222A79A830>III<3B3F FFC07FFF80486DB512C0B515E0A26C16C06C496C13803B01F80003F000A26D130700005D A26D130F017E5CA2017F131F6D5CA2EC803F011F91C7FCA26E5A010F137EA2ECE0FE0107 5BA214F101035BA3903801FBF0A314FF6D5BA36E5A6E5A2B277EA630>I<3B3FFFC01FFF E0486D4813F0B515F8A26C16F06C496C13E0D807E0C7EA3F00A26D5C0003157EA56D14FE 00015DEC0F80EC1FC0EC3FE0A33A00FC7FF1F8A2147DA2ECFDF9017C5C14F8A3017E13FB A290393FF07FE0A3ECE03FA2011F5C90390F800F802D277FA630>I<3A3FFF81FFFC4801 C37FB580A26C5D6C01815BC648C66CC7FC137FEC80FE90383F81FC90381FC3F8EB0FE3EC E7F06DB45A6D5B7F6D5B92C8FC147E147F5C497F81903803F7E0EB07E790380FE3F0ECC1 F890381F81FC90383F80FE90387F007E017E137F01FE6D7E48486D7E267FFF80B5FCB500 C1148014E3A214C16C0180140029277DA630>I<3B3FFFC07FFF80486DB512C0B515E0A2 6C16C06C496C13803B01FC0003F000A2000014076D5C137E150F017F5C7F151FD91F805B A214C0010F49C7FCA214E00107137EA2EB03F0157C15FCEB01F85DA2EB00F9ECFDF0147D 147FA26E5AA36E5AA35DA2143F92C8FCA25C147EA2000F13FE486C5AEA3FC1EBC3F81387 EB8FF0EBFFE06C5B5C6C90C9FC6C5AEA01F02B3C7EA630>I<001FB612FC4815FE5AA316 FC90C7EA0FF8ED1FF0ED3FE0ED7FC0EDFF80003E491300C7485A4A5A4A5A4A5A4A5A4A5A 4A5A4990C7FC495A495A495A495A495A495A4948133E4890C7127F485A485A485A485A48 5A48B7FCB8FCA46C15FE28277DA630>I<017C133848B4137C48EB80FE4813C14813C348 EBEFFC397FEFFFF0D8FF8713E0010713C0486C1380D87C0113003838007C1F0C78B730> 126 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fj cmsl10 10.95 35 /Fj 35 122 df12 D<007FB5FCA2B512FEA418067C961E>45 D<157015F014011407143F903803FFE0137FEB FFCFEBF80F1300141F15C0A5143F1580A5147F1500A55C5CA513015CA513035CA513075C A5130F5CA3131F497EB612F8A31D3D78BC2D>49 DI<17E0 16011603831607A2160FA2161F83163FA2167F167716F7EEE7FCED01E316C31503168315 07EE03FEED0F01150E151E151C153C03387FED7800157015F05D4A4880177F4A5AA24AC7 FCA2020E81173F5C021FB6FC5CA20270C7EA3FE0171F5CA2495AA2494881170F49C8FCA2 130EA24982013C1507A2137CD801FE4B7E2607FF80EC3FFEB500F00107B512FC19F85E3E 417DC044>65 D<013FB812F8A39026007FF0C7127F6E48140F18034B14011800A3197814 7F4B1570A502FF147092C7FCA3190017F0495D4A1301A21607161F91B6FC495DA29138FC 003F160F1607160301075D5CA219E0180119C0010FEC07004A90C712031980A218071900 011F5E5C181EA2183E183C013F167C4A15FC4D5A1707017F151F01FF4AB45AB9FCA2603D 3E7DBD3E>69 D<4BB46C1370031F01F013F0037F9038FC01E0913A03FF807E03913A0FF8 000F83DA1FE0EB07C7DA7F80EB01EF4AC812FFD903FE16C04948157F4948153F495A4948 151F495A4948168091C9120F5A485AA2485A000F18004982121FA248485EA295C7FC485A A412FF5BA6043FB512E05BA29339001FFC00715AA2607F127FA2171F123F6D5EA2121F7F 000F163F6C7E6C6C4B5A7F6C6C15FF6C6DEB01EFD93FC0EB07C7D91FF0EB1F87D907FE90 38FE03800101B5EAF8016D6C01E0C8FCDA07FEC9FC3C4276BF47>71 D<011FB512FC5BA29039003FF8006E5AA25DA5143F5DA5147F5DA514FF92C7FCA55B5CA5 13035CA513075CA5130F5CA5131F5CA3133F497E007FB512F0A2B6FC263E7EBD21>73 D<013FB512FEA25E9026007FF8C8FCEC3FE0A25DA5147F5DA514FF92C9FCA55B5CA51303 5CA513075CA21838A21870130F5CA218E0A3011F15014A15C01703A21707EF0F80013F15 1F4A143F177FEFFF00017F140301FF143FB9FC5FA2353E7DBD39>76 D<90263FFFF093381FFFF85013F0629026007FF8EFF000023F4D5AA2023B933801DFC0A2 DA39FCED039FA2F1073F14790271040E5BEC70FE191C19381A7F02F01670DAE07F94C7FC 19E0A2F001C06201016D6C495A02C05FF00700A2180E6F6C14010103161C028003385BA2 18706F7EF0E00313070200DA01C05BA2923907F00380A294380700075B010E902603F80E 5C5FA25F190F011E6D6C5A011C605FA2EEFDC0DB00FF141F013C5D013860013C92C7FC01 7C5C01FE027E143F2607FF80017C4A7EB500FC037FB512E004785E4A1338553E7CBD53> I<9238FF80070207EBE00F021FEBF81E91387F00FE02FCEB1F3ED903F0EB0FFE49481307 494813034AEB01FC49C7FC491400133E137E177C491578A57F1770A26D1500808080EB7F FEECFFE06D13FEEDFFC06D14F06D14FC010380010080143F02031480DA003F13C0150315 00EE7FE0163F161FA2160F121CA31607160F003C16C0A31780003E151F1700007E5D007F 153E6D5C16FC01E0495AD87DF0495AD8FCFCEB0FC03AF87F803F8027F01FFFFEC7FCD8E0 0713F839C0007FC030427BBF33>83 D<0007B912F0A33C0FFE000FF8003F01F0160F01C0 4A13034848160190C7FC121EF000E048141F5E1238A212781270153F5E5AA3C81600157F 5EA515FF93C9FCA55C5DA514035DA514075DA5140F5DA3141FEC7FFC0003B7FCA33C3D76 BC42>I86 D97 DIIIII<177C913907F803FE91393FFE0F8F9139 FC0F9C3F903901F007F8903907E003E0D90FC013F0011F903801F80C02801400133FD97F 007FA315035B495CA3017E495A5E150F6D5C6D495A90263F803EC7FCECC0FC903871FFF0 9038E07F8091C9FC485AA47FA27F90B512F8EDFF806C15E016F86D8048B6FC3A07E0000F FED80F801300003FC8127F003E815A00FC815AA25E163EA25E6C15FC007C4A5A6C4A5A6C EC0FC0D80FC0013FC7FC3903F801FCC6B512F0010F90C8FC303D7FA82D>I<147FEB3FFF A313017FA25CA513015CA513035CA4ED07F80107EB1FFF9139F0781FC09138F1E00F9139 F38007E0ECF70002FE14F0495A5CA25CA24A130F131F4A14E0A4161F133F4A14C0A4163F 137F91C71380A4167F5B491500A300015D486C491380B5D8F87F13FCA32E3F7DBE33>I< 1478EB01FE130314FFA25B14FE130314FCEB00F01400ACEB03F8EA01FF14F0A2EA001F13 0FA314E0A5131F14C0A5133F1480A5137F1400A55B5BA4EA03FF007F13F0A2B5FC183E7D BD1A>I<147FEB3FFFA313017FA25CA513015CA513035CA501070103B5FC02F014FEA26F 13F06F1380EEFE00010F14F84A485AED03C04B5A031FC7FC153E011F13784A5AECC3E0EC C7F0ECCFF814FF497F14F9ECE1FE14C04A7E4A7E4980017E133F82151F82150F01FE8049 130782A2000181486C49B4FCB5D8F03F13F04B13E0A2303F7EBE30>107 D<143FEB1FFF5BA213017FA214FEA5130114FCA5130314F8A5130714F0A5130F14E0A513 1F14C0A5133F1480A5137F1400A55B5BA4EA03FF007F13F8A2B5FC183F7DBE1A>I<9027 07F007F8EB03FCD803FFD91FFF90380FFF80913CE0781FC03C0FE09126E1E00FEBF0073E 001FE38007E1C003F090260FE700EBE38002EEDAF70013F802FC14FE02D85C14F84A5CA2 4A5C011F020F14074A4A14F0A5013F021F140F4A4A14E0A5017F023F141F91C74914C0A5 49027F143F4992C71380A300014B147F486C496DEBFFC0B5D8F87FD9FC3F13FEA347287D A74C>I<903907F007F8D803FFEB1FFF9139E0781FC09138E1E00F3B001FE38007E09038 0FE70002EE14F014FC14D814F85CA24A130F131F4A14E0A4161F133F4A14C0A4163F137F 91C71380A4167F5B491500A300015D486C491380B5D8F87F13FCA32E287DA733>II<91387F01FE903A7FFF0FFFC09139FE3E03F09238F801F8903A03FF E000FE6D49137F4B7F92C713804A15C04A141FA218E0A20103150F5C18F0A3171F010716 E05CA3173F18C0130F4A147F1880A2EFFF004C5A011F5D16034C5A6E495AEE1FC06E495A D93FDC017EC7FC91388F01F8913883FFE0028090C8FC92C9FC137FA291CAFCA45BA25BA3 1201487EB512F8A3343A81A733>I<903907F01F80D803FFEB7FE09138E1E1F09138E387 F839001FE707EB0FE614EE02FC13F002D813E09138F801804AC7FCA25C131FA25CA4133F 5CA5137F91C8FCA55B5BA31201487EB512FEA325287EA724>114 D<9138FF81C0010713E390381F807F90397C003F8049131F4848130F5B00031407A24848 1400A27FA27F6D90C7FCEBFF8014FC6C13FF6C14C015F06C6C7F011F7F13079038007FFE 1403140100381300157EA2123C153E157E007C147CA2007E147815F8007F495A4A5A486C 485A26F9E01FC7FC38E0FFFC38C01FE0222A7DA824>II<01FE147F00FFEC7FFF4914FEA20007140300031401A34914FCA4 150312074914F8A41507120F4914F0A4150F121F4914E0A2151FA3153F4914C0157F15FF EC01DF3A0FC003BFE09138073FFF3803F01E3801FFF826003FE01380282977A733>II<48B539C07FFFC0A33C000FFE003FF8006D 48EB1FE0010315800101023EC7FC6E133C01005C027F5B6F5A91383F81C0EDC380DA1FC7 C8FC15EFEC0FFE6E5A5D140381A24A7E140FEC1E7F023C7FEC383F02707FECE01F010180 903803C00F49486C7ED90F007F491303017E80D801FE80D807FF497EB5D8803F13F8A332 277FA630>120 D<90B539E007FFF05E18E0902707FE000313006D48EB01FC705A5F0101 4A5A5F16036E5C0100140794C7FC160E805E805E1678ED8070023F13F05EED81C015C191 381FC38015C793C8FC15EF15EEEC0FFCA25DA26E5AA25DA26E5A5DA24AC9FC5C140E141E 141C5C121C003F5B5A485B495A130300FE5B4848CAFCEA701EEA783CEA3FF0EA0FC0343A 80A630>I E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fk cmbx12 17.28 48 /Fk 48 122 df<94267FFF80903801FFE0043FB500F0013F13FC4BB6D8FC01B57E030FDB FF0FECFF80037F04BF15C04AB5D8E00390B5008113E04A01FCC76CEBFC03020F01F091B5 D8F00713F04A01C04914E04A90C7484A4813F84A4817804A485C49491700495B62495B76 13F04970496D13E04B7213C0726F138072EE3E009AC7FCB0BD12FEA6D8000F01E0C849C9 FCB3B3B0003FB6D8F803B712E0A665657DE45E>11 D48 D<16F04B7E1507151F153FEC01FF1407147F010FB5FCB7FCA41487EBF007C7FCB3B3B3B3 007FB91280A6395E74DD51>I<913801FFF8021FEBFFC091B612F8010315FF010F16C001 3F8290267FFC0114F89027FFE0003F7F4890C7000F7F48486E7FD807F86E148048486E14 C048486E14E048486F13F001FC17F8486C816D17FC6E80B56C16FE8380A219FFA283A36C 5BA26C5B6C90C8FCD807FC5DEA01F0CA14FEA34D13FCA219F85F19F04D13E0A294B512C0 19804C14004C5B604C5B4C5B604C13804C90C7FC4C5A4C5A4B13F05F4B13804B90C8FC4B 5AED1FF84B5A4B5A4B48143F4A5B4A48C8FC4A5A4A48157E4A5A4A5AEC7F8092C9FC02FE 16FE495A495A4948ED01FCD90FC0150749B8FC5B5B90B9FC5A4818F85A5A5A5A5ABAFCA2 19F0A4405E78DD51>I<92B5FC020F14F8023F14FF49B712C04916F0010FD9C01F13FC90 271FFC00077FD93FE001017F49486D8049C86C7F484883486C6F7F14C0486D826E806E82 487FA4805CA36C5E4A5E6C5B6C5B6C495E011FC85A90C95CA294B55A614C91C7FC604C5B 4C5B4C5B4C5B047F138092260FFFFEC8FC020FB512F817E094C9FC17F817FF91C7003F13 E0040713F8040113FE707F717F7113E085717FA2717F85A285831A80A31AC0EA03FCEA0F FF487F487F487FA2B57EA31A80A34D14005C7E4A5E5F6C495E49C8485BD81FF85F000F5E D807FE92B55A6C6C6C4914806C01F0010791C7FC6C9026FF803F5B6D90B65A011F16F001 0716C001014BC8FCD9001F14F0020149C9FC426079DD51>II<01C0EE01C0D801F8160F01FF167F02F0 EC07FFDAFF8090B5FC92B7128019006060606060606095C7FC17FC5F17E0178004FCC8FC 16E09026FC3FFCC9FC91CBFCADED3FFE0203B512F0020F14FE023F6E7E91B712E001FDD9 E00F7F9027FFFE00037F02F801007F02E06EB4FC02806E138091C8FC496F13C04917E071 13F0EA00F090C914F8A219FC83A219FEA419FFA3EA03F0EA0FFC487E487E487FA2B57EA3 19FEA35C4D13FC6C90C8FC5B4917F8EA3FF001804B13F06D17E0001F5E6C6C17C06D4B13 80D807FC92B512006C6C4A5B6C6C6C01075B6C01E0011F5BD97FFE90B55A6DB712C0010F 93C7FC6D15FC010115F0D9003F1480020301F0C8FC406078DD51>III<92383FFF80 0203B512FC021FECFF80027F15E049B712F849D9F0077F010F90C76C7ED91FFCEC1FFFD9 3FF06E7F494802037F494882717F484980854890C9127FA24884183FA25A80A380806E15 7F6E5E14FE6E7E6F4A5A6C14F003FC495B03FF495B6C1580DCE0075B6CDBF80F90C7FC93 38FE1FFE6C9238FF7FF84D5A6D16C06D5E6D4BC8FC6D6F7E6D16E00101826D16FC023F81 4A8149B87E010783498390263FFE3F8190267FFC0F819026FFF003814849C6FC48496D80 4849131F4890C7000780160148486E1580003F163F49150F007F7014C0491501717E8400 FF835B8484A384A21A80A27F007F1900607F003F606D160F001F606D4C5A6C6D153F6C6D 4B5A6C01F04B5A6C01FC02035B6C01FF021F5B6D9027F001FFFEC7FC6D90B65A010F16F0 01035E010093C8FC020F14F8DA007F90C9FC426079DD51>II65 DI<4DB5ED03C0057F02F014070407B600FE 140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE13FF92B6C73807 FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC16074A01F08291 B54882490280824991CB7E49498449498449498449865D49498490B5FC484A84A2484A84 A24891CD127FA25A4A1A3F5AA348491A1FA44899C7FCA25CA3B5FCB07EA380A27EA2F50F C0A26C7FA37E6E1A1F6C1D80A26C801D3F6C6E1A00A26C6E616D1BFE6D7F6F4E5A7F6D6D 4E5A6D6D4E5A6D6D4E5A6D6E171F6D02E04D5A6E6DEFFF806E01FC4C90C7FC020F01FFEE 07FE6E02C0ED1FF8020102F8ED7FF06E02FF913803FFE0033F02F8013F1380030F91B648 C8FC030117F86F6C16E004071680DC007F02F8C9FC050191CAFC626677E375>III<4DB5ED03C0057F02F014070407 B600FE140F047FDBFFC0131F4BB800F0133F030F05FC137F033F9127F8007FFE13FF92B6 C73807FF814A02F0020113C3020702C09138007FE74A91C9001FB5FC023F01FC16074A01 F08291B54882490280824991CB7E49498449498449498449865D49498490B5FC484A84A2 484A84A24891CD127FA25A4A1A3F5AA348491A1FA44899C8FCA25CA3B5FCB07E071FB812 F880A37EA296C70001ECC000A26C7FA37E807EA26C80A26C80A26C807F6D7F816D7F7F6D 7F6D6D5F6D14C06D6E5E6E7F6E01FC5E020F01FF5E6E02C0ED7FEF020102F8EDFFC76E02 FF02071383033F02FC013F1301030F91B638FC007F03014D131F6F6C04E0130704070480 1301DC007F02F8CAFC050191CBFC6D6677E37F>71 DII76 DI80 D82 DI<001FBEFCA64849C79126E0000F1480 02E0180091C8171F498601F81A0349864986A2491B7FA2491B3F007F1DC090C9181FA400 7E1C0FA600FE1DE0481C07A5CA95C7FCB3B3B3A3021FBAFCA663617AE070>I<913803FF FE027FEBFFF00103B612FE010F6F7E4916E090273FFE001F7FD97FE001077FD9FFF80101 7F486D6D7F717E486D6E7F85717FA2717FA36C496E7FA26C5B6D5AEB1FC090C9FCA74BB6 FC157F0207B7FC147F49B61207010F14C0013FEBFE004913F048B512C04891C7FC485B48 13F85A5C485B5A5CA2B55AA45FA25F806C5E806C047D7F6EEB01F96C6DD903F1EBFF806C 01FED90FE114FF6C9027FFC07FC01580000191B5487E6C6C4B7E011F02FC130F010302F0 01011400D9001F90CBFC49437CC14E>97 D<903807FF80B6FCA6C6FC7F7FB3A8EFFFF804 0FEBFF80047F14F00381B612FC038715FF038F010014C0DBBFF0011F7FDBFFC001077F93 C76C7F4B02007F03F8824B6F7E4B6F13804B17C0851BE0A27313F0A21BF8A37313FCA41B FEAE1BFCA44F13F8A31BF0A24F13E0A24F13C06F17804F1300816F4B5A6F4A5B4AB40207 5B4A6C6C495B9126F83FE0013F13C09127F00FFC03B55A4A6CB648C7FCDAC00115F84A6C 15E091C7001F91C8FC90C8000313E04F657BE35A>I<92380FFFF04AB67E020F15F0023F 15FC91B77E01039039FE001FFF4901F8010113804901E0010713C04901804913E0017F90 C7FC49484A13F0A2485B485B5A5C5A7113E0485B7113C048701380943800FE0095C7FC48 5BA4B5FCAE7EA280A27EA2806C18FCA26C6D150119F87E6C6D15036EED07F06C18E06C6D 150F6D6DEC1FC06D01E0EC7F806D6DECFF00010701FCEB03FE6D9039FFC03FFC010091B5 12F0023F5D020F1580020102FCC7FCDA000F13C03E437BC148>II<92380FFFC04AB512FC02 0FECFF80023F15E091B712F80103D9FE037F499039F0007FFF011F01C0011F7F49496D7F 4990C76C7F49486E7F48498048844A804884485B727E5A5C48717EA35A5C721380A2B5FC A391B9FCA41A0002C0CBFCA67EA380A27EA27E6E160FF11F806C183F6C7FF17F006C7F6C 6D16FE6C17016D6C4B5A6D6D4A5A6D01E04A5A6D6DEC3FE0010301FC49B45A6D9026FFC0 1F90C7FC6D6C90B55A021F15F8020715E0020092C8FC030713F041437CC14A>III<903807FF80B6FCA6C6FC7F7FB3A8EF1FFF94B512F0040714FC041F14FF 4C8193267FE07F7F922781FE001F7FDB83F86D7FDB87F07FDB8FC0814C7F039FC78015BE 03BC8003FC825DA25DA25DA45DB3B2B7D8F007B71280A651647BE35A>II<903807FF80B6FCA6C6FC7F 7FB3A90503B61280A6DD003FEB8000DE0FFCC7FCF01FF04E5AF0FFC04D5B4D90C8FCEF07 FC4D5AEF3FF04D5A4D5A4C90C9FC4C5AEE0FFC4C5A4C5AEE7FC04C7E03837F03877F158F 039F7F03BF7F92B5FC838403FC804B7E03F0804B6C7F4B6C7F1580707F707F707FA27080 7080717FA2717F717F717FA2717F717F83867180727F95B57EB7D8E00FECFFF0A64C647B E355>107 D<903807FF80B6FCA6C6FC7F7FB3B3B3B3ADB712E0A623647BE32C>I<902607 FF80D91FFFEEFFF8B691B500F00207EBFF80040702FC023F14E0041F02FF91B612F84C6F 488193267FE07F6D4801037F922781FE001F9027E00FF0007FC6DA83F86D9026F01FC06D 7F6DD987F06D4A487F6DD98FC0DBF87EC7804C6D027C80039FC76E488203BEEEFDF003BC 6E4A8003FC04FF834B5FA24B5FA24B94C8FCA44B5EB3B2B7D8F007B7D8803FB612FCA67E 417BC087>I<902607FF80EB1FFFB691B512F0040714FC041F14FF4C8193267FE07F7F92 2781FE001F7FC6DA83F86D7F6DD987F07F6DD98FC0814C7F039FC78015BE03BC8003FC82 5DA25DA25DA45DB3B2B7D8F007B71280A651417BC05A>I<923807FFE092B6FC020715E0 021F15F8027F15FE494848C66C6C7E010701F0010F13E04901C001037F49496D7F4990C8 7F49486F7E49486F7E48496F13804819C04A814819E048496F13F0A24819F8A348496F13 FCA34819FEA4B518FFAD6C19FEA46C6D4B13FCA36C19F8A26C6D4B13F0A26C19E06C6D4B 13C0A26C6D4B13806C6D4B13006D6C4B5A6D6D495B6D6D495B010701F0010F13E06D01FE 017F5B010090B7C7FC023F15FC020715E0020092C8FC030713E048437CC151>I<902607 FF80EBFFF8B6010FEBFF80047F14F00381B612FC038715FF038F010114C09227BFF0003F 7FC6DAFFC0010F7F6D91C76C7F6D496E7F03F86E7F4B6E7F4B17804B6F13C0A27313E0A2 7313F0A21BF885A21BFCA3851BFEAE4F13FCA41BF861A21BF0611BE0611BC06F92B51280 1B006F5C6F4A5B6F4A5B03FF4A5B70495B04E0017F13C09226CFFC03B55A03C7B648C7FC 03C115F803C015E0041F91C8FC040313E093CBFCB3A3B712F0A64F5D7BC05A>I114 D<913A3FFF8007800107B5EAF81F011FECFE7F017F 91B5FC48B8FC48EBE0014890C7121FD80FFC1407D81FF0801600485A007F167F49153FA2 12FF171FA27F7F7F6D92C7FC13FF14E014FF6C14F8EDFFC06C15FC16FF6C16C06C16F06C 826C826C826C82013F1680010F16C01303D9007F15E0020315F0EC001F1500041F13F816 07007C150100FC81177F6C163FA2171F7EA26D16F0A27F173F6D16E06D157F6D16C001FE EDFF806D0203130002C0EB0FFE02FCEB7FFC01DFB65A010F5DD8FE0315C026F8007F49C7 FC48010F13E035437BC140>II<902607FFC0ED3FFEB60207B5FCA6C6EE00076D826D82B3B3A260A360 A2607F60183E6D6D147E4E7F6D6D4948806D6DD907F0ECFF806D01FFEB3FE06D91B55A6E 1500021F5C020314F8DA003F018002F0C7FC51427BC05A>III<007FB600C0017FB512F8A6D8001F01F8C70007EBF0006D040190C7FC6D6D5D6D 6D4A5A6D6D4A5A70495A6D4C5A6E7F6E6D495A6E6D495A7049C8FC6E4A5A6E6D485A6E6D 485A6E13FFEF8FF06EEC9FE06FEBFFC06F5C6F91C9FC5F6F5B816F7F6F7F8481707F8493 B57E4B805D4B80DB0FF37FDB1FE17F04C080153F4B486C7F4B486C7F4A486D7F4A486D7F 4A5A4B6D7F020F6E7F4A486D7F4A486D804A5A4AC86C7F49486F7F4A6F7F0107707FEB3F FFB600F049B7FCA650407EBF55>II E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fl cmsy10 10.95 2 /Fl 2 16 df13 D15 D E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fm cmr10 10.95 82 /Fm 82 124 df<4AB4EB0FE0021F9038E03FFC913A7F00F8FC1ED901FC90383FF03FD907 F090397FE07F80494801FF13FF4948485BD93F805C137F0200ED7F00EF003E01FE6D91C7 FC82ADB97EA3C648C76CC8FCB3AE486C4A7E007FD9FC3FEBFF80A339407FBF35>11 DIII<121EEA7F80EAFFC0A9EA7F80ACEA3F00AC 121EAB120CC7FCA8121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A4179C019>33 D<001E130F397F803FC000FF137F01C013E0A201E013F0A3007F133F391E600F30000013 00A401E01370491360A3000114E04913C00003130101001380481303000EEB070048130E 0018130C0038131C003013181C1C7DBE2D>I<013F1603D9FFC04B7E2601E0E0150F2607 C070151F48486C4BC7FC023E157E48486C15FE48D90FC0EB03FC003ED90EF0EB0FF8DA0F 3F13FD007E903A070FFFF1F0007C0200EB03E0160000FC6D6C495A170F604DC8FC5F173E 5F17FC5F4C5A1603007CD907005B4C5A007E150F003E495C020E49C9FC003F5D6C49133E 260F803C5B023813FC6C6C485B3A01E0E001F03800FFC090273F0003E0133F90C70007EC FFC09339C001E0E0923A0F8007C070031F49487E0400143C033E90381F001C037E497F03 7C133E4B150F0201027E7F4B137C4A5A020702FCEB03805D4A5A141F92C7FC143E147E14 7C5CA2495A0103037CEB07005C4948147E010F033E5B4A160E49C8123F496F5B013E9238 0F803C49173801FC6F6C5A49923801E0E0496FB45A0160043FC7FC41497BC34C>37 D<121EEA7F8012FF13C0A213E0A3127FEA1E601200A413E013C0A312011380120313005A 120E5A1218123812300B1C79BE19>39 D<1430147014E0EB01C0EB03801307EB0F00131E 133E133C5B13F85B12015B1203A2485AA2120F5BA2121F90C7FCA25AA3123E127EA6127C 12FCB2127C127EA6123E123FA37EA27F120FA27F1207A26C7EA212017F12007F13787F13 3E131E7FEB07801303EB01C0EB00E014701430145A77C323>I<12C07E12707E7E121E7E 6C7E7F12036C7E7F12007F1378137CA27FA2133F7FA21480130FA214C0A3130714E0A613 0314F0B214E01307A614C0130FA31480A2131F1400A25B133EA25BA2137813F85B12015B 485A12075B48C7FC121E121C5A5A5A5A145A7BC323>II<121EEA7F8012FF13C0A213E0A3 127FEA1E601200A413E013C0A312011380120313005A120E5A1218123812300B1C798919 >44 DI<121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A0A798919> IIIIII<150E151E153EA2157EA215FE1401A21403EC077E14 06140E141CA214381470A214E0EB01C0A2EB0380EB0700A2130E5BA25B5BA25B5B120148 5A90C7FC5A120E120C121C5AA25A5AB8FCA3C8EAFE00AC4A7E49B6FCA3283E7EBD2D>I< 00061403D80780131F01F813FE90B5FC5D5D5D15C092C7FC14FCEB3FE090C9FCACEB01FE 90380FFF8090383E03E090387001F8496C7E49137E497F90C713800006141FC813C0A216 E0150FA316F0A3120C127F7F12FFA416E090C7121F12FC007015C012780038EC3F80123C 6CEC7F00001F14FE6C6C485A6C6C485A3903F80FE0C6B55A013F90C7FCEB07F8243F7CBC 2D>II<1238123C123F90B612FCA3 16F85A16F016E00078C712010070EC03C0ED078016005D48141E151C153C5DC8127015F0 4A5A5D14034A5A92C7FC5C141EA25CA2147C147814F8A213015C1303A31307A3130F5CA2 131FA6133FAA6D5A0107C8FC26407BBD2D>III<121EEA7F 80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121EEA7F80A2EAFFC0A4EA7F80A2EA1E000A2779 A619>I<121EEA7F80A2EAFFC0A4EA7F80A2EA1E00C7FCB3121E127FEAFF80A213C0A412 7F121E1200A412011380A3120313005A1206120E120C121C5A1230A20A3979A619>I63 D<15074B7EA34B7EA34B7EA34B7EA34B7E15E7A2913801C7FC15C3A291380381FEA3 4AC67EA3020E6D7EA34A6D7EA34A6D7EA34A6D7EA34A6D7EA349486D7E91B6FCA2498191 38800001A249C87EA24982010E157FA2011E82011C153FA2013C820138151FA201788217 0F13FC00034C7ED80FFF4B7EB500F0010FB512F8A33D417DC044>65 DII IIIIII75 DIIII< B712F8EEFF8017E000019039C0003FF86C6C48EB07FCEE01FE707EEF7F80EF3FC018E0A2 EF1FF0A218F8A818F0A2EF3FE0A218C0EF7F80EFFF004C5AEE07FCEE3FF091B612C04CC7 FC0280C9FCB3A73801FFE0B612C0A3353E7DBD3E>I82 DI<003FB91280A3903AF0007FE001018090393FC0003F48C7ED1FC0 007E1707127C00781703A300701701A548EF00E0A5C81600B3B14B7E4B7E0107B612FEA3 3B3D7DBC42>IIII<007FB5D8C003B512E0A3C649C7EBFC00D93FF8 EC3FE06D48EC1F806D6C92C7FC171E6D6C141C6D6C143C5F6D6C14706D6D13F04C5ADA7F C05B023F13036F485ADA1FF090C8FC020F5BEDF81E913807FC1C163C6E6C5A913801FF70 16F06E5B6F5AA26F7E6F7EA28282153FED3BFEED71FF15F103E07F913801C07F0203804B 6C7EEC07004A6D7E020E6D7E5C023C6D7E02386D7E14784A6D7E4A6D7F130149486E7E4A 6E7E130749C86C7E496F7E497ED9FFC04A7E00076DEC7FFFB500FC0103B512FEA33F3E7E BD44>II91 D<486C13C00003130101001380481303000EEB07004813 0E0018130C0038131C003013180070133800601330A300E01370481360A400CFEB678039 FFC07FE001E013F0A3007F133FA2003F131F01C013E0390F0007801C1C73BE2D>II96 DII< 49B4FC010F13E090383F00F8017C131E4848131F4848137F0007ECFF80485A5B121FA248 48EB7F00151C007F91C7FCA290C9FC5AAB6C7EA3003FEC01C07F001F140316806C6C1307 6C6C14000003140E6C6C131E6C6C137890383F01F090380FFFC0D901FEC7FC222A7DA828 >IIII<167C903903F801FF903A1FFF078F8090397E0FDE1F9038 F803F83803F001A23B07E000FC0600000F6EC7FC49137E001F147FA8000F147E6D13FE00 075C6C6C485AA23901F803E03903FE0FC026071FFFC8FCEB03F80006CAFC120EA3120FA2 7F7F6CB512E015FE6C6E7E6C15E06C810003813A0FC0001FFC48C7EA01FE003E14004815 7E825A82A46C5D007C153E007E157E6C5D6C6C495A6C6C495AD803F0EB0FC0D800FE017F C7FC90383FFFFC010313C0293D7EA82D>III<1478EB01FEA2EB 03FFA4EB01FEA2EB00781400AC147FEB7FFFA313017F147FB3B3A5123E127F38FF807E14 FEA214FCEB81F8EA7F01387C03F0381E07C0380FFF803801FC00185185BD1C>III<2701F801FE14FF00FF902707FFC0 0313E0913B1E07E00F03F0913B7803F03C01F80007903BE001F87000FC2603F9C06D487F 000101805C01FBD900FF147F91C75B13FF4992C7FCA2495CB3A6486C496CECFF80B5D8F8 7FD9FC3F13FEA347287DA74C>I<3901F801FE00FF903807FFC091381E07E091387803F0 00079038E001F82603F9C07F0001138001FB6D7E91C7FC13FF5BA25BB3A6486C497EB5D8 F87F13FCA32E287DA733>I<14FF010713E090381F81F890387E007E01F8131F4848EB0F 804848EB07C04848EB03E0000F15F04848EB01F8A2003F15FCA248C812FEA44815FFA96C 15FEA36C6CEB01FCA3001F15F86C6CEB03F0A26C6CEB07E06C6CEB0FC06C6CEB1F80D800 7EEB7E0090383F81FC90380FFFF0010090C7FC282A7EA82D>I<3901FC03FC00FF90381F FF8091387C0FE09039FDE003F03A07FFC001FC6C496C7E6C90C7127F49EC3F805BEE1FC0 17E0A2EE0FF0A3EE07F8AAEE0FF0A4EE1FE0A2EE3FC06D1580EE7F007F6E13FE9138C001 F89039FDE007F09039FC780FC0DA3FFFC7FCEC07F891C9FCAD487EB512F8A32D3A7EA733 >I<02FF131C0107EBC03C90381F80F090397F00387C01FC131CD803F8130E4848EB0FFC 150748481303121F485A1501485AA448C7FCAA6C7EA36C7EA2001F14036C7E15076C6C13 0F6C7E6C6C133DD8007E137990383F81F190380FFFC1903801FE0190C7FCAD4B7E92B512 F8A32D3A7DA730>I<3901F807E000FFEB1FF8EC787CECE1FE3807F9C100031381EA01FB 1401EC00FC01FF1330491300A35BB3A5487EB512FEA31F287EA724>I<90383FC0603901 FFF8E03807C03F381F000F003E1307003C1303127C0078130112F81400A27E7E7E6D1300 EA7FF8EBFFC06C13F86C13FE6C7F6C1480000114C0D8003F13E0010313F0EB001FEC0FF8 00E01303A214017E1400A27E15F07E14016C14E06CEB03C0903880078039F3E01F0038E0 FFFC38C01FE01D2A7DA824>I<131CA6133CA4137CA213FCA2120112031207001FB512C0 B6FCA2D801FCC7FCB3A215E0A912009038FE01C0A2EB7F03013F138090381F8700EB07FE EB01F81B397EB723>IIIIII<001FB61280 A2EBE0000180140049485A001E495A121C4A5A003C495A141F00385C4A5A147F5D4AC7FC C6485AA2495A495A130F5C495A90393FC00380A2EB7F80EBFF005A5B4848130712074914 00485A48485BA248485B4848137F00FF495A90B6FCA221277EA628>II E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fn cmbx12 14.4 54 /Fn 54 122 df<922601FFFC903801FFE0033F9026FF801F13F84AB6D8E07F13FE020F03 F9B6FC023FD9C00FB500C0138091277FFC0003D9FE0113C0902601FFE049495A49494949 4813E04990C714F049484A13E0495A19C0495A7413C0017F17804A6E6E1380719138007E 007192C7FCAEBCFCA526007FF8C7000301C0C8FCB3B3A7007FB5D8F803B612F0A553547D D34E>11 D13 D46 D<913803FFC0023F13FC91B6FC010315C0010F018113F090 3A1FFC003FF849486D7E49486D7E49486D7E48496D138048496D13C0A24817E04890C813 F0A34817F8A24817FC49157FA3007F17FEA600FF17FFB3A5007F17FEA6003F17FCA26D15 FFA26C17F8A36C17F0A26C6D4913E0A26C6D4913C06C17806E5B6C6D4913006D6C495AD9 1FFCEB3FF8903A0FFF81FFF06D90B55A01011580D9003F01FCC7FC020313C0384F7BCD43 >48 D<157815FC14031407141F14FF130F0007B5FCB6FCA2147F13F0EAF800C7FCB3B3B3 A6007FB712FEA52F4E76CD43>II<91380FFFC091B5 12FC0107ECFF80011F15E090263FF8077F9026FF800113FC4848C76C7ED803F86E7E4916 80D807FC8048B416C080486D15E0A4805CA36C17C06C5B6C90C75AD801FC1680C9FC4C13 005FA24C5A4B5B4B5B4B13C04B5BDBFFFEC7FC91B512F816E016FCEEFF80DA000713E003 0113F89238007FFE707E7013807013C018E07013F0A218F8A27013FCA218FEA2EA03E0EA 0FF8487E487E487EB57EA318FCA25E18F891C7FC6C17F0495C6C4816E001F04A13C06C48 4A1380D80FF84A13006CB44A5A6CD9F0075BC690B612F06D5D011F1580010302FCC7FCD9 001F1380374F7ACD43>I<177C17FEA2160116031607160FA2161F163F167FA216FF5D5D A25D5DED1FBFED3F3F153E157C15FCEC01F815F0EC03E01407EC0FC01580EC1F005C147E 147C5C1301495A495A5C495A131F49C7FC133E5B13FC485A5B485A1207485A485A90C8FC 123E127E5ABA12C0A5C96C48C7FCAF020FB712C0A53A4F7CCE43>III<121F7F7FEBFF8091B81280A45A1900606060A2606060485F0180C86C C7FC007EC95A4C5A007C4B5A5F4C5A160F4C5A484B5A4C5A94C8FC16FEC812014B5A5E4B 5A150F4B5AA24B5AA24B5A15FFA24A90C9FCA25C5D1407A2140FA25D141FA2143FA4147F 5DA314FFA55BAC6D5BA2EC3FC06E5A395279D043>I<913807FFC0027F13FC0103B67E01 0F15E090261FFC0113F8903A3FE0003FFCD97F80EB0FFE49C76C7E48488048486E138000 0717C04980120F18E0177FA2121F7FA27F7F6E14FF02E015C014F802FE4913806C7FDBC0 0313009238F007FE6C02F85B9238FE1FF86C9138FFBFF06CEDFFE017806C4BC7FC6D806D 81010F15E06D81010115FC010781011F81491680EBFFE748018115C048D9007F14E04848 011F14F048487F48481303030014F8484880161F4848020713FC1601824848157F173FA2 171FA2170FA218F8A27F007F17F06D151FA26C6CED3FE0001F17C06D157F6C6CEDFF806C 6C6C010313006C01E0EB0FFE6C01FCEBFFFC6C6CB612F06D5D010F1580010102FCC7FCD9 000F13C0364F7ACD43>I<91380FFF8091B512F8010314FE010F6E7E4901037F90267FF8 007F4948EB3FF048496D7E484980486F7E484980824817805A91C714C05A7013E0A218F0 B5FCA318F8A618FCA46C5DA37EA25E6C7F6C5DA26C5D6C7F6C6D137B6C6D13F390387FF8 03011FB512E36D14C30103028313F89039007FFE03EC00401500A218F05EA3D801F816E0 487E486C16C0487E486D491380A218005E5F4C5A91C7FC6C484A5A494A5A49495B6C4849 5BD803FC010F5B9027FF807FFEC7FC6C90B55A6C6C14F06D14C0010F49C8FC010013F036 4F7ACD43>I<171F4D7E4D7EA24D7EA34C7FA24C7FA34C7FA34C7FA24C7FA34C8083047F 80167E8304FE804C7E03018116F8830303814C7E03078116E083030F814C7E031F811680 83033F8293C77E4B82157E8403FE824B800201835D840203834B800207835D844AB87EA2 4A83A3DA3F80C88092C97E4A84A2027E8202FE844A82010185A24A820103854A82010785 A24A82010F855C011F717FEBFFFCB600F8020FB712E0A55B547BD366>65 DI<932601FFFCEC01C0047F D9FFC013030307B600F81307033F03FE131F92B8EA803F0203DAE003EBC07F020F01FCC7 383FF0FF023F01E0EC0FF94A01800203B5FC494848C9FC4901F882494982494982494982 4949824990CA7E494883A2484983485B1B7F485B481A3FA24849181FA3485B1B0FA25AA2 98C7FC5CA2B5FCAE7EA280A2F307C07EA36C7FA21B0F6C6D1980A26C1A1F6C7F1C006C6D 606C6D187EA26D6C606D6D4C5A6D6D16036D6D4C5A6D6D4C5A6D01FC4C5A6D6DEE7F806D 6C6C6C4BC7FC6E01E0EC07FE020F01FEEC1FF80203903AFFE001FFF0020091B612C0033F 93C8FC030715FCDB007F14E0040101FCC9FC525479D261>IIII<9326 01FFFCEC01C0047FD9FFC013030307B600F81307033F03FE131F92B8EA803F0203DAE003 EBC07F020F01FCC7383FF0FF023F01E0EC0FF94A01800203B5FC494848C9FC4901F88249 49824949824949824949824990CA7E494883A2484983485B1B7F485B481A3FA24849181F A3485B1B0FA25AA298C8FC5CA2B5FCAE6C057FB712E0A280A36C94C7003FEBC000A36C7F A36C7FA27E6C7FA26C7F6C7FA26D7E6D7F6D7F6D6D5E6D7F6D01FC93B5FC6D13FF6D6C6D 5C6E01F0EC07FB020F01FEEC1FF10203903AFFF001FFE0020091B6EAC07F033FEE001F03 0703FC1307DB007F02E01301040149CAFC5B5479D26A>III76 DI<93380FFFC00303B6FC031F15E092B712FC0203D9FC0013FF020F01C0010F13C002 3F90C7000313F0DA7FFC02007F494848ED7FFE4901E0ED1FFF49496F7F49496F7F4990C9 6C7F49854948707F4948707FA24849717E48864A83481B804A83481BC0A2481BE04A83A2 481BF0A348497113F8A5B51AFCAF6C1BF86E5FA46C1BF0A26E5F6C1BE0A36C6D4D13C0A2 6C6D4D1380A26C1B006C6D4D5A6E5E6C626D6C4C5B6D6D4B5B6D6D4B5B6D6D4B5B6D6D4B 5B6D6D4B90C7FC6D6D4B5A6D01FF02035B023F01E0011F13F0020F01FC90B512C0020390 B7C8FC020016FC031F15E0030392C9FCDB001F13E0565479D265>79 DI82 D<91260FFF80130791B500F8 5B010702FF5B011FEDC03F49EDF07F9026FFFC006D5A4801E0EB0FFD4801800101B5FC48 48C87E48488149150F001F824981123F4981007F82A28412FF84A27FA26D82A27F7F6D93 C7FC14C06C13F014FF15F86CECFF8016FC6CEDFFC017F06C16FC6C16FF6C17C06C836C83 6D826D82010F821303010082021F16801400030F15C0ED007F040714E01600173F050F13 F08383A200788200F882A3187FA27EA219E07EA26CEFFFC0A27F6D4B13806D17006D5D01 FC4B5A01FF4B5A02C04A5A02F8EC7FF0903B1FFFC003FFE0486C90B65AD8FC0393C7FC48 C66C14FC48010F14F048D9007F90C8FC3C5479D24B>I<003FBC1280A59126C0003F9038 C0007F49C71607D87FF8060113C001E08449197F49193F90C8171FA2007E1A0FA3007C1A 07A500FC1BE0481A03A6C994C7FCB3B3AC91B912F0A553517BD05E>II89 D97 DI<913801FFF8021FEBFF8091B612F0010315FC010F9038C00FFE 903A1FFE0001FFD97FFC491380D9FFF05B4817C048495B5C5A485BA2486F138091C7FC48 6F1300705A4892C8FC5BA312FFAD127F7FA27EA2EF03E06C7F17076C6D15C07E6E140F6C EE1F806C6DEC3F006C6D147ED97FFE5C6D6CEB03F8010F9038E01FF0010390B55A010015 80023F49C7FC020113E033387CB63C>I<4DB47E0407B5FCA5EE001F1707B3A4913801FF E0021F13FC91B6FC010315C7010F9038E03FE74990380007F7D97FFC0101B5FC49487F48 49143F484980485B83485B5A91C8FC5AA3485AA412FFAC127FA36C7EA37EA26C7F5F6C6D 5C7E6C6D5C6C6D49B5FC6D6C4914E0D93FFED90FEFEBFF80903A0FFFC07FCF6D90B5128F 0101ECFE0FD9003F13F8020301C049C7FC41547CD24B>I<913803FFC0023F13FC49B6FC 010715C04901817F903A3FFC007FF849486D7E49486D7E4849130F48496D7E4817804849 7F18C0488191C7FC4817E0A248815B18F0A212FFA490B8FCA318E049CAFCA6127FA27F7E A218E06CEE01F06E14037E6C6DEC07E0A26C6DEC0FC06C6D141F6C6DEC3F806D6CECFF00 D91FFEEB03FE903A0FFFC03FF8010390B55A010015C0021F49C7FC020113F034387CB63D >IIII<137F497E000313E0487FA2487FA76C5BA26C5BC613806DC7FC90C8FCADEB3FF0B5FC A512017EB3B3A6B612E0A51B547BD325>I107 DIII<913801FFE0021F13FE91B612C0010315 F0010F9038807FFC903A1FFC000FFED97FF86D6C7E49486D7F48496D7F48496D7F4A147F 48834890C86C7EA24883A248486F7EA3007F1880A400FF18C0AC007F1880A3003F18006D 5DA26C5FA26C5F6E147F6C5F6C6D4A5A6C6D495B6C6D495B6D6C495BD93FFE011F90C7FC 903A0FFF807FFC6D90B55A010015C0023F91C8FC020113E03A387CB643>I<903A3FF001 FFE0B5010F13FE033FEBFFC092B612F002F301017F913AF7F8007FFE0003D9FFE0EB1FFF C602806D7F92C76C7F4A824A6E7F4A6E7FA2717FA285187F85A4721380AC1A0060A36118 FFA2615F616E4A5BA26E4A5B6E4A5B6F495B6F4990C7FC03F0EBFFFC9126FBFE075B02F8 B612E06F1480031F01FCC8FC030313C092CBFCB1B612F8A5414D7BB54B>I<90397FE003 FEB590380FFF80033F13E04B13F09238FE1FF89139E1F83FFC0003D9E3E013FEC6ECC07F ECE78014EF150014EE02FEEB3FFC5CEE1FF8EE0FF04A90C7FCA55CB3AAB612FCA52F367C B537>114 D<903903FFF00F013FEBFE1F90B7FC120348EB003FD80FF81307D81FE01301 48487F4980127F90C87EA24881A27FA27F01F091C7FC13FCEBFFC06C13FF15F86C14FF16 C06C15F06C816C816C81C681013F1580010F15C01300020714E0EC003F030713F0150100 78EC007F00F8153F161F7E160FA27E17E07E6D141F17C07F6DEC3F8001F8EC7F0001FEEB 01FE9039FFC00FFC6DB55AD8FC1F14E0D8F807148048C601F8C7FC2C387CB635>I<143E A6147EA414FEA21301A313031307A2130F131F133F13FF5A000F90B6FCB8FCA426003FFE C8FCB3A9EE07C0AB011FEC0F8080A26DEC1F0015806DEBC03E6DEBF0FC6DEBFFF86D6C5B 021F5B020313802A4D7ECB34>III I<007FB500F090387FFFFEA5C66C48C7000F90C7FC6D6CEC07F86D6D5C6D6D495A6D4B5A 6F495A6D6D91C8FC6D6D137E6D6D5B91387FFE014C5A6E6C485A6EEB8FE06EEBCFC06EEB FF806E91C9FCA26E5B6E5B6F7E6F7EA26F7F834B7F4B7F92B5FCDA01FD7F03F87F4A486C 7E4A486C7E020F7FDA1FC0804A486C7F4A486C7F02FE6D7F4A6D7F495A49486D7F01076F 7E49486E7E49486E7FEBFFF0B500FE49B612C0A542357EB447>II E %EndDVIPSBitmapFont %DVIPSBitmapFont: Fo cmbx12 20.736 17 /Fo 17 120 df69 D<96267FFFE01670063FB6ED01F80503B700F01403053F04FC14074CB96C130F040706E0 131F043F72133F93BA00FC137F0303DC00076D13FF030F03C09039003FFF814B02FCC800 0713C3037F02E0030113F792B600806F6CB5FC02034ACA121F4A02F8834A02E0834A4A17 01027F4A8391B548CC7E494A85495C4C854988494A85494A85495C8A4991CDFC90B54886 A2484A1B7FA2481E3F5D481E1F5D5A1F0FA2485CA3481E075DA2795A489BC9FCA45DA2B6 FCB27EA26F0403BA12C0A47EA3816C96C8000302F8C7FCA36C80A36C80A27E817E817E81 7F6D80827F6D806D806D80826D6E606D806E80021F6E5F6E02F05F6E806E02FE5F0200DA FFC05E6F02F04BB6FC031F02FE030713CF6FDAFFE0021F138703039226FF8003B5120103 0093B6EAFC00043F4E133F040706E0131F04014E1307DC003F4CC71201050304F8EC0070 DD003F038092C8FCDE007F01F0CCFC827A75F798>71 D76 DI80 D<922603FFF8150E037FD9FFC0 143F0203B600FC5C021F03FF5C027FEEC00149B8EAF00349EFFC07010FDA000F13FE4901 F09039007FFF8F4901C0020F13DF4990C8000390B5FC494815004801F8163F48844A8248 498248844A8248844A834885A291CB7E5A86A286B5FC8680A28680A280A26E8380806E18 7E6E95C7FC6C8015E015FCEDFFC06C15FCEEFFE06C16FF18F06CEFFF8019F06C18FE737E 6C856C19F06C19FC6D846D846D856D856D850101856D85023F846E841407020084031F18 801500040F17C0EE007F050716E0EF003F1803DE007F14F0191F8585070114F8A2858600 7E85B4FC86A286A37F86A36D1AF0A37F1CE06D60A26D1AC06D607F6D1A806E5F6E4D1300 6E606E17FF02FC4C5B02FF4C5B03E04B5B03FC031F5B01FBD9FF80027F5B01F102FE0107 B55AD9E07F90B8C7FC6E17FCD9C00F5FD9800317E090C76C168048020F4BC8FC48020015 F00070030349C9FC557A75F76C>83 D<92383FFFF80207B612E0027F15FC49B87E010717 E0011F83499026F0007F13FC4948C7000F7F90B502036D7E486E6D806F6D80727F486E6E 7F8486727FA28684A26C5C72806C5C6D90C8FC6D5AEB0FF8EB03E090CAFCA70507B6FC04 1FB7FC0303B8FC157F0203B9FC021FECFE0391B612800103ECF800010F14C04991C7FC01 7F13FC90B512F04814C0485C4891C8FC485B5A485B5C5A5CA2B5FC5CA360A36E5DA26C5F 6E5D187E6C6D846E4A48806C6D4A4814FC6C6ED90FF0ECFFFC6C02E090263FE07F14FE00 019139FC03FFC06C91B6487E013F4B487E010F4B1307010303F01301D9003F0280D9003F 13FC020101F8CBFC57507ACE5E>97 D<93383FFFF00307B612C0033F15F84AB712FE0207 707E021F17E0027F8391B526FC001F7F010302C001037F4991C7487F49495C495B4901F0 4A7F5B90B55A485CA2485C4891C8FCA248715B5C48715B725B4A6F5B489438007FC0071F C7FC96C8FC5AA25CA3B5FCAF7E80A47E80A27E806CF11F80F23FC06C6E167FA26C6EEEFF 80816C606C6E17006D6D4B5A6D6D15076D6D4B5A6D6D6C4A5A6D02E0EC7FF06D02F84948 5A01009126FF801F5B6E91B6C7FC021F5E020716F8020116E06E6C1580030702FCC8FCDB 003F13804A507ACE56>99 D<97380FFFE00607B6FCA8F00003190086B3AD93383FFF8003 07B512F8033F14FF4AB712C0020716F0021F16FC027F9039FE007FFE91B500F0EB0FFF01 030280010190B5FC4949C87E49498149498149498149498190B548814884484A8192CAFC 5AA2485BA25A5C5AA35A5CA4B5FCAF7EA4807EA37EA2807EA26C7F616C6E5D6C606C8061 6D6D5D6D6D5D6D6D92B67E6D6D4A15FC010301FF0207EDFFFE6D02C0EB3FFE6D6C9039FC 01FFF86E90B65A020F16C002031600DA007F14FC030F14E09226007FFEC749C7FC5F797A F76C>I103 D<903801FFFCB6FCA8C67E131F7FB3AD95380FFFE095B512FE05036E7E050F15E0053F15 F84D81932701FFF01F7F4CD900077FDC07FC6D80DC0FF06D80DC1FC07F4C48824CC8FC04 7E6F7F5EEDFDF85E03FF707F5EA25EA25EA293C9FCA45DB3B3A6B8D8E003B81280A86178 79F76C>II<902601FFF891260FFFE093383FFF80B692B500FE0303B512F8 05036E6C020F14FE050F03E0023F6E7E053F03F891B712E04D6F4982932701FFF01F6D01 07D9C07F7F4CD900076D90270FFC001F7FDC07FC6D9126801FF06D7FC66CDA0FF06D9126 C03FC06D7F011FDA1FC06D4BC77E6D4A48DCE0FE834CC8ECE1FC047E6FD9F1F86E804CEF F3F0DBF9F8EFF7E04C6003FB7001FF6F804C6015FF4C95C9FCA24C5FA293C95CA44B60B3 B3A6B8D8E003B8D8800FB712FEA8974E79CDA2>109 D<902601FFF891380FFFE0B692B5 12FE05036E7E050F15E0053F15F84D81932701FFF01F7F4CD900077FDC07FC6D80C66CDA 0FF06D80011FDA1FC07F6D4A48824CC8FC047E6F7F5EEDF9F85E03FB707F5E15FF5EA25E A293C9FCA45DB3B3A6B8D8E003B81280A8614E79CD6C>I<912603FFFCEB0780027F9039 FFE00FC00103B6EAF83F010FEDFEFF013F92B5FC49EB000F2601FFF01300480180143F48 90C8120F4848814848814981123F83485A187FA212FF6D163FA37F7F6DEE1F8002C092C7 FC14F014FEECFFF06CECFF8016FEEEFFE06C16FC6C16FF18C06C836C17F86C836C836C83 013F17806D17C0010717E0010117F0EB003F020716F8EC001F030015FC1607EE007F051F 13FE1707007E82B482836D167FA2183F7F181FA27F19FC7FA26D163F6D17F86D167F19F0 6D16FF6E4A13E002E04A13C06E4A138002FE023F1300913AFFC003FFFE01E790B65A01C3 16F0018016C026FE003F92C7FC48010714F80070D9007F90C8FC3F507ACE4C>115 D<15FFA75CA55CA45CA25CA25CA25CA25C91B5FCA25B5B5B131F5B90B9FC120FBAFCA6D8 000791C9FCB3B3A3F01FE0AE183F7014C07F187F7014806D16FF826D4B13006E6D485AEE FE0F6E90B55A020F5D6E5D020115C06E6C5C031F49C7FC030113F03B6E7CEC4B>I119 D E %EndDVIPSBitmapFont end %%EndProlog %%BeginSetup %%Feature: *Resolution 600dpi TeXDict begin %%PaperSize: A4 %%EndSetup %%Page: 1 1 1 0 bop 150 1318 a Fo(Editing)66 b(SGML)e(with)h(Emacs)g(and)f(PSGML)p 150 1418 3600 34 v 150 5091 a Fn(Lennart)45 b(Sta\015in)p 150 5141 3600 17 v eop %%Page: 2 2 2 1 bop 150 4371 a Fm(Cop)m(yrigh)m(t)602 4368 y(c)577 4371 y Fl(\015)30 b Fm(1994,)j(1996,)f(1998)g(Lennart)e(Sta\015in)150 4505 y(P)m(ermission)g(is)i(gran)m(ted)h(to)f(mak)m(e)i(and)d (distribute)f(v)m(erbatim)i(copies)g(of)g(this)f(man)m(ual)h(pro)m (vided)f(the)150 4615 y(cop)m(yrigh)m(t)g(notice)f(and)g(this)f(p)s (ermission)f(notice)i(are)h(preserv)m(ed)f(on)h(all)e(copies.)150 4749 y(P)m(ermission)36 b(is)i(gran)m(ted)g(to)h(cop)m(y)g(and)f (distribute)e(mo)s(di\014ed)g(v)m(ersions)h(of)i(this)e(man)m(ual)g (under)g(the)150 4859 y(conditions)k(for)h(v)m(erbatim)g(cop)m(ying,)k (and)c(pro)m(vided)f(that)i(the)f(en)m(tire)g(resulting)f(deriv)m(ed)g (w)m(ork)i(is)150 4969 y(distributed)27 b(under)i(the)i(terms)f(of)h(a) f(p)s(ermission)e(notice)i(iden)m(tical)f(to)j(this)d(one.)150 5103 y(P)m(ermission)i(is)i(gran)m(ted)g(to)h(cop)m(y)g(and)f (distribute)d(translations)i(of)i(this)e(man)m(ual)g(in)m(to)h(another) g(lan-)150 5213 y(guage,)d(under)e(the)g(ab)s(o)m(v)m(e)i(conditions)d (for)i(mo)s(di\014ed)d(v)m(ersions,)j(except)g(that)h(this)d(p)s (ermission)f(notice)150 5322 y(ma)m(y)31 b(b)s(e)f(stated)h(in)e(a)i (translation)e(appro)m(v)m(ed)i(b)m(y)f(the)h(F)-8 b(ree)31 b(Soft)m(w)m(are)h(F)-8 b(oundation.)p eop %%Page: 1 3 1 2 bop 150 -116 a Fm(Chapter)30 b(1:)41 b(In)m(tro)s(duction)2591 b(1)150 299 y Fk(1)80 b(In)l(tro)t(duction)275 533 y Fm(PSGML)32 b(is)f(a)i(ma)5 b(jor)32 b(mo)s(de)g(for)g(editing)f(SGML)i (and)e(XML)i(do)s(cumen)m(ts.)46 b(It)33 b(w)m(orks)f(with)f(GNU)150 643 y(Emacs)39 b(19.34,)k(20.3)d(and)e(later)h(or)f(with)g(XEmacs)h (19.9)h(and)e(later.)66 b(PSGML)38 b(con)m(tains)h(a)g(simple)150 752 y(SGML)33 b(parser)g(and)g(can)h(w)m(ork)g(with)e(an)m(y)i(DTD.)g (F)-8 b(unctions)33 b(pro)m(vided)f(includes)f(men)m(us)i(and)g(com-) 150 862 y(mands)g(for)h(inserting)e(tags)j(with)e(only)h(the)g(con)m (textually)g(v)-5 b(alid)33 b(tags,)j(iden)m(ti\014cation)d(of)h (structural)150 971 y(errors,)f(editing)f(of)h(attribute)g(v)-5 b(alues)33 b(in)e(a)j(separate)g(windo)m(w)d(with)h(information)g(ab)s (out)g(t)m(yp)s(es)i(and)150 1081 y(defaults,)c(and)f(structure)h (based)g(editing.)275 1215 y(SGML,)48 b(a)g(language)h(for)f(enco)s (ding)f(the)i(structure)e(of)i(a)f(do)s(cumen)m(t,)53 b(is)47 b(an)h(ISO)g(standard:)150 1325 y(ISO)33 b(8879:1986)38 b(\\Information)c(pro)s(cessing)f({)i(T)-8 b(ext)35 b(and)e(o\016ce)i (systems)g({)f(Standard)f(Generalized)150 1435 y(Markup)d(Language)h (\(SGML\)".)275 1569 y(A)39 b(go)s(o)s(d)g(in)m(tro)s(duction)e(to)j (SGML)f(is)f Fj(A)h(Gen)m(tle)h(In)m(tro)s(duction)e(to)i(SGML)f Fm(pro)s(duced)e(b)m(y)i(T)-8 b(ext)150 1679 y(Enco)s(ding)29 b(Initiativ)m(e)g(\(this)h(is)f(really)g(c)m(hapter)i(2)g(of)g(TEI)e (P3\).)42 b(This)28 b(can)j(b)s(e)f(found)f(on)390 1807 y(`)p Fi(ftp://ftp.ifi.uio.no/pub/)o(SGML)o(/TEI)o(/P3)o(SG.D)o(OC)p Fm('.)275 1942 y(A)h(SGML)g(do)s(cumen)m(t)h(has)f(three)g(ma)5 b(jor)31 b(parts,)f(in)f(order:)199 2076 y(1.)61 b(SGML)30 b(Declaration)h(\(`)p Fi()p Fm('\))199 2211 y(2.)61 b(Do)s(cumen)m(t)31 b(T)m(yp)s(e)f(Declaration) h(\(`)p Fi()p Fm('\))199 2345 y(3.)61 b(Do)s(cumen)m(t)31 b(Elemen)m(t)f(\(`)p Fi(<)p Fj(name)5 b Fi(>)31 b(...)f()p Fm('\))275 2505 y(The)27 b(SGML)i(declaration)f(con)m(tains)g(general)g (information)f(ab)s(out)h(c)m(haracter)i(sets,)g(concrete)f(syn-)150 2614 y(tax,)44 b(and)c(SGML)h(features)g(used.)71 b(PSGML)40 b(do)s(es)h(not)f(use)h(the)g(SGML)f(Declaration,)k(it)d(can)g(b)s(e) 150 2724 y(left)g(out,)k(and)c(if)g(included)e(is)i(ignored.)73 b(Man)m(y)43 b(SGML)e(systems)h(allo)m(w)f(the)h(SGML)f(declaration)150 2834 y(to)e(b)s(e)e(defaulted.)62 b(PSGML)37 b(alw)m(a)m(ys)i(use)e (the)h(Concrete)h(Reference)f(Syn)m(tax)g(but)g(without)e(limita-)150 2943 y(tions)d(on)h(lengths.)50 b(F)-8 b(eatures)35 b(used)e(has)h(to)g (b)s(e)f(indicated)g(with)f(v)-5 b(ariables)33 b(\(see)h(Chapter)g(6)g ([SGML)150 3053 y(declaration],)c(page)i(7\).)275 3187 y(The)j(do)s(cumen)m(t)g(t)m(yp)s(e)h(declaration)f(sp)s(eci\014es)f (the)h(v)-5 b(alid)34 b(elemen)m(ts)i(and)f(en)m(tities)g(and)g(ho)m(w) h(they)150 3297 y(can)43 b(b)s(e)f(nested.)76 b(A)43 b(do)s(cumen)m(t)f(t)m(yp)s(e)h(is)e(usually)f(needed,)46 b(but)c(can)g(reside)g(in)f(another)h(\014le)g(\(see)150 3406 y(Chapter)30 b(7)h([Managing)g(the)f(DTD],)h(page)h(8\).)275 3541 y(The)d(system)i(declaration)f(for)g(PSGML:)390 3670 y Fi(SYSTEM)46 b("ISO)h(8879:1986")533 3773 y(CHARSET)629 3877 y(BASESET)93 b("ISO)47 b(646-1983//CHARSET)1106 3981 y(International)d(Reference)h(Version)h(\(IRV\)//ESC)f(2/5)i(4/0") 629 4085 y(DESCSET)93 b(0)48 b(128)f(0)629 4188 y(CAPACITY)e(PUBLIC)94 b("ISO)47 b(8879:1986//CAPACITY)42 b(Reference//EN")533 4292 y(FEATURES)629 4396 y(MINIMIZE)j(DATATAG)h(NO)95 b(OMITTAG)e(YES)143 b(RANK)237 b(NO)95 b(SHORTTAG)46 b(YES)629 4500 y(LINK)237 b(SIMPLE)94 b(NO)h(IMPLICIT)45 b(NO)191 b(EXPLICIT)45 b(NO)629 4604 y(OTHER)189 b(CONCUR)94 b(NO)h(SUBDOC)141 b(YES)47 b(1)h(FORMAL)141 b(YES)629 4707 y(SCOPE)189 b(DOCUMENT)629 4811 y(SYNTAX)141 b(PUBLIC)94 b("ISO)47 b(8879:1986//SYNTAX)c(Reference//EN")629 4915 y(VALIDATE)1058 5019 y(GENERAL)j(NO)95 b(MODEL)189 b(NO)143 b(EXCLUDE)94 b(NO)h(CAPACITY)45 b(NO)1058 5122 y(NONSGML)h(NO)95 b(SGML)237 b(NO)143 b(FORMAL)f(NO)629 5226 y(SDIF)237 b(PACK)190 b(NO)95 b(UNPACK)141 b(NO)p eop %%Page: 2 4 2 3 bop 150 -116 a Fm(Chapter)30 b(2:)41 b(Installing)28 b(PSGML)2364 b(2)150 299 y Fk(2)80 b(Installing)56 b(PSGML)275 533 y Fm(T)-8 b(o)30 b(install)f(PSGML)h(y)m(ou)h(\014rst)e(need)h(to)i (uncompress)d(and)h(unpac)m(k)g(the)g(source)h(arc)m(hiv)m(e.)41 b(This)29 b(is)150 643 y(done)h(with)f(the)i Fi(gunzip)d Fm(and)i Fi(tar)g Fm(commands.)390 771 y Fi(gunzip)46 b(psgml-1.2.0.tar.gz;)d(tar)k(xf)g(psgml-1.2.0.tar)275 906 y Fm(This)33 b(should)g(create)k(a)f(sub)s(directory)d(to)j(the)g (curren)m(t)f(directory)g(with)f(the)h(source)h(co)s(de.)56 b(This)150 1015 y(directory)22 b(con)m(tains)i(a)f Fi(configure)d Fm(command)j(\(see)h(the)f(\014le)f(INST)-8 b(ALL)22 b(for)h(more)g(information)e(ab)s(out)150 1125 y(con\014gure\).)41 b(Y)-8 b(ou)29 b(can)h(use)f(the)h Fi(configure)d Fm(command)i(to)h (con\014gure)f(the)h(pac)m(k)-5 b(age)31 b(or)f(y)m(ou)g(can)f(load)150 1235 y(the)i(\014le)e(`)p Fi(psgml-maint)p Fm(')f(and)i(execute)h(the)g Fi(psgml-compile-files)25 b Fm(command.)275 1369 y(Place)k(the)g(`)p Fi(*.el)p Fm(')f(and)g(the)h(`)p Fi(*.elc)p Fm(')f(\014les)g(in)g(a)h (directory)g(where)f(Emacs)h(can)g(\014nd)f(it)g(\(i.e.)41 b(one)29 b(of)150 1479 y(the)j(directories)f(in)g(the)h Fi(load-path)d Fm(v)-5 b(ariable,)32 b(y)m(ou)g(can)g(add)f(a)i (directory)e(to)i(this)e(v)-5 b(ariable)30 b(in)h(y)m(our)150 1588 y(`)p Fi(.emacs)p Fm('.\))275 1723 y(If)c(y)m(ou)i(use)f(the)g Fi(configure)e Fm(approac)m(h,)j(compile)e(psgml)g(with)g Fi(make)g Fm(and)h(the)g(y)m(ou)h(can)f(run)f Fi(make)150 1832 y(install)38 b Fm(to)j(install)d(it)i(in)f(the)h(system)g(library) e(`)p Fi(site-lisp)p Fm('.)68 b(The)40 b(lo)s(cation)f(of)i(`)p Fi(site-lisp)p Fm(')d(is)150 1942 y(\014gured)29 b(out)i(b)m(y)f Fi(configure)p Fm(,)e(but)i(y)m(ou)h(can)f(c)m(hange)i(it)e(in)f(the)h (`)p Fi(Makefile)p Fm('.)275 2076 y(Put)g(the)g(follo)m(wing)f(line)g (in)g(y)m(our)h(.emacs:)390 2205 y Fi(\(autoload)45 b('sgml-mode)g ("psgml")h("Major)g(mode)h(to)g(edit)g(SGML)f(files.")g(t\))390 2309 y(\(autoload)f('xml-mode)h("psgml")f("Major)h(mode)h(to)g(edit)g (XML)g(files.")f(t\))275 2443 y Fm(Y)-8 b(ou)36 b(ma)m(y)g(also)f(w)m (an)m(t)i(to)f(set)g(up)f(searc)m(h)h(paths)f(for)g(external)h(en)m (tities,)h(See)f(Chapter)f(4)g([En)m(tit)m(y)150 2553 y(manager],)c(page)h(4.)275 2687 y(The)i(`)p Fi(psgml.info)p Fm(')f(is)h(the)h(do)s(cumen)m(tation)g(for)g(PSGML)f(in)g(the)h(info)f (format.)55 b(Y)-8 b(ou)36 b(can)f(read)150 2797 y(this)28 b(with)g(the)h(Emacs)h(command)f Fh(C-u)g(C-h)h(i)p Fm(.)40 b(Y)-8 b(ou)29 b(can)h(also)f(install)e(the)j(\014le)e(in)g(y)m(our)h (systems)g(info)150 2907 y(directory)h(and)g(edit)f(the)i(`)p Fi(dir)p Fm(')f(\014le)f(to)j(include)c(`)p Fi(psgml.info)p Fm(')g(in)h(the)h(men)m(u.)275 3041 y(The)d(info)h(\014le)f(`)p Fi(psgml.info)p Fm(')f(is)h(created)j(from)d(the)i(texinfo)f(\014le)f (`)p Fi(psgml.texi)p Fm('.)38 b(The)28 b(texinfo)g(\014le)150 3151 y(can)h(also)g(b)s(e)g(used)f(to)i(create)g(a)g(hard)e(cop)m(y)i (of)f(the)g(do)s(cumen)m(tation.)40 b(T)-8 b(o)30 b(do)e(this)g(y)m(ou) i(need)f(the)g(T)3632 3170 y(E)3682 3151 y(X)150 3260 y(program)h(and)g(a)h(cop)m(y)g(of)f(`)p Fi(texinfo.tex)p Fm('.)p eop %%Page: 3 5 3 4 bop 150 -116 a Fm(Chapter)30 b(3:)41 b(Ho)m(w)31 b(to)g(in)m(v)m(ok)m(e)g(PSGML)2168 b(3)150 299 y Fk(3)80 b(Ho)l(w)53 b(to)g(in)l(v)l(ok)l(e)g(PSGML)275 533 y Fm(PSGML)38 b(de\014nes)g(ma)5 b(jor)40 b(mo)s(des)e(called)g Fi(sgml-mode)f Fm(and)h Fi(xml-mode)p Fm(.)65 b(Files)38 b(with)f(extensions)150 643 y(`)p Fi(.sgml)p Fm(',)32 b(`)p Fi(.sgm)p Fm(')g(or)g(`)p Fi(.dtd)p Fm(')f(will)f(automatically)i (b)s(e)f(edited)h(in)f(SGML)h(mo)s(de.)46 b(T)-8 b(o)32 b(edit)g(some)h(other)150 752 y(\014le)38 b(in)f(SGML)i(mo)s(de,)i(t)m (yp)s(e)e Fh(M-x)29 b(sgml-mode)1847 749 y Fg(h)p 1871 696 151 4 v 1871 752 a Ff(RET)p 1871 768 V 2018 749 a Fg(i)2086 752 y Fm(after)40 b(\014nding)c(the)j(\014le.)65 b(T)-8 b(o)39 b(edit)g(XML)g(\014les,)150 862 y(t)m(yp)s(e)31 b Fh(M-x)e(xml-mode)940 859 y Fg(h)p 964 806 V 964 862 a Ff(RET)p 964 877 V 1111 859 a Fg(i)1141 862 y Fm(.)275 996 y(If)24 b(y)m(ou)h(can)g(mo)s(dify)d(the)j(\014le)f(y)m(ou)h(can)g (add)f(a)h Fj(Lo)s(cal)f(V)-8 b(ariables)28 b Fm(list)23 b(\(see)j(section)f(\\Lo)s(cal)g(V)-8 b(ariables)150 1106 y(in)29 b(Files")h(in)f Fj(The)g(Emacs)i(Editor)7 b Fm(\))29 b(to)i(the)f(end)g(of)g(the)h(\014le.)39 b(This)29 b(can)h(mak)m(e)i(Emacs)e(automatically)150 1215 y(set)k(sgml)f(mo)s (de)g(and)g(user)g(options)f(when)h(the)h(\014le)e(is)h(loaded.)49 b(The)33 b(simplest)f(Lo)s(cal)h(V)-8 b(ariables)33 b(list)150 1325 y(w)m(ould)c(lo)s(ok)h(lik)m(e:)390 1454 y Fi()275 2003 y Fm(Y)-8 b(ou)30 b(can)h(also)f(put)g(a)h(line)e(at)i(the)f(top)h(of)f(the)h(\014le)e (to)j(tell)d(emacs)i(to)g(use)f(sgml)g(mo)s(de:)390 2132 y Fi()275 2267 y Fm(F)-8 b(or)26 b(XML)h(replace)f(`)p Fi(sgml)p Fm(')g(with)e(`)p Fi(xml)p Fm(')i(in)f(the)i(ab)s(o)m(v)m(e)g(examples.)39 b(But)26 b(remem)m(b)s(er)g(that)h(y)m(ou)f(can't)150 2376 y(ha)m(v)m(e)32 b(a)e(commen)m(t)i(b)s(efore)e(the)g Fe(SGML)j(de)-5 b(clar)g(ation)40 b Fm(or)30 b(the)h Fe(XML)h(de)-5 b(clar)g(ation)p Fm(.)p eop %%Page: 4 6 4 5 bop 150 -116 a Fm(Chapter)30 b(4:)41 b(The)30 b(En)m(tit)m(y)g (Manager)2277 b(4)150 299 y Fk(4)80 b(The)54 b(En)l(tit)l(y)f(Manager) 275 545 y Fm(SGML)35 b(can)h(refer)g(to)h(an)e(external)h(\014le)f (\(really)g(en)m(tit)m(y\))i(with)d(an)i Fe(external)j(identi\014er)p Fm(,)f(this)d(is)g(a)150 654 y Fe(public)e(identi\014er)40 b Fm(or)31 b(a)f Fe(system)k(identi\014er)p Fm(,)d(or)f(b)s(oth.)275 793 y(A)g(t)m(ypical)g(public)e(iden)m(ti\014er)g(lo)s(oks)i(lik)m(e) 390 926 y Fi(PUBLIC)46 b("ISO)h(8879:1986//ENTITIES)42 b(Added)47 b(Latin)f(1//EN")150 1064 y Fm(where)33 b(\\ISO)g (8879:1986")38 b(is)33 b(the)g(o)m(wner,)i(\\ENTITIES")e(is)f(the)i (text)h(class)e(and)g(\\Added)g(Latin)g(1")150 1174 y(is)c(the)i(text)g (description)e(\(and)h(\\EN")h(is)f(language\).)275 1312 y(A)g(system)h(iden)m(ti\014er)d(lo)s(oks)i(lik)m(e)390 1445 y Fi(SYSTEM)46 b("htmlplus.dtd")150 1583 y Fm(where)30 b(\\h)m(tmlplus.dtd")e(is)i(a)g(system-sp)s(eci\014c)g(iden)m (ti\014er.)275 1722 y(T)-8 b(o)31 b(map)g(external)h(iden)m(ti\014ers)d (to)j(\014le)f(names,)h(PSGML)f(\014rst)g(searc)m(hes)h(en)m(tit)m(y)g (catalog)h(\014les)e(and)150 1831 y(then)f(searc)m(h)h(the)g(list)e(of) h(\014le)g(name)g(templates)h(in)e(the)h(v)-5 b(ariable)30 b Fi(sgml-public-map)p Fm(.)275 1970 y(The)24 b(catalog)k(format)d(is)g (according)g(to)h(SGML/Op)s(ens)f(resolution)f(on)h(en)m(tit)m(y)h (managemen)m(t.)40 b(The)150 2079 y(catalog)30 b(consists)e(of)h(a)f (series)g(of)h(en)m(tries)f(and)g(commen)m(ts.)41 b(A)28 b(commen)m(t)i(is)d(delimited)f(b)m(y)i(`)p Fi(--)p Fm(')h(lik)m(e)e (in)150 2189 y(a)k(markup)e(declaration.)40 b(The)30 b(en)m(try)h(t)m(yp)s(es)f(recognized)h(are)g(describ)s(ed)d(in)h(the)h (follo)m(wing)f(table.)150 2354 y(`)p Fi(public)g Fj(pubid)i(\014le)5 b Fm(')630 2464 y(The)34 b Fj(\014le)k Fm(will)31 b(b)s(e)j(used)f(for) h(the)g(en)m(tit)m(y)h(text)g(of)f(an)g(en)m(tit)m(y)h(with)e(the)h (public)e(iden)m(ti\014er)630 2573 y Fj(pubid)p Fm(.)150 2737 y(`)p Fi(entity)d Fj(name)35 b(\014le)5 b Fm(')630 2846 y(The)26 b Fj(\014le)31 b Fm(will)25 b(b)s(e)h(used)g(for)g(the)h (en)m(tit)m(y)h(text)g(of)f(an)g(en)m(tit)m(y)g(with)f(the)h(name)g Fj(name)p Fm(.)39 b(If)27 b(the)630 2956 y Fj(name)35 b Fm(starts)30 b(with)e(a)j(`)p Fi(\045)p Fm(')e(the)h(rest)g(of)g(the) g(name)g(will)d(b)s(e)i(matc)m(hed)h(against)g(parameter)630 3066 y(en)m(tities.)150 3229 y(`)p Fi(doctype)f Fj(name)35 b(\014le)5 b Fm(')630 3339 y(The)31 b Fj(\014le)36 b Fm(will)29 b(b)s(e)i(used)g(for)g(the)h(en)m(tit)m(y)h(text)f(of)g(an)g (en)m(tit)m(y)g(used)f(as)h(external)g(subset)f(of)630 3448 y(a)g(do)s(cumen)m(t)f(declaration)g(with)f Fj(name)35 b Fm(as)c(do)s(cumen)m(t)f(t)m(yp)s(e)h(name.)150 3612 y(`)p Fi(sgmldecl)d Fj(\014le)5 b Fm(')630 3721 y(Used)32 b(to)h(sp)s(ecify)d(a)j(default)e(SGML)h(declaration.)45 b(Recognized)33 b(but)e(not)h(used)f(b)m(y)h(PS-)630 3831 y(GML)e(other)g(than)f(to)h(pass)f(to)i(an)e(external)g(v)-5 b(alidation)28 b(command)h(\()p Fi(sgml-validate-)630 3940 y(command)p Fm(\).)275 4106 y(When)i(PSGML)h(is)g(lo)s(oking)f (for)h(the)g(\014le)f(con)m(taining)h(an)g(external)g(en)m(tit)m(y)-8 b(,)34 b(the)e(follo)m(wing)f(things)150 4215 y(will)d(b)s(e)h(tried)h (in)f(order:)199 4409 y(1.)61 b(T)-8 b(ry)28 b(the)h(system)g(iden)m (ti\014er,)e(as)i(a)g(\014le)e(name,)i(if)f(there)h(is)e(a)i(system)g (iden)m(ti\014er)d(and)i(the)h(v)-5 b(ariable)330 4519 y Fi(sgml-system-identifiers-)o(are-)o(pref)o(err)o(ed)26 b Fm(is)32 b(non-)p Fi(nil)f Fm(and)h(there)h(is)e(no)i(elemen)m(ts)f (con-)330 4629 y(taining)d(`)p Fi(\045s)p Fm(')i(in)e Fi(sgml-public-map)p Fm(.)38 b(If)30 b(the)h(system)g(iden)m(ti\014er)e (is)h(a)h(relativ)m(e)g(\014le)f(name)g(it)h(will)330 4738 y(b)s(e)f(relativ)m(e)g(to)h(the)g(directory)f(con)m(taining)g (the)g(de\014ning)f(en)m(tit)m(y)-8 b(.)199 4875 y(2.)61 b(Lo)s(ok)33 b(thru)f(eac)m(h)i(catalog)h(in)c Fi(sgml-local-catalogs)d Fm(and)33 b Fi(sgml-catalog-files)28 b Fm(in)j(order.)330 4984 y(F)-8 b(or)31 b(eac)m(h)h(catalog)h(lo)s(ok)d(\014rst)g(for)g(en) m(tries)h(matc)m(hing)g(the)f(public)e(iden)m(ti\014er,)i(if)f(an)m(y) -8 b(.)43 b(Then)29 b(lo)s(ok)330 5094 y(for)h(other)h(matc)m(hing)f (en)m(tries)g(in)f(the)i(order)f(they)g(app)s(ear)g(in)f(the)i (catalog.)330 5230 y(Curren)m(tly)i(an)i(en)m(try)g(will)d(b)s(e)i (ignored)g(if)g(it)g(is)g(matc)m(hing)h(but)f(its)g(\014le)g(is)g (non-existen)m(t)h(or)g(un-)330 5340 y(readable.)40 b(\(This)29 b(is)h(under)e(reconsideration,)i(p)s(erhaps)f(it)h(should)e(signal)h (error)h(instead\).)p eop %%Page: 5 7 5 6 bop 150 -116 a Fm(Chapter)30 b(4:)41 b(The)30 b(En)m(tit)m(y)g (Manager)2277 b(5)199 299 y(3.)61 b(T)-8 b(ry)35 b(the)h(system)g(iden) m(ti\014er,)f(if)g(an)m(y)-8 b(,)38 b(as)e(a)g(\014le)f(name.)56 b(If)36 b Fi(sgml-system-identifiers)o(-are)o(-)330 408 y(preferred)28 b Fm(is)h Fi(nil)h Fm(and)g(there)g(is)g(no)g(elemen)m (ts)g(con)m(taining)g(`)p Fi(\045s)p Fm(')h(in)e Fi(sgml-public-map)p Fm(.)199 543 y(4.)61 b(T)-8 b(ry)40 b(the)h(en)m(tries)f(in)f Fi(sgml-public-map)p Fm(.)67 b(Using)40 b(the)h(catalogs)h(are)f (preferred.)69 b(The)40 b Fi(sgml-)330 653 y(public-map)28 b Fm(ma)m(y)j(disapp)s(ear)d(in)h(a)i(future)e(v)m(ersion)h(of)h(PSGML) f(\(not)h(so)s(on)f(though\).)275 812 y(The)f Fi(sgml-public-map)d Fm(v)-5 b(ariable)29 b(can)i(con)m(tain)g(a)f(list)f(of)i(\014le)e (name)h(templates)h(where)e(`)p Fi(\045P)p Fm(')i(will)150 922 y(b)s(e)37 b(substituted)f(with)g(the)h(whole)g(public)e(iden)m (ti\014er,)i(o)m(wner)h(is)e(substituted)g(for)h(`)p Fi(\045O)p Fm(',)i(public)c(text)150 1031 y(class)29 b(for)f(`)p Fi(\045C)p Fm(',)h(and)g(public)d(text)j(description)e(for) i(`)p Fi(\045D)p Fm('.)40 b(The)28 b(text)i(class)f(will)d(b)s(e)i(con) m(v)m(erted)i(to)g(lo)m(w)m(er)150 1141 y(case)35 b(and)f(the)g(o)m (wner)g(and)f(description)f(will)g(b)s(e)h(transliterated)g(according)i (to)f(the)h(v)-5 b(ariable)32 b Fi(sgml-)150 1250 y (public-transliterations)p Fm(.)60 b(The)39 b(templates)g(in)f(the)h (list)f(is)g(tried)g(in)f(order)i(un)m(til)e(an)i(existing)150 1360 y(\014le)33 b(is)g(found.)51 b(The)34 b Fi(sgml-public-map)c Fm(is)j(mo)s(deled)g(after)h(`)p Fi(sgmls)p Fm(')g(en)m(vironmen)m(t)f (v)-5 b(ariable)33 b Fi(SGML_)150 1469 y(PATH)d Fm(and)g(psgml)f (understand)g(the)i(follo)m(wing)f(substitution)e(c)m(haracters:)43 b(\045\045,)31 b(\045N,)g(\045P)-8 b(,)31 b(\045S,)f(\045Y,)150 1579 y(\045C,)43 b(\045L,)g(\045O,)g(\045T,)g(and)g(\045V.)h(The)f (default)f(v)-5 b(alue)43 b(of)h Fi(sgml-public-map)39 b Fm(is)j(tak)m(en)j(from)e(the)150 1689 y(en)m(vironmen)m(t)30 b(v)-5 b(ariable)29 b Fi(SGML_PATH)p Fm(.)275 1823 y(Giv)m(en)20 b(the)g(public)e(iden)m(ti\014er)g(ab)s(o)m(v)m(e)k(and)d(the)i(\014le) e(name)i(template)f(`)p Fi(/usr/local/lib/sgml/\045o/\045c/)o(\045d)p Fm(',)p 4024 1843 42 84 v 150 1933 a(the)31 b(resulting)d(\014le)i (name)g(is)390 2061 y Fi(/usr/local/lib/sgml/ISO_)o(8879)o(:198)o(6/e)o (ntit)o(ies/)o(Add)o(ed_L)o(atin)o(_1)275 2196 y Fm(Note:)58 b(blanks)37 b(are)j(transliterated)e(to)h(`)p Fi(_)p Fm(')g(\(and)f(also)h(`)p Fi(/)p Fm(')g(to)g(`)p Fi(\045)p Fm('\))g(and)g(the)f(text)i(class)f(is)e(do)m(wn)150 2306 y(cased.)3386 2540 y(User)31 b(Option)-3726 b Fd (sgml-catalog-\014les)390 2649 y Fm(This)31 b(is)h(a)h(list)e(of)i (catalog)h(en)m(try)f(\014les.)47 b(The)32 b(\014les)g(are)h(in)e(the)i (format)g(de\014ned)f(in)f(the)i(SGML)390 2759 y(Op)s(en)42 b(Draft)h(T)-8 b(ec)m(hnical)43 b(Resolution)f(on)h(En)m(tit)m(y)h (Managemen)m(t.)81 b(The)43 b(Emacs)g(v)-5 b(ariable)42 b(is)390 2868 y(initialized)31 b(from)j(the)h(en)m(vironmen)m(t)f(v)-5 b(ariable)34 b Fi(SGML_CATALOG_FILES)29 b Fm(or)35 b(if)e(this)h(v)-5 b(ariable)33 b(is)390 2978 y(unde\014ned)28 b(the)j(default)e(is)630 3107 y Fi(\("CATALOG")45 b("/usr/local/lib/sgml/CAT)o(ALOG)o("\))3386 3341 y Fm(User)31 b(Option)-3726 b Fd(sgml-lo)s(cal-catalogs)390 3450 y Fm(A)39 b(list)e(of)h(SGML)h(en)m(tit)m(y)g(catalogs)h(to)f(b)s (e)f(searc)m(hed)h(\014rst)f(when)f(parsing)g(the)i(bu\013er.)64 b(This)390 3560 y(is)30 b(used)f(in)h(addition)e(to)k Fi(sgml-catalog-files)p Fm(,)26 b(and)k Fi(sgml-public-map)p Fm(.)37 b(This)29 b(v)-5 b(ariable)29 b(is)390 3670 y(automatically)h (lo)s(cal)g(to)h(the)g(bu\013er.)3386 3904 y(User)g(Option)-3726 b Fd(sgml-system-iden)m(ti\014ers-are-preferred)390 4013 y Fm(If)21 b Fi(nil)p Fm(,)i(PSGML)e(will)e(lo)s(ok)j(up)e(external)i (en)m(tities)f(b)m(y)h(searc)m(hing)f(the)h(catalogs)i(in)c Fi(sgml-local-)390 4123 y(catalogs)i Fm(and)h Fi(sgml-catalog-files)c Fm(and)k(only)g(if)g(the)h(en)m(tit)m(y)h(is)e(not)h(found)f(in)f(the)i (catalogs)390 4232 y(will)f(a)j(giv)m(en)g(system)f(iden)m(ti\014er)f (b)s(e)h(used.)39 b(If)25 b(the)h(v)-5 b(ariable)24 b(is)h(non-nil)e (and)i(a)h(system)g(iden)m(ti\014er)390 4342 y(is)36 b(giv)m(en,)j(the)f(system)f(iden)m(ti\014er)f(will)e(b)s(e)j(used)f (for)h(the)h(en)m(tit)m(y)-8 b(.)62 b(If)37 b(no)g(system)g(iden)m (ti\014er)f(is)390 4452 y(giv)m(en)30 b(the)h(catalogs)h(will)c(searc)m (hed.)3386 4686 y(User)j(Option)-3726 b Fd(sgml-public-map)390 4795 y Fm(This)39 b(should)g(b)s(e)h(a)i(list)d(of)j(\014le)e(name)h (templates.)72 b(This)40 b(v)-5 b(ariable)39 b(is)h(initialized)e(from) j(the)390 4905 y(en)m(vironmen)m(t)26 b(v)-5 b(ariable)26 b Fi(SGML_PATH)p Fm(.)37 b(This)25 b(is)h(the)h(same)g(en)m(vironmen)m (t)g(v)-5 b(ariable)25 b(that)j(`)p Fi(sgmls)p Fm(')390 5015 y(uses.)40 b(If)30 b(the)h(en)m(vironmen)m(t)f(v)-5 b(ariable)29 b(is)g(unde\014ned)f(the)j(default)f(is)630 5143 y Fi(\("\045S")46 b("/usr/local/lib/sgml/\045o/\045c)o(/\045d)o ("\))p eop %%Page: 6 8 6 7 bop 150 -116 a Fm(Chapter)30 b(5:)41 b(Running)28 b(an)i(external)g(SGML)h(parser)1706 b(6)150 299 y Fk(5)80 b(Running)54 b(an)g(external)g(SGML)f(parser)275 523 y Fm(PSGML)31 b(can)i(not)f(v)-5 b(alidate)31 b(an)h(SGML)g(do)s(cumen) m(t)g(\(see)h(b)s(elo)m(w)e(what)h(it)g(can)g(and)g(can't)g(do\).)46 b(If)150 633 y(y)m(ou)32 b(ha)m(v)m(e)h(a)g(v)-5 b(alidating)30 b(SGML)i(parser,)g(lik)m(e)f(`)p Fi(sgmls)p Fm(',)h(y)m(ou)g(can)g(run) f(the)h(parser)f(on)h(y)m(our)g(\014le)f(with)150 742 y(the)g(command)f Fh(C-c)f(C-v)h Fm(\()p Fi(sgml-validate)p Fm(\).)275 875 y(Some)g(v)-5 b(ariables)29 b(con)m(trol)i(this)e (function:)3386 1099 y(User)i(Option)-3726 b Fd(sgml-v)-6 b(alidate-command)390 1209 y Fm(The)30 b(shell)e(command)j(to)g(v)-5 b(alidate)30 b(an)g(SGML)g(do)s(cumen)m(t.)390 1341 y(This)41 b(is)g(a)i Fi(format)e Fm(con)m(trol)h(string)g(that)h(b)m(y)f(default) g(should)e(con)m(tain)j(t)m(w)m(o)h Fi(\045s)e Fm(con)m(v)m(ersion)390 1451 y(sp)s(eci\014cations:)52 b(the)37 b(\014rst)f(will)f(b)s(e)h (replaced)g(b)m(y)h(the)g(v)-5 b(alue)36 b(of)h Fi(sgml-declaration)c Fm(\(or)k(the)390 1560 y(empt)m(y)30 b(string,)g(if)e(nil\);)h(the)h (second)g(will)d(b)s(e)j(replaced)f(b)m(y)h(the)g(curren)m(t)g (bu\013er's)f(\014le)g(name)h(\(or)390 1670 y(the)h(empt)m(y)f(string,) g(if)f(nil\).)390 1803 y(If)i Fi(sgml-validate-files)26 b Fm(is)k(non-nil,)f(the)j(format)f(string)f(should)g(con)m(tain)h(one) h Fi(\045s)e Fm(con)m(v)m(er-)390 1912 y(sion)f(sp)s(eci\014cation)h (for)g(eac)m(h)h(elemen)m(t)g(of)g(its)e(result.)390 2045 y(If)c(sgml-v)-5 b(alidate-command)25 b(is)g(a)g(list,)h(then)f (ev)m(ery)i(elemen)m(t)f(should)d(b)s(e)i(a)h(string.)38 b(The)25 b(strings)390 2154 y(will)36 b(b)s(e)j(tried)f(in)f(order)i (and)f(`)p Fi(\045)p Fm('-sequences)i(in)d(the)i(string)f(will)f(b)s(e) h(replaced)g(according)h(to)390 2264 y(the)28 b(list)e(b)s(elo)m(w,)i (if)f(the)g(string)g(con)m(tains)h(`)p Fi(\045)p Fm('-sequences)h(with) d(no)i(replacemen)m(t)g(v)-5 b(alue)27 b(the)h(next)390 2373 y(string)h(will)f(b)s(e)i(tried.)390 2529 y Fi(\045b)384 b Fm(means)30 b(the)h(visited)e(\014le)g(of)i(the)f(curren)m(t)g (bu\013er)390 2684 y Fi(\045s)384 b Fm(means)30 b(the)h(SGML)f (declaration)g(sp)s(eci\014ed)f(in)g(the)h(sgml-declaration)g(v)-5 b(ariable)390 2840 y Fi(\045d)384 b Fm(means)28 b(the)g(\014le)f(con)m (taining)g(the)i(DOCTYPE)e(declaration,)h(if)f(not)h(in)f(the)h (bu\013er)390 2995 y(The)i(default)f(v)-5 b(alue)30 b(is)g Fi(nsgmls)e(-s)i(\045s)g(\045s)p Fm(.)3386 3220 y(User)h(Option)-3726 b Fd(sgml-v)-6 b(alidate-\014les)390 3329 y Fm(If)39 b(non-nil,)g(a)g(function)f(of)h(no)g(argumen)m(ts)g(that)h(returns)e (a)h(list)f(of)h(\014le)f(names.)67 b(These)39 b(\014le)390 3439 y(names)h(will)e(serv)m(e)j(as)g(the)f(argumen)m(ts)h(to)g(the)f Fi(sgml-validate-command)35 b Fm(format)40 b(con)m(trol)390 3548 y(string)29 b(instead)h(of)h(the)f(defaults.)3386 3773 y(User)h(Option)-3726 b Fd(sgml-declaration)390 3882 y Fm(The)30 b(name)g(of)h(the)f(SGML)h(declaration)f(\014le.)3386 4107 y(User)h(Option)-3726 b Fd(sgml-o\013er-sa)m(v)m(e)390 4216 y Fm(If)38 b(non-nil,)h Fh(C-c)30 b(C-v)38 b Fm(\()p Fi(sgml-validate)p Fm(\))e(will)g(ask)j(ab)s(out)g(sa)m(ving)g(mo)s (di\014ed)e(bu\013ers)g(b)s(efore)390 4326 y(running)28 b(the)i(v)-5 b(alidate)30 b(command.)41 b(The)29 b(default)h(v)-5 b(alue)30 b(is)f Fi(t)p Fm(.)275 4550 y(The)i(built-in)e(parser)j(can)h (\014nd)d(some)j(markup)e(errors.)46 b(The)32 b(command)g Fh(C-c)d(C-o)i Fm(\()p Fi(sgml-next-)150 4660 y(trouble-spot)p Fm(\))f(is)j(the)g(b)s(est)g(w)m(a)m(y)h(to)g(use)f(the)g(built-in)e (parser)h(for)h(this.)48 b(T)-8 b(o)34 b(c)m(hec)m(k)h(the)e(whole)g (\014le)150 4769 y(go)e(to)g(the)g(b)s(eginning)d(of)i(the)h(bu\013er)e (and)h(use)g Fh(C-c)f(C-o)p Fm(.)275 4902 y(Some)h(of)g(the)h(markup)e (errors)h(not)h(found)e(are:)225 5034 y Fl(\017)60 b Fm(Errors)29 b(in)g(the)i(SGML)f(declaration.)225 5167 y Fl(\017)60 b Fm(Errors)29 b(in)g(attribute)h(sp)s(eci\014cations.)225 5299 y Fl(\017)60 b Fm(Omitted)30 b(start-tags)i(for)e(empt)m(y)h (elemen)m(ts.)p eop %%Page: 7 9 7 8 bop 150 -116 a Fm(Chapter)30 b(6:)41 b(SGML)30 b(Declaration)2340 b(7)150 299 y Fk(6)80 b(SGML)54 b(Declaration)275 533 y Fm(PSGML)32 b(do)s(es)g(not)g(understand)f(the)i(SGML)f(declaration,) h(it)f(accepts)h(one)g(in)e(the)i(\014le)e(but)h(it)g(is)150 643 y(ignored.)38 b(If)24 b(y)m(ou)h(ha)m(v)m(e)h(the)f(SGML)g (declaration)f(in)g(another)h(\014le)e(y)m(ou)j(can)f(mak)m(e)g(`)p Fi(sgmls)p Fm(')f(use)h(it)f(when)150 752 y(y)m(ou)31 b(use)f(the)g Fh(C-c)g(C-v)f Fm(\()p Fi(sgml-validate)p Fm(\))f(command)i(\(see)h(Chapter)f(5)h([V)-8 b(alidate],)31 b(page)g(6\).)275 887 y(PSGML)24 b(has)g(some)h(options)f(in)g(what)g (features)h(it)f(uses)g(and)g(what)h(markup)e(it)h(creates.)41 b(Y)-8 b(ou)25 b(ha)m(v)m(e)150 996 y(to)39 b(set)f(these)h(options)e (to)i(mak)m(e)g(PSGML's)e(b)s(eha)m(vior)h(consisten)m(t)g(with)f(y)m (our)g(SGML)h(declaration)150 1106 y(and)30 b(p)s(ersonal)f (preferences.)3386 1340 y(User)i(Option)-3726 b Fd(sgml-omittag)390 1450 y Fm(Set)31 b(this)e(to)i Fi(t)f Fm(if)f(the)i(SGML)f(declaration) g(has)g(`)p Fi(OMITTAG)f(YES)p Fm(')h(and)f(to)j Fi(nil)d Fm(otherwise.)3386 1684 y(User)i(Option)-3726 b Fd(sgml-shorttag)390 1793 y Fm(Set)31 b(this)e(to)i Fi(t)f Fm(if)f(the)i(SGML)f(declaration) g(has)g(`)p Fi(SHORTTAG)f(YES)p Fm(')g(and)h(to)h Fi(nil)f Fm(otherwise.)3386 2027 y(User)h(Option)-3726 b Fd(sgml-alw)m(a)m (ys-quote-attributes)390 2137 y Fm(If)37 b(non-nil,)h(quote)h(all)d (attribute)i(v)-5 b(alues)37 b(inserted)g(after)h(\014nishing)d(edit)i (attributes.)63 b(If)37 b(this)390 2247 y(v)-5 b(ariable)29 b(is)h Fi(nil)f Fm(and)h Fi(sgml-shorttag)d Fm(is)i(non-)p Fi(nil)p Fm(,)h(attribute)g(v)-5 b(alues)29 b(that)i(consists)f(of)h (only)390 2356 y(name)f(c)m(haracters)i(will)c(not)j(b)s(e)e(quoted.) 3386 2590 y(User)i(Option)-3726 b Fd(sgml-minimize-attributes)390 2700 y Fm(Determines)39 b(minimization)c(of)k(attributes)f(inserted)g (b)m(y)g(edit-attributes.)65 b(If)39 b(non-nil,)f(omit)390 2809 y(attribute)c(name)g(if)f(the)h(attribute)g(v)-5 b(alue)34 b(is)f(from)g(a)i(tok)m(en)g(group.)51 b(If)34 b Fi(max)p Fm(,)h(omit)e(attributes)390 2919 y(with)43 b(default)h(v)-5 b(alue.)83 b(Minimization)42 b(will)g(only)i(b)s(e)g (done)g(if)g(they)g(pro)s(duce)g(legal)g(SGML)390 3029 y(\(assuming)29 b Fi(sgml-omittag)e Fm(and)j Fi(sgml-shorttag)d Fm(are)k(set)g(correctly\).)p eop %%Page: 8 10 8 9 bop 150 -116 a Fm(Chapter)30 b(7:)41 b(Do)s(cumen)m(t)31 b(T)m(yp)s(e)f(Declaration)1959 b(8)150 299 y Fk(7)80 b(Do)t(cumen)l(t)52 b(T)l(yp)t(e)h(Declaration)275 516 y Fm(PSGML)28 b(needs)h(to)g(kno)m(w)g(ab)s(out)g(the)g(DTD)g(y)m(ou)h (are)f(using)e(for)i(man)m(y)g(of)g(its)f(commands.)40 b(If)29 b(y)m(ou)150 626 y(do)i(not)g(ha)m(v)m(e)h(a)g(`)p Fi(DOCTYPE)p Fm(')d(declaration)i(in)f(y)m(our)g(\014le,)h(PSGML)g (will)d(try)j(assume)g(that)g(there)h(is)e(one)150 735 y(of)h(the)f(form)390 861 y Fi()275 992 y Fm(where)33 b Fj(name)39 b Fm(is)33 b(the)i(v)-5 b(alue)33 b(of)i Fi(sgml-default-doctype-na)o(me)p Fm(,)29 b(if)k(the)h(v)-5 b(alue)34 b(is)f(non-)p Fi(nil)p Fm(,)h(else)150 1101 y(the)d(GI)f(of)h(the)f(\014rst)g(tag)h(will)d(b)s (e)i(used.)275 1232 y(PSGML)c(will)e(try)i(to)i(parse)e(the)h(do)s (cumen)m(t)f(t)m(yp)s(e)h(declaration)f(the)h(\014rst)f(time)g(y)m(ou)h (do)f(something)150 1342 y(that)i(needs)f(to)i(parse)e(the)h(do)s (cumen)m(t)g(or)f(immediately)f(if)h(the)h(v)-5 b(ariable)26 b Fi(sgml-auto-activate-dtd)150 1452 y Fm(is)h Fi(t)p Fm(.)40 b(Y)-8 b(ou)29 b(can)f(also)g(initiate)f(the)i(parsing)e(of)h (the)g(do)s(cumen)m(t)h(t)m(yp)s(e)f(declaration)g(with)f(the)h (command)150 1561 y Fi(sgml-parse-prolog)p Fm(.)36 b(Big)30 b(DTDs)h(tak)m(e)h(some)f(time)f(to)h(parse.)275 1692 y(When)k(the)g(DTD)h(has)f(b)s(een)g(parsed)f(or)i(loaded)f(the)g(name) h(of)f(the)h(do)s(cumen)m(t)f(elemen)m(t)h(will)d(b)s(e)150 1802 y(displa)m(y)m(ed)c(in)g(the)i(mo)s(de)f(line)f(inside)f(brac)m(k) m(ets.)43 b(If)30 b(there)g(w)m(as)h(an)f(error)h(parsing)e(the)h(DTD)h (or)g(there)150 1911 y(is)c(no)g(DTD,)h(the)g(mo)s(de)f(line)f(will)f (displa)m(y)h(`)p Fi([ANY])p Fm(')h(\(***)i(this)e(is)f(not)i(really)f (correct!)41 b(a)28 b(DTD)g(will)d(b)s(e)150 2021 y(established)k(ev)m (en)i(if)e(there)i(are)f(missing)f(en)m(tities,)h(it)g(ma)m(y)h(ev)m (en)g(b)s(e)f(empt)m(y\).)150 2268 y Fn(7.1)68 b(Precompiled)46 b(DTD)e(Subsets)275 2457 y Fm(If)e(parsing)g(the)i(DTD)g(tak)m(es)h(to) s(o)f(long)f(time)g(y)m(ou)h(can)f(arrange)h(to)g(ha)m(v)m(e)h(PSGML)e (cac)m(he)i(an)150 2567 y(in)m(ternal)23 b(complied)g(v)m(ersion)h(of)h (the)g(DTD.)g(Cac)m(hing)f(can)h(b)s(e)f(done)g(of)h(DTD)g(fragmen)m (ts)g(in)f(fa)m(v)m(ourable)150 2677 y(situations.)44 b(It)32 b(is)f(p)s(ossible)e(to)k(ha)m(v)m(e)g(an)e(external)h(DTD)g (subset)g(cac)m(hed)h(but)e(still)e(ha)m(v)m(e)k(an)f(in)m(ternal)150 2786 y(DTD)38 b(subset)f(as)h(long)g(as)g(the)f(in)m(ternal)g(subset)g (do)s(es)g(not)h(de\014ne)f(parameter)i(en)m(tities)e(that)h(a\013ect) 150 2896 y(the)d(parsing)e(of)i(the)h(external)e(subset)h(\(***)h(what) f(is)f(the)h(exact)h(conditions?,)f(probably)e(y)m(ou)i(can't)150 3005 y(use)27 b(the)g(cac)m(hed)i(external)e(subset)f(if)h(the)g(in)m (ternal)f(subset)h(de\014nes)f(parameter)i(en)m(tities)f(that)g(are)h (also)150 3115 y(de\014ned)h(in)g(the)i(external)f(subset)g(with)f (another)h(v)-5 b(alue\).)275 3246 y(T)d(o)36 b(enable)g(cac)m(hing)h (y)m(ou)g(ha)m(v)m(e)h(to)f(create)h(sp)s(ecial)d(catalog)j(\014les,)f (hereafter)g(called)f(ECA)-8 b(T)36 b(\014les)150 3356 y(due)e(to)i(\(temp)s(orary\))f(lac)m(k)g(of)g(imagination.)53 b(These)35 b(catalogs)h(ha)m(v)m(e)g(similar)c(syn)m(tax)k(to)f(the)g (en)m(tit)m(y)150 3465 y(catalogs)25 b(and)e(there)h(are)f(t)m(w)m(o)i (v)-5 b(ariables)22 b(con)m(taining)h(lists)f(of)i(catalogs)h(to)f (searc)m(h:)38 b Fi(sgml-ecat-files)150 3575 y Fm(and)30 b Fi(sgml-local-ecat-files)p Fm(.)35 b(The)30 b(ECA)-8 b(T)30 b(\014les)f(can)i(con)m(tain)f(the)h(follo)m(wing)e(t)m(yp)s(es) h(of)h(en)m(tries:)150 3727 y(`)p Fi(file)e Fj(dtd\014le)34 b(en)m(tit)m(ydef)49 b(c\014le)5 b Fm(')630 3837 y(The)25 b Fj(dtd\014le)k Fm(is)24 b(the)h(name)h(of)f(a)h(\014le)e(con)m (taining)h(a)h(DTD)f(subset)g(that)h(should)d(b)s(e)i(cac)m(hed)630 3947 y(in)k Fj(c\014le)p Fm(.)40 b(The)30 b Fj(en)m(tit)m(ydef)49 b Fm(is)29 b(optional)g(and)h(if)g(giv)m(en)g(ha)m(v)m(e)i(the)e(follo) m(wing)f(syn)m(tax:)870 4072 y Fi([)47 b Fj(name1)56 b(literal1)e(name2)i(literal2)e Fi(...)46 b(])630 4203 y Fm(Using)32 b Fj(en)m(tit)m(ydef)51 b Fm(will)31 b(mo)s(dify)g(the)i (DTD)h(subset)e(b)m(y)h(de\014ning)e(the)j(parameter)f(en)m(tit)m(y)630 4313 y(with)d(name)h Fj(name1)38 b Fm(to)32 b(b)s(e)e Fj(literal1)p Fm(,)36 b(.)23 b(.)f(.)11 b(.)43 b(The)30 b(cac)m(hed)i(v)m(ersion)f(of)g(the)g(subset)f(will)f(b)s(e)630 4422 y(created)40 b(with)e(those)h(en)m(tit)m(y)h(de\014nitions,)f(and) f(when)g(PSGML)h(searc)m(h)h(for)e(a)i(matc)m(h-)630 4532 y(ing)32 b(cac)m(hed)h(subset)f(will)e(c)m(hec)m(k)j(that)g(the)g (parameter)g(en)m(tities)f(in)f Fj(en)m(tit)m(ydef)51 b Fm(has)32 b(b)s(een)630 4641 y(de\014ned)d(with)g(those)i(v)-5 b(alues)30 b(b)s(efore)g(trying)f(to)i(use)f(`)p Fi(cfile)p Fm('.)150 4794 y(`)p Fi(public)f Fj(pubid)i(en)m(tit)m(ydef)48 b(c\014le)5 b Fm(')630 4904 y(Cac)m(he)31 b(the)g(DTD)g(subset)e(with)g (public)f(iden)m(ti\014er)h Fj(pubid)i Fm(in)e(\014le)g Fj(c\014le)p Fm(.)3386 5121 y(User)i(Option)-3726 b Fd (sgml-recompile-out-of-date-cdtd)390 5230 y Fm(If)26 b(non-)p Fi(nil)p Fm(,)h(out)g(of)g(date)g(compiled)e(DTDs)i(will)e(b)s (e)h(automatically)g(recompiled.)38 b(If)27 b(the)f(v)-5 b(alue)390 5340 y(is)23 b Fi(ask)p Fm(,)i(PSGML)e(will)f(ask)i(b)s (efore)f(recompiling.)37 b(A)24 b Fi(nil)f Fm(v)-5 b(alue)23 b(will)f(cause)i(PSGML)g(to)h(silen)m(tly)p eop %%Page: 9 11 9 10 bop 150 -116 a Fm(Chapter)30 b(7:)41 b(Do)s(cumen)m(t)31 b(T)m(yp)s(e)f(Declaration)1959 b(9)390 299 y(load)29 b(an)g(out)h(of)g(date)g(compiled)e(DTD.)i(A)f(DTD)h(that)g(refers)f (to)i(unde\014ned)c(external)i(en)m(tities)390 408 y(is)g(alw)m(a)m(ys) i(out)g(of)f(date,)i(th)m(us)e(in)f(suc)m(h)h(case)h(it)f(can)h(b)s(e)f (useful)e(to)j(set)g(this)f(v)-5 b(ariable)29 b(to)i Fi(nil)p Fm(.)275 620 y(Previous)f(v)m(ersions)h(of)i(PSGML)e(ha)m(v)m (e)i(had)f(another)g(w)m(a)m(y)g(of)h(sp)s(eeding)d(up)h(DTD)h (parsing.)44 b(This)150 729 y(co)s(de)30 b(remains)f(in)f(this)h(v)m (ersion)g(of)h(PSGML,)g(but)f(is)g(not)h(activ)m(ely)h(main)m(tained)d (and)h(ma)m(y)i(disapp)s(ear)150 839 y(in)e(the)i(future.)275 987 y(Y)-8 b(ou)34 b(can)h(sa)m(v)m(e)h(the)e(parsed)g(DTD)g(in)f(a)i (\014le)e(using)g(the)i(command)f Fh(M-x)29 b(sgml-save-dtd)p Fm(.)49 b(Next)150 1096 y(time)30 b(PSGML)g(can)g(load)g(that)h(\014le) e(instead)h(of)g(parsing)f(the)h(DTD.)h(F)-8 b(or)31 b(PSGML)f(to)h(\014nd)d(the)j(sa)m(v)m(ed)150 1206 y(DTD)23 b(y)m(ou)f(m)m(ust)g(either)f(sa)m(v)m(e)j(the)e(DTD)h(using)d(the)i (default)g(name)g(or)g(do)g(a)g Fh(M-x)30 b(sgml-save-options)150 1316 y Fm(after)43 b(sa)m(ving)f(the)h(DTD.)g(T)-8 b(o)43 b(directly)e(use)h(an)g(already)g(parsed)g(and)g(sa)m(v)m(ed)h(DTD,)g (load)f(the)h(\014le)150 1425 y(con)m(taining)30 b(the)g(sa)m(v)m(ed)i (DTD)f(with)e(the)h(command)h Fh(M-x)e(sgml-load-dtd)p Fm(.)3386 1700 y(User)i(Option)-3726 b Fd(sgml-default-dtd-\014le)390 1809 y Fm(This)31 b(is)h(the)h(default)f(\014le)g(name)h(for)g(sa)m(v)m (ed)h(DTD.)g(This)d(is)h(set)h(b)m(y)g Fi(sgml-mode)d Fm(to)k(the)f(bu\013er)390 1919 y(\014le)g(name)h(less)f(extension)g (plus)f(the)i(extension)f Fi(.ced)p Fm(,)h(if)e(that)j(\014le)e (exists.)50 b(Can)33 b(b)s(e)g(c)m(hanged)390 2028 y(in)c(the)i(Lo)s (cal)f(v)-5 b(ariables)29 b(section)h(of)h(the)f(\014le.)150 2319 y Fn(7.2)68 b(Using)46 b(a)f(Split)g(Do)t(cumen)l(t)275 2525 y Fm(Y)-8 b(ou)32 b(can)g(ha)m(v)m(e)h(the)f(`)p Fi(DOCTYPE)p Fm(')f(declaration)g(in)g(another)h(\014le)f(b)m(y)h (setting)g Fi(sgml-doctype)c Fm(to)33 b(the)150 2635 y(other)e(\014le.)3386 2909 y(User)g(Option)-3726 b Fd(sgml-paren)m (t-do)s(cumen)m(t)390 3019 y Fm(Used)30 b(when)g(the)g(curren)m(t)g (\014le)g(is)f(part)h(of)h(a)g(bigger)f(do)s(cumen)m(t.)390 3167 y(The)36 b(v)-5 b(ariable)35 b(describ)s(es)g(ho)m(w)i(the)g (curren)m(t)f(\014le's)g(con)m(ten)m(t)i(\014t)e(in)m(to)h(the)g (elemen)m(t)g(hierarc)m(h)m(y)-8 b(.)390 3277 y(The)30 b(v)-5 b(ariable)29 b(should)f(ha)m(v)m(e)k(the)f(form)630 3419 y Fi(\()p Fj(paren)m(t-\014le)52 b(con)m(text-elemen)m(t)r Fi(*)f Fj(top-elemen)m(t)f Fi(\()p Fj(has-seen-elemen)m(t)r Fi(*\)?\))390 3598 y Fj(paren)m(t-\014le)78 b Fm(is)29 b(a)i(string,)f(the)g(name)h(of)f(the)h(\014le)e(con)m(taining)h(the)h (do)s(cumen)m(t)f(en)m(tit)m(y)-8 b(.)390 3771 y Fj(con)m(text-elemen)m (t)870 3881 y Fm(is)32 b(a)h(string,)f(that)h(is)f(the)h(name)g(of)f (an)h(elemen)m(t)g(t)m(yp)s(e.)48 b(It)33 b(can)g(o)s(ccur)f(0)h(or)g (more)870 3990 y(times)21 b(and)g(is)g(used)f(to)i(set)h(up)d (exceptions)i(and)e(short)i(reference)g(map.)37 b(Go)s(o)s(d)21 b(can-)870 4100 y(didates)j(for)h(these)g(elemen)m(ts)h(are)f(the)g (elemen)m(ts)h(op)s(en)e(when)g(the)h(en)m(tit)m(y)h(p)s(oin)m(ting)870 4209 y(to)31 b(the)g(curren)m(t)f(\014le)f(is)h(used.)390 4382 y Fj(top-elemen)m(t)870 4492 y Fm(is)i(a)g(string)g(that)h(is)f (the)g(name)h(of)g(the)f(elemen)m(t)h(t)m(yp)s(e)g(of)g(the)f(top)h (lev)m(el)f(elemen)m(t)870 4602 y(in)g(the)i(curren)m(t)f(\014le.)50 b(The)33 b(\014le)f(should)g(con)m(tain)i(one)g(instance)f(of)h(this)e (elemen)m(t,)870 4711 y(unless)j(the)i(last)g(\(lisp\))e(elemen)m(t)i (of)g(sgml-paren)m(t-do)s(cumen)m(t)g(is)f(a)h(list.)59 b(If)37 b(it)f(is)870 4821 y(a)k(list,)g(the)g(top)g(lev)m(el)f(of)g (the)h(\014le)f(should)e(follo)m(w)i(the)g(con)m(ten)m(t)j(mo)s(del)c (of)h(top-)870 4930 y(elemen)m(t.)390 5103 y Fj(has-seen-elemen)m(t)870 5213 y Fm(is)30 b(a)h(string)f(that)h(is)f(the)h(name)g(of)g(an)g (elemen)m(t)g(t)m(yp)s(e.)43 b(This)29 b(elemen)m(t)i(is)f(satis\014ed) 870 5322 y(in)f(the)i(con)m(ten)m(t)h(mo)s(del)d(of)i(top-elemen)m(t.)p eop %%Page: 10 12 10 11 bop 150 -116 a Fm(Chapter)30 b(7:)41 b(Do)s(cumen)m(t)31 b(T)m(yp)s(e)f(Declaration)1913 b(10)150 299 y Fn(7.3)68 b(Inserting)46 b(a)f(DOCTYPE)275 490 y Fm(***)32 b(Describ)s(e)f(the)g (DTD)h(men)m(u)f(in)f(general.)44 b(Describ)s(e)31 b(customized)g(en)m (tries)g(for)g(sp)s(ecial)f(DTDs.)150 600 y(Men)m(tion)h Fh(C-c)e(C-u)h(C-d)f Fm(for)h(inserting)f(a)h(DOCTYPE)g(from)g(k)m(eyb) s(oard.)275 732 y(If)22 b(y)m(ou)h(c)m(hange)h(the)f(do)s(ct)m(yp)s(e)g (y)m(ou)g(m)m(ust)g(execute)h Fi(sgml-parse-prolog)p Fm(,)c(c)m(hanges)j(in)f(the)h(do)s(ct)m(yp)s(e)150 842 y(are)31 b(not)f(automatically)h(recognized.)3386 1068 y(User)g(Option)-3726 b Fd(sgml-custom-dtd)390 1178 y Fm(Men)m(u)30 b(en)m(tries)g(to)h(b)s(e)e(added)g(to)i(the)f(DTD)h(men) m(u.)40 b(The)29 b(v)-5 b(alue)30 b(should)e(b)s(e)h(a)i(list)d(of)i (en)m(tries)g(to)390 1287 y(b)s(e)g(added)f(to)j(the)e(DTD)h(men)m(u.) 390 1420 y(Ev)m(ery)36 b(en)m(try)g(should)e(b)s(e)i(a)g(list.)56 b(The)36 b(\014rst)f(elemen)m(t)h(of)h(the)f(en)m(try)g(is)f(a)h (string)f(used)h(as)g(the)390 1530 y(men)m(u)h(en)m(try)-8 b(.)61 b(The)37 b(second)g(elemen)m(t)h(is)e(a)h(string)g(con)m (taining)f(a)i(do)s(ct)m(yp)s(e)f(declaration)g(\(this)390 1640 y(can)29 b(b)s(e)g(nil)d(if)i(no)h(do)s(ct)m(yp)s(e\).)41 b(The)28 b(rest)h(of)g(the)h(list)d(should)g(b)s(e)h(a)i(list)d(of)i(v) -5 b(ariables)28 b(and)g(v)-5 b(alues.)390 1749 y(F)d(or)32 b(bac)m(kw)m(ard)g(compatibilit)m(y)d(a)j(single)e(string)g(instead)h (of)h(a)f(v)-5 b(ariable)30 b(is)h(assigned)f(to)i Fi(sgml-)390 1859 y(default-dtd-file)p Fm(.)62 b(All)37 b(v)-5 b(ariables)38 b(are)h(made)g(bu\013er)f(lo)s(cal)g(and)h(are)g(also)g(added)f(to)i (the)390 1968 y(bu\013ers)29 b(lo)s(cal)h(v)-5 b(ariables)29 b(list.)390 2101 y(When)44 b(an)h(en)m(try)g(is)f(selected)h(from)f (the)h(DTD)g(men)m(u,)j(the)d(do)s(ct)m(yp)s(e)f(declaration)h(will)d (b)s(e)390 2211 y(inserted,)31 b(the)g(v)-5 b(ariables)30 b(will)f(b)s(e)h(set)i(to)g(the)g(v)-5 b(alues)30 b(in)g(the)i(en)m (try)f(and)g(a)h(lo)s(cal)e(v)-5 b(ariables)30 b(list)390 2320 y(will)e(b)s(e)h(created)j(in)d(the)i(bu\013er.)390 2453 y(Example:)773 2581 y Fi(\(\("HTML")46 b(nil)869 2684 y(sgml-default-dtd-file)c("~/sgml/html.ced")869 2788 y(sgml-omittag)i(nil)j(sgml-shorttag)d(nil\))821 2892 y(\("HTML+")h("") 869 2996 y("~/sgml/htmlplus.ced")869 3099 y(sgml-omittag)e(t)k (sgml-shorttag)c(nil\))821 3203 y(\("DOCBOOK")h("")869 3307 y("~/sgml/docbook.ced")869 3411 y(sgml-omittag)e(nil)j(sgml-shorttag)d(t\)\)\))150 3663 y Fn(7.4)68 b(Information)46 b(from)f(the)h(DTD)275 3854 y Fm(PSGML)31 b(can)h(list)f(v)-5 b(arious)30 b(information)g(ab)s (out)i(the)g(curren)m(t)f(DTD.)i(The)e(follo)m(wing)f(commands)150 3964 y(can)h(b)s(e)e(used)h(via)g Fh(M-x)f Fm(and)h(can)h(also)f(b)s(e) g(found)f(in)g(the)i(DTD)f(men)m(u.)150 4167 y Fi (sgml-general-dtd-info)630 4277 y Fm(Displa)m(y)g(information)e(ab)s (out)i(the)h(curren)m(t)f(DTD.)150 4433 y Fi(sgml-describe-element-ty)o (pe)630 4542 y Fm(Describ)s(e)g(the)g(prop)s(erties)f(of)i(an)f(elemen) m(t)h(t)m(yp)s(e)f(as)h(declared)f(in)f(the)h(curren)m(t)g(DTD.)150 4699 y Fi(sgml-describe-entity)630 4808 y Fm(Describ)s(e)g(the)g(prop)s (erties)f(of)i(an)f(en)m(tit)m(y)h(as)g(declared)e(in)g(the)i(curren)m (t)f(DTD.)150 4965 y Fi(sgml-list-elements)630 5074 y Fm(Will)e(list)i(all)f(elemen)m(ts)h(and)g(the)h(attributes)f(declared) g(for)g(the)g(elemen)m(t.)150 5230 y Fi(sgml-list-attributes)630 5340 y Fm(Will)e(list)i(all)f(attributes)h(declared)g(and)f(the)i (elemen)m(ts)g(that)g(use)f(them.)p eop %%Page: 11 13 11 12 bop 150 -116 a Fm(Chapter)30 b(7:)41 b(Do)s(cumen)m(t)31 b(T)m(yp)s(e)f(Declaration)1913 b(11)150 299 y Fi(sgml-list-terminals) 630 408 y Fm(Will)28 b(list)i(all)f(elemen)m(ts)h(that)h(can)g(con)m (tain)g(data.)150 568 y Fi(sgml-list-occur-in-eleme)o(nts)630 677 y Fm(Will)d(list)i(all)f(elemen)m(t)i(t)m(yp)s(es)f(and)g(where)g (it)g(can)g(o)s(ccur.)150 837 y Fi(sgml-list-content-elemen)o(ts)630 946 y Fm(Will)e(list)h(all)g(elemen)m(t)i(t)m(yp)s(es)f(and)f(the)i (elemen)m(t)f(t)m(yp)s(es)g(that)h(can)g(o)s(ccur)e(in)g(its)h(con)m (ten)m(t.)p eop %%Page: 12 14 12 13 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(12)150 299 y Fk(8)80 b(Commands)52 b(for)i(editing)150 645 y Fn(8.1)68 b(Inserting)46 b(Markup)275 836 y Fm(The)22 b(commands)i(that)g(insert)e(start-tags)j(w)m(orks)f (only)e(if)h(the)g(do)s(cumen)m(t)h(has)f(an)g(asso)s(ciated)h(DTD.)275 969 y(Keyb)s(oard)29 b(commands)h(for)g(inserting:)150 1171 y Fh(C-c)f Fi(<)259 b Fm(Will)32 b(ask,)j(for)e(the)h(tag)h(to)f (insert,)g(in)e(the)i(mini-bu\013er)c(with)j(completion)g(on)g(the)h (tags)630 1281 y(that)d(are)g(v)-5 b(alid)28 b(at)k(p)s(oin)m(t)d(\()p Fi(sgml-insert-tag)p Fm(\).)630 1414 y(If)43 b(the)g(option)g Fi(sgml-balanced-tag-edit)37 b Fm(is)42 b(non-nil,)i(inserting)e(a)h (start-tag)j(will)630 1523 y(also)g(insert)f(the)h(corresp)s(onding)d (end-tag.)88 b(If,)50 b(in)44 b(addition,)49 b Fi(sgml-auto-insert-)630 1633 y(required-elements)23 b Fm(is)j(non-nil,)g(tags)i(for)f(elemen)m (ts)g(required)f(b)s(et)m(w)m(een)i(the)f(inserted)630 1743 y(tags)k(will)d(also)i(b)s(e)g(inserted.)630 1875 y(The)g(list)f(of)h(v)-5 b(alid)29 b(tags,)j(computed)e(for)g(a)h(p)s (osition)d(in)h(the)i(bu\013er,)f(will)d(con)m(tain:)679 2008 y(1.)61 b(The)40 b(end-tag)i(for)f(the)g(curren)m(t)g(elemen)m(t,) k(if)39 b(it)i(can)g(b)s(e)g(ended)f(at)i(the)f(p)s(osition)810 2118 y(and)27 b Fi(sgml-balanced-tag-edit)22 b Fm(is)k(nil.)38 b(F)-8 b(urthermore)28 b(it)f(will)e(con)m(tain)j(end-tags)810 2227 y(for)h(enclosing)g(elemen)m(ts)h(if)f(the)h(necessary)g (omissible)d(end-tag)k(declarations)e(ha)m(v)m(e)810 2337 y(b)s(een)h(made)g(in)f(the)i(DTD.)679 2470 y(2.)61 b(The)48 b(start-tags)j(of)e(all)f(elemen)m(ts)h(that)g(could)f(o)s (ccur)h(after)g(p)s(oin)m(t.)95 b(If)48 b Fi(sgml-)810 2580 y(omittag-transparent)38 b Fm(is)k(nil,)i(the)f(ab)s(o)m(v)m(e)h (will)c(b)s(e)i(limited)f(to)j(the)f(elemen)m(ts)810 2689 y(that)31 b(can)g(o)s(ccur)f(within)e(the)i(curren)m(t)g(elemen)m (t.)150 2892 y Fh(C-c)f(C-e)163 b Fm(Insert)35 b(start)h(and)f (end-tags)h(for)g(an)f(elemen)m(t)h(\()p Fi(sgml-insert-element)p Fm(\).)52 b(The)35 b(name)630 3002 y(of)c(the)g(elemen)m(t)h(is)e(read) h(from)f(the)h(mini-bu\013er)d(with)i(completion)g(on)h(v)-5 b(alid)29 b(elemen)m(ts.)630 3111 y(If)36 b Fi (sgml-insert-end-tag-on-n)o(ew-l)o(ine)30 b Fm(is)35 b(non-nil)f(or)j(the)f(elemen)m(t)h(has)f(elemen)m(t)630 3221 y(con)m(ten)m(t,)c(the)f(end-tag)g(will)d(b)s(e)i(inserted)f(on)h (a)h(new)f(line)f(after)h(the)h(start-tag.)630 3354 y(If)24 b Fi(sgml-omittag-transparent)19 b Fm(is)k(nil,)i(the)g(list)e(of)i(v) -5 b(alid)23 b(elemen)m(ts)i(will)e(only)h(con)m(tain)630 3463 y(the)31 b(elemen)m(ts)f(that)h(can)g(b)s(e)f(in)f(the)h(con)m (ten)m(t)j(of)d(the)h(curren)m(t)f(elemen)m(t.)630 3596 y(Required)35 b(elemen)m(ts)i(in)f(the)g(con)m(ten)m(t)j(will)34 b(b)s(e)i(automatically)g(inserted)g(if)g(the)g(option)630 3706 y Fi(sgml-auto-insert-require)o(d-el)o(emen)o(ts)30 b Fm(is)35 b(non-nil.)56 b(When)36 b(the)h(con)m(ten)m(t)h(mo)s(del)630 3815 y(demands)f(an)h(elemen)m(t)h(but)f(there)g(is)g(more)g(than)g (one)h(to)g(c)m(ho)s(ose)g(from,)h(a)f(commen)m(t)630 3925 y(can)27 b(b)s(e)f(inserted)g(with)g(the)h(a)m(v)-5 b(ailable)26 b(c)m(hoices)h(if)f(the)h(option)f Fi (sgml-insert-missing-)630 4034 y(element-comment)g Fm(is)k(non-nil.)150 4191 y Fh(C-c)f(C-r)163 b Fm(Mak)m(es)27 b(the)f(region)g(in)m(to)f(a)h (new)g(elemen)m(t)g(\()p Fi(sgml-tag-region)p Fm(\).)36 b(Reads)26 b(elemen)m(t)g(name)630 4300 y(from)k(mini-bu\013er)d(with)i (completion)h(as)h(for)f Fh(C-c)f(C-e)p Fm(.)150 4456 y Fh(C-c)g(/)259 b Fm(Inserts)30 b(an)g(end-tag)h(for)f(the)h(curren)m (t)f(elemen)m(t)h(\()p Fi(sgml-insert-end-tag)p Fm(\).)150 4613 y Fh(C-c)e(RET)163 b Fm(Split)30 b(the)i(curren)m(t)g(elemen)m(t)g (at)h(p)s(oin)m(t.)45 b(If)31 b(rep)s(eated,)i(the)f(con)m(taining)g (elemen)m(t)g(will)e(b)s(e)630 4722 y(split)f(b)s(efore)h(the)g(b)s (eginning)e(of)i(then)g(curren)m(t)h(elemen)m(t.)630 4855 y(T)m(ypical)e(use)h(is)g(to)h(start)g(a)g(new)e(paragraph)h (elemen)m(t)h(when)f(inside)e(a)i(paragraph.)150 5011 y Fh(C-c)f Fi(+)259 b Fm(Read)30 b(attribute)f(name)g(and)g(v)-5 b(alue)29 b(from)g(mini-bu\013er)d(and)j(insert)f(attribute)h(sp)s (eci\014ca-)630 5121 y(tion)j(\()p Fi(sgml-insert-attribute)p Fm(\).)41 b(If)31 b(p)s(oin)m(t)g(is)g(immediately)g(after)i(a)f (start-tag,)j(this)630 5230 y(command)d(op)s(erates)g(on)f(that)i (start-tag.)47 b(Otherwise)30 b(the)i(command)g(will)d(op)s(erate)j(on) 630 5340 y(the)f(elemen)m(t)f(after)h(p)s(oin)m(t.)p eop %%Page: 13 15 13 14 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(13)630 299 y(The)31 b(attribute)g(name)g(will)e (b)s(e)i(read)g(with)f(completion.)43 b(If)31 b(the)h(attribute)f(has)g (a)h(tok)m(en)630 408 y(list)24 b(as)i(declared)g(v)-5 b(alue)25 b(the)h(attribute)f(v)-5 b(alue)26 b(will)d(also)j(b)s(e)f (read)g(with)g(completion.)38 b(The)630 518 y(prompt)29 b(for)i(attribute)f(v)-5 b(alue)30 b(will)d(t)m(ypically)i(lo)s(ok)h (lik)m(e:)870 649 y Fi(Value)46 b(for)h Fj(attribute)53 b Fi(\()p Fj(t)m(yp)s(e)g Fi(Default:)45 b Fj(curren)m(t)30 b(v)-5 b(alue)5 b Fi(\):)150 813 y Fh(C-c)29 b(C-u)h(C-m)630 923 y Fm(Giv)m(e)44 b(k)m(eyb)s(oard)e(access)j(to)f(the)f(customized)g (part)g(of)g(the)h(Markup)e(men)m(u.)79 b(Emacs)630 1033 y(will)39 b(prompt)j(for)f(the)i(markup)d(to)j(insert)e(using)g(the)h (men)m(u)f(line)g(as)h(selector.)76 b(\(See)630 1142 y Fj(sgml-custom-markup)32 b Fm(b)s(elo)m(w.\))275 1309 y(Men)m(u)e(bar:)150 1476 y(`)p Fi(Markup)p Fm(')142 b(Selecting)37 b(from)h(this)e(men)m(u)i(will)d(insert)i(markup.)61 b(The)38 b(men)m(u)f(con)m(tains)h(sub)e(men)m(us)630 1585 y(with)29 b(tags)i(and)f(with)f(en)m(tities,)i(some)g(other)f (markup)f(and)h(a)h(user)e(de\014ned)h(section.)630 1722 y(Sub)f(men)m(us:)150 1886 y(`)p Fi(Insert)g(element)p Fm(')630 1996 y(P)m(ops)e(up)g(a)h(men)m(u)f(of)g(v)-5 b(alid)26 b(elemen)m(ts)i(and)e(insert)h(start)h(and)e(end-tags)j(for)e (the)g(selected)630 2106 y(elemen)m(t.)41 b(Selections)30 b(from)g(the)g(men)m(u)g(w)m(orks)h(lik)m(e)e(the)i Fh(C-c)e(C-e)h Fm(command.)150 2270 y(`)p Fi(Insert)f(start-tag)p Fm(')630 2379 y(P)m(ops)j(up)g(a)h(men)m(u)e(of)i(v)-5 b(alid)31 b(start-tags)j(and)e(insert)f(the)i(selected)f(tag.)48 b(The)32 b(men)m(u)g(has)630 2489 y(the)f(same)f(start-tags)j(as)d(the) h(completion)f(list)f(for)h Fh(C-c)f Fi(<)p Fm(.)150 2653 y(`)p Fi(Insert)g(end-tag)p Fm(')630 2763 y(P)m(ops)h(up)g(a)h (men)m(u)e(of)i(v)-5 b(alid)29 b(end-tags)i(and)f(insert)f(the)h (selected)h(tag.)150 2927 y(`)p Fi(Tag)f(region)p Fm(')630 3037 y(P)m(ops)g(up)f(a)h(men)m(u)f(of)h(v)-5 b(alid)29 b(elemen)m(ts)h(and)f(tag)i(the)f(region)g(with)e(the)i(selection.)41 b(Selec-)630 3146 y(tions)30 b(from)g(the)g(men)m(u)g(w)m(orks)g(lik)m (e)g(the)h Fh(C-c)e(C-r)h Fm(command.)150 3311 y(`)p Fi(Insert)f(entity)p Fm(')630 3420 y(Men)m(u)i(of)f(all)f(general)i(en) m(tities)f(de\014ned)f(in)g(the)i(DTD.)150 3584 y(`)p Fi(Insert)e(attribute)p Fm(')630 3694 y(P)m(ops)36 b(up)g(a)g(men)m(u)g (with)f(all)g(the)i(attributes)e(of)i(an)f(elemen)m(t.)59 b(The)35 b(elemen)m(t)i(is)e(either)630 3804 y(the)30 b(one)g(whic)m(h)e(start-tag)k(is)d(immediately)f(b)s(efore)h(p)s(oin)m (t)g(or)g(the)h(elemen)m(t)g(after)h(p)s(oin)m(t.)630 3913 y(Selecting)f(from)g(this)f(men)m(u)h(edits)g(the)g(attribute)g (sp)s(eci\014cation)f(list)g(for)i(the)f(elemen)m(t.)630 4050 y(The)i(men)m(u)h(has)g(a)g(sub)f(men)m(u)h(for)f(ev)m(ery)i (attribute)f(whic)m(h)e(declared)i(v)-5 b(alue)32 b(is)g(a)i(tok)m(en) 630 4160 y(list.)57 b(The)36 b(rest)g(of)h(the)f(attributes)g(are)g (collected)h(in)e(one)h(sub)f(men)m(u.)58 b(F)-8 b(or)37 b(the)g(tok)m(en)630 4269 y(list)31 b(attributes,)i(selecting)f(a)h(v) -5 b(alue)32 b(will)e(insert)h(that)j(attribute-v)-5 b(alue)32 b(pair.)45 b(Selecting)630 4379 y(some)29 b(other)g (attribute)f(reads)h(the)f(attribute-v)-5 b(alue)29 b(from)f(the)g (mini-bu\013er)e(and)i(inserts)630 4488 y(the)j(attribute)f(v)-5 b(alue)30 b(pair.)275 4682 y(A)25 b(men)m(u)f(is)g(also)h(a)m(v)-5 b(ailable)25 b(directly)e(with)h(a)i(mouse)e(button)h(clic)m(k)g(in)f (the)h(bu\013er.)38 b(In)24 b(GNU)i(Emacs)150 4792 y(it)33 b(is)g(the)h(\014rst)f(mouse)g(button)h(com)m(bined)e(with)h(shift)f (\()p Fh(S-)2232 4789 y Fg(h)p 2256 4736 252 4 v 2256 4792 a Ff(mouse-1)p 2256 4807 V 2503 4789 a Fg(i)2533 4792 y Fm(\).)51 b(In)33 b(Lucid)f(Emacs)i(it)f(is)g(b)s(ound)150 4902 y(to)h(the)f(third)e(mouse)h(button.)48 b(The)33 b(mouse)f(button)h(clic)m(k)g(will)d(p)s(op-up)h(a)i(men)m(u)g(of)g(v) -5 b(alid)31 b(tags)j(or)f(a)150 5011 y(men)m(u)e(of)g(attributes)g(if) g(the)g(p)s(oin)m(t)f(is)h(in)f(a)h(start-tag.)46 b(The)31 b(attributes)g(men)m(u)g(w)m(orks)g(as)g(the)h(\\Insert)150 5121 y(attribute")h(men)m(u)f(from)g(the)g(men)m(u-bar.)47 b(The)32 b(tags)h(list)e(is)h(the)g(list)f(of)i(v)-5 b(alid)31 b(tags)i(describ)s(ed)e(ab)s(o)m(v)m(e)150 5230 y(for)c(command)g Fh(C-c)j Fi(<)p Fm(.)39 b(Selection)27 b(from)g(the)h(tags)g(men)m(u)f(w)m(orks)h(lik)m(e)e(the)i Fh(C-c)h Fi(<)f Fm(command,)g(with)e(the)150 5340 y(follo)m(wing)j (exception:)p eop %%Page: 14 16 14 15 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(14)275 299 y(Y)-8 b(ou)28 b(can)h(tag)g(a)f (region,)h(with)e(start)h(and)g(end-tag.)41 b(There)27 b(are)i(t)m(w)m(o)g(w)m(a)m(ys)g(to)g(indicate)e(the)h(region)150 408 y(to)j(mark:)199 540 y(1.)61 b(Use)31 b(the)f(normal)g(mouse)g (commands)g(to)h(mark)f(region.)330 671 y(F)-8 b(or)44 b(this)d(to)j(w)m(ork)f(y)m(ou)g(m)m(ust)f(either)h(use)f Fj(transien)m(t)g(mark)h(mo)s(de)k Fm(\(see)d(section)f(\\T)-8 b(ransien)m(t)330 781 y(Mark)28 b(Mo)s(de")h(in)e Fj(The)g(Emacs)h (Editor)7 b Fm(\))27 b(or)h(set)h(the)f(option)f Fi (sgml-tag-region-if-active)21 b Fm(to)330 890 y(non-nil)28 b(\(don't)j(set)g(this)e(unless)g(y)m(ou)h(are)h(sure)f(that)h(y)m(ou)g (w)m(an)m(t)g(it\).)199 1022 y(2.)61 b(Alternativ)m(ely)33 b(mak)m(e)i(a)f(secondary)g(selection,)h(this)e(is)g(done)g(b)m(y)h (holding)e(do)m(wn)h(the)h(meta)h(k)m(ey)330 1131 y(and)27 b(using)f(the)i(mouse)g(buttons.)39 b(See)28 b(section)g(\\Secondary)g (selection")g(in)f Fj(The)g(Emacs)h(Editor)7 b Fm(.)330 1241 y(Some)29 b(windo)m(w)f(managers)h(in)m(tercept)g(these)h(ev)m(en) m(ts,)h(whic)m(h)c(mak)m(es)j(it)f(hard)f(use)h(the)g(secondary)330 1350 y(selection)h(in)f(Emacs.)3386 1569 y(User)i(Option)-3726 b Fd(sgml-balanced-tag-edit)390 1678 y Fm(If)30 b(non-nil,)e(inserting) h(a)h(start-tag)j(will)28 b(also)i(insert)f(the)i(corresp)s(onding)d (end-tag.)3386 1897 y(User)j(Option)-3726 b Fd (sgml-auto-insert-required-elemen)m(ts)390 2007 y Fm(If)34 b(non-nil,)f(automatically)h(inserts)g(required)e(elemen)m(ts)j(in)e (the)h(con)m(ten)m(t)j(of)d(an)g(inserted)g(ele-)390 2116 y(men)m(t.)3386 2335 y(User)d(Option)-3726 b Fd (sgml-omittag-transparen)m(t)390 2444 y Fm(If)26 b(non-nil,)f(will)e (sho)m(w)j(legal)g(tags)h(inside)d(elemen)m(ts)j(with)e(omissible)e (start-tags)28 b(and)e(legal)g(tags)390 2554 y(b)s(ey)m(ond)k (omissible)e(end-tags.)3386 2772 y(User)j(Option)-3726 b Fd(sgml-tag-region-if-activ)m(e)390 2882 y Fm(If)29 b(non-nil,)f(the)h(`)p Fi(Insert)g(tags)p Fm(')g(men)m(u)g(will)d(tag) 31 b(a)f(region)f(if)f(the)i(region)f(is)f(considered)h(activ)m(e)390 2991 y(b)m(y)d(emacs.)40 b(If)26 b(nil,)f(region)g(m)m(ust)h(b)s(e)g (activ)m(e)h(and)f Fi(transient-mark-mode)21 b Fm(m)m(ust)k(b)s(e)h(on) g(for)g(the)390 3101 y(region)k(to)h(b)s(e)f(tagged.)3386 3319 y(User)h(Option)-3726 b Fd(sgml-custom-markup)390 3429 y Fm(Men)m(u)36 b(en)m(tries)g(to)g(b)s(e)g(added)f(to)h(the)h (Markup)e(men)m(u.)57 b(The)35 b(v)-5 b(alue)35 b(should)f(b)s(e)i(a)g (list)e(of)i(lists)390 3538 y(of)k(t)m(w)m(o)h(strings.)67 b(The)39 b(\014rst)g(string)f(is)h(the)h(men)m(u)f(line)f(and)h(the)g (second)h(string)f(is)f(the)i(text)390 3648 y(inserted)29 b(when)g(the)h(men)m(u)f(item)h(is)f(selected.)41 b(The)29 b(second)h(string)f(can)h(con)m(tain)g(a)h(`)p Fi(\\r)p Fm(')e(where)390 3758 y(the)j(cursor)f(should)f(b)s(e)h(left.)45 b(Also,)32 b(if)f(a)h(selection)g(is)f(made)h(according)f(to)i(the)f (same)g(rules)f(as)390 3867 y(for)h(the)h Fh(S-mouse-1)d Fm(men)m(u,)i(the)h(selection)f(is)g(replaced)f(with)g(the)i(second)f (string)g(and)g(`)p Fi(\\r)p Fm(')g(is)390 3977 y(replaced)e(with)f (the)h(selection.)390 4108 y(Example:)725 4234 y Fi(\(\("Version1")45 b(""\))773 4338 y(\("New)i(page")94 b(""\)\))3386 4556 y Fm(User)31 b(Option)-3726 b Fd(sgml-insert-missing-elemen)m(t-commen)m(t)390 4666 y Fm(If)38 b(non-nil,)g(and)g(sgml-auto-insert-required-elemen)m(ts)f (also)h(true,)i Fi(sgml-insert-element)390 4775 y Fm(will)32 b(insert)h(a)i(commen)m(t)g(if)f(there)g(is)g(an)g(elemen)m(t)h (required)d(but)i(there)g(is)g(more)g(than)h(one)f(to)390 4885 y(c)m(ho)s(ose)d(from.)3386 5103 y(User)g(Option)-3726 b Fd(sgml-insert-end-tag-on-new-line)390 5213 y Fm(If)32 b(non-nil,)f Fi(sgml-insert-element)c Fm(will)i(put)j(the)g(end-tag)h (on)g(a)f(new)g(line)f(after)i(the)f(start-)390 5322 y(tag.)42 b(Useful)29 b(on)h(slo)m(w)g(terminals)f(if)h(y)m(ou)g (\014nd)f(the)i(end-tag)g(after)g(the)f(cursor)g(irritating.)p eop %%Page: 15 17 15 16 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(15)150 299 y Fn(8.2)68 b(Markup)44 b(completion)275 498 y Fm(If)37 b(y)m(ou)i(are)f(t)m(yping)g(in)e (markup)h(directly)-8 b(,)39 b Fh(M-TAB)e Fm(will)f(help)g(y)m(ou)j(b)m (y)f(completing)f(a)h(tag)i(name,)150 608 y(an)k(en)m(tit)m(y)g(name)g (or)f(a)h(markup)f(declaration)g(name.)81 b(If)43 b(y)m(ou)h(t)m(yp)s (e)g Fh(M-TAB)e Fm(after)i(a)g(plain)e(w)m(ord,)150 718 y Fi(ispell-complete-word)25 b Fm(will)j(b)s(e)h(in)m(v)m(ok)m(ed)i (instead.)275 859 y(If)e(y)m(ou)i(ha)m(v)m(e)h(t)m(yp)s(ed)e(\()p Fc(?)h Fm(marks)f(the)g(p)s(osition)f(of)h(p)s(oin)m(t\))390 995 y Fi(&At)p Fc(?)150 1136 y Fm(and)g(t)m(yp)s(e)g Fh(M-TAB)f Fm(\(assuming)h(y)m(ou)g(use)g(the)h(`)p Fi(ISOLat1)p Fm(')e(en)m(tit)m(y)i(set\))g(y)m(ou)g(get:)390 1272 y Fi(Ã)p Fc(?)150 1547 y Fn(8.3)68 b(Sho)l(wing)45 b(information)275 1746 y Fm(Commands)29 b(for)h(sho)m(wing)f (information)g(obtained)h(b)m(y)g(parsing)f(the)i(bu\013er.)150 1977 y Fh(C-c)e(C-c)163 b Fm(Sho)m(ws)36 b(in)f(the)i(message)h(area:) 53 b(con)m(text)39 b(at)e(p)s(oin)m(t,)h(if)d(in)g(a)i(tag)h(or)e(in)g (mixed)f(con)m(ten)m(t)630 2086 y(and)30 b(the)g(op)s(en)g(elemen)m(ts) h(\()p Fi(sgml-show-context)p Fm(\).)150 2253 y Fh(C-c)e(C-w)163 b Fm(Sho)m(ws)37 b(what)h(elemen)m(t)h(the)f(c)m(haracter)i(after)e(p)s (oin)m(t)f(\(under)g(the)h(cursor\))g(b)s(elongs)f(to;)630 2362 y(also)30 b(sho)m(ws)g(con)m(text)j(of)d(elemen)m(t)h(\()p Fi(sgml-what-element)p Fm(\).)150 2529 y Fh(C-c)e(C-t)163 b Fm(List)41 b(con)m(textually)h(v)-5 b(alid)40 b(tags)i(\()p Fi(sgml-list-valid-tags)p Fm(\).)70 b(Displa)m(ys)41 b(information)630 2638 y(ab)s(out)36 b(curren)m(t)g(elemen)m(t,)j(all)d (v)-5 b(alid)34 b(end-tags,)39 b(v)-5 b(alid)35 b(start-tags)k(in)c (curren)m(t)h(elemen)m(t,)630 2748 y(and)31 b(start-tags)j(v)-5 b(alid)31 b(at)h(this)f(p)s(oin)m(t)g(but)g(in)g(other)h(elemen)m(ts)h (together)g(with)e(the)h(tags)630 2857 y(omitted.)275 3027 y(Y)-8 b(ou)36 b(can)g(mak)m(e)h(the)f(mo)s(de-line)e(displa)m(y)g (the)j(name)f(of)g(the)g(curren)m(t)f(op)s(en)h(elemen)m(t)g(b)m(y)g (setting)150 3137 y(the)d Fi(sgml-live-element-indicat)o(or)27 b Fm(v)-5 b(ariable.)47 b(Setting)33 b(this)f(will)e(mak)m(e)k(all)e (commands)h(slo)m(w)m(er)150 3247 y(due)d(to)h(the)f(w)m(ork)h(needed)f (to)h(k)m(eep)g(the)g(mo)s(de-line)d(up)i(to)h(date.)3386 3502 y(User)g(Option)-3726 b Fd(sgml-liv)m(e-elemen)m(t-indicator)390 3611 y Fm(If)30 b(non-nil,)e(indicate)i(curren)m(t)g(elemen)m(t)h(in)e (mo)s(de)h(line.)390 3753 y(NOTE:)g(Setting)g(this)f(implies)f(that)j (ev)m(ery)g(command)f(can)h(cause)g(a)g(parse.)150 4028 y Fn(8.4)68 b(Inden)l(tation)46 b(according)f(to)g(structure)275 4227 y Fm(Y)-8 b(ou)30 b(can)g(inden)m(t)f(a)h(line)e(according)i(to)h (the)f(depth)f(of)h(elemen)m(t)h(nesting)e(at)h(the)g(b)s(eginning)e (of)i(the)150 4337 y(line.)51 b(T)-8 b(o)35 b(inden)m(t)e(the)h(curren) m(t)h(line)d(use)1608 4334 y Fg(h)p 1632 4281 148 4 v 1632 4337 a Ff(T)-6 b(AB)p 1632 4352 V 1776 4334 a Fg(i)1806 4337 y Fm(.)52 b(Y)-8 b(ou)35 b(can)g(also)f(use)2592 4334 y Fg(h)p 2616 4281 144 4 v 2616 4337 a Ff(LFD)p 2616 4352 V 2756 4334 a Fg(i)2820 4337 y Fm(\()p Fi(newline-and-indent) p Fm(\))150 4446 y(to)d(start)g(a)g(new)f(line)e(with)h(correct)j (inden)m(tation.)3386 4701 y(User)f(Option)-3726 b Fd(sgml-inden)m (t-step)390 4811 y Fm(Ho)m(w)31 b(m)m(uc)m(h)f(to)i(incremen)m(t)e (inden)m(t)f(for)h(ev)m(ery)h(elemen)m(t)g(lev)m(el.)40 b(If)30 b(nil,)f(no)h(inden)m(tation.)390 4953 y(If)g(this)f(is)h(nil,) 906 4950 y Fg(h)p 930 4897 148 4 v 930 4953 a Ff(T)-6 b(AB)p 930 4968 V 1074 4950 a Fg(i)1134 4953 y Fm(will)28 b(insert)h(a)i(tab)g(instead)e(of)i(inden)m(ting.)3386 5208 y(User)g(Option)-3726 b Fd(sgml-inden)m(t-data)390 5317 y Fm(If)30 b(non-nil,)e(inden)m(t)i(in)f(data/mixed)h(con)m(text)i (also.)p eop %%Page: 16 18 16 17 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(16)150 299 y Fn(8.5)68 b(Mo)l(v)l(e)46 b(in)f(the)g(elemen)l(t)h(structure)275 494 y Fm(These)c(commands)g(mo) m(v)m(e)j(in)c(the)i(elemen)m(t)g(structure.)78 b(The)42 b(commands)h(uses)f(kno)m(wledge)h(of)150 604 y(SGML)30 b(syn)m(tax,)h(and)f(if)g(a)m(v)-5 b(ailable)29 b(the)i(sp)s(eci\014c)e (DTD.)150 821 y Fh(C-M-a)240 b Fm(Mo)m(v)m(e)32 b(to)e(the)g(\(con)m (ten)m(t\))i(b)s(eginning)27 b(of)i(the)h(curren)m(t)g(elemen)m(t)g(\() p Fi(sgml-beginning-of-)630 931 y(element)p Fm(\).)150 1093 y Fh(C-M-e)240 b Fm(Mo)m(v)m(e)32 b(to)g(the)e(\(con)m(ten)m(t\))j (end)d(of)g(the)h(curren)m(t)f(elemen)m(t)h(\()p Fi (sgml-end-of-element)p Fm(\).)150 1255 y Fh(C-M-f)240 b Fm(Mo)m(v)m(e)32 b(forw)m(ard)e(b)m(y)h(elemen)m(t)f(\()p Fi(sgml-forward-element)p Fm(\).)150 1418 y Fh(C-M-b)240 b Fm(Mo)m(v)m(e)32 b(bac)m(kw)m(ard)f(b)m(y)g(elemen)m(t)f(\()p Fi(sgml-backward-element)p Fm(\).)150 1580 y Fh(C-M-u)240 b Fm(Mo)m(v)m(e)32 b(up)e(to)h(b)s(efore)f(curren)m(t)g(elemen)m(t)h (\()p Fi(sgml-backward-up-element)p Fm(\).)150 1742 y Fh(C-c)e(C-n)163 b Fm(Mo)m(v)m(e)32 b(up)e(to)h(after)g(curren)m(t)f (elemen)m(t)h(\()p Fi(sgml-up-element)p Fm(\).)150 1904 y Fh(C-M-d)240 b Fm(Mo)m(v)m(e)57 b(do)m(wn)e(to)g(the)h(\(con)m(ten)m (t\))h(b)s(eginning)52 b(of)k(the)f(next)g(elemen)m(t)g(\()p Fi(sgml-down-)630 2014 y(element)p Fm(\).)150 2176 y Fh(C-c)29 b(C-d)163 b Fm(Mo)m(v)m(e)32 b(to)g(the)e(next)h(place)f (where)g(data)h(is)e(allo)m(w)m(ed)i(\()p Fi(sgml-next-data-field)p Fm(\).)275 2340 y(Y)-8 b(ou)32 b(can)g(also)f(mo)m(v)m(e)i(to)g(the)e (next)h(place)g(where)f(there)h(is)e(some)i(structural)f(error)g(with)f Fh(C-c)g(C-o)150 2449 y Fm(\(see)h(Chapter)f(5)h([V)-8 b(alidate],)31 b(page)g(6\).)150 2714 y Fn(8.6)68 b(Editing)46 b(attributes)275 2909 y Fm(If)29 b(y)m(ou)i(w)m(an)m(t)g(to)g(c)m (hange)h(the)e(attributes)g(of)g(a)h(start-tag)h(y)m(ou)f(can)g(simply) c(edit)j(them)g(directly)f(in)150 3019 y(the)35 b(bu\013er.)52 b(Or)33 b(y)m(ou)i(can)g(place)f(the)h(cursor)f(at)h(or)g(after)g(the)f (start-tag)j(and)d(use)g(the)h Fi(sgml-edit-)150 3128 y(attributes)e Fm(command,)k(a)m(v)-5 b(ailable)36 b(from)f(the)h(`)p Fi(SGML)p Fm('-men)m(u)f(or)h(on)g Fh(C-c)29 b(C-a)p Fm(.)57 b(This)34 b(will)f(create)38 b(a)150 3238 y(new)30 b(Emacs)h(windo)m(w)d(with)h(all)h(p)s(ossible)e(attributes)i(listed)e (in)i(the)g(form)390 3369 y Fj(attribute)g(name)53 b Fi(=)47 b Fj(curren)m(t)31 b(v)-5 b(alue)p Fi(.)275 3507 y Fm(The)37 b Fj(curren)m(t)h(v)-5 b(alue)43 b Fm(ma)m(y)c(b)s(e)e(sho) m(wn)h(as)g(`)p Fi(#DEFAULT)p Fm(')e(if)h(the)i(attribute)f(has)g(not)g (b)s(een)f(giv)m(en)i(a)150 3616 y(v)-5 b(alue)27 b(in)f(the)i (start-tag.)42 b(The)27 b(list)f(also)i(con)m(tains)g(the)g(attributes) f(declaration)g(as)h(a)g(commen)m(t.)41 b(Note)150 3726 y(also)30 b(that)h(the)g Fj(curren)m(t)f(v)-5 b(alue)35 b Fm(is)29 b(sho)m(w)i(without)e(ev)m(en)m(tual)i(quotes.)275 3863 y(It)f(is)f(no)m(w)g(p)s(ossible)f(to)j(edit)e(the)h(attribute)g (v)-5 b(alues.)40 b(Y)-8 b(ou)30 b(can)g(mo)m(v)m(e)i(to)e(the)g(next)h (attribute)e(with)150 3970 y Fg(h)p 174 3917 148 4 v 174 3973 a Ff(T)-6 b(AB)p 174 3988 V 318 3970 a Fg(i)348 3973 y Fm(.)47 b(If)33 b(y)m(ou)g(w)m(an)m(t)g(to)h(let)e(an)h (attribute)g(ha)m(v)m(e)g(its)g(default)e(v)-5 b(alue)33 b(use)f Fh(C-c)e(C-d)p Fm(,)i(this)g(will)e(insert)i(a)150 4082 y(`)p Fi(#DEFAULT)p Fm(')d(in)g(the)h(v)-5 b(alue)30 b(\014eld.)275 4220 y(If)e(Emacs)i(is)e(running)e(in)i(an)h(X)g(windo)m (w,)f(the)h(`)p Fi(#DEFAULT)p Fm(')f(will)e(b)s(e)j(underlined)c(to)30 b(distinguish)25 b(it)150 4329 y(from)30 b(normal)f(v)-5 b(alues.)275 4466 y(Finish)25 b(the)k(editing)e(with)g Fh(C-c)i(C-c)p Fm(;)g(this)e(will)e(replace)j(the)h(attribute)f(v)-5 b(alues)27 b(in)g(the)i(main)e(bu\013er)150 4576 y(with)i(those)i (edited.)40 b(Note)32 b(that)f(v)-5 b(alues)29 b(will)f(b)s(e)i(quoted) g(as)h(needed.)275 4713 y(If)e(y)m(ou)i(w)m(an)m(t)g(to)g(ab)s(ort)e (the)i(editing,)e(y)m(ou)h(can)h(remo)m(v)m(e)g(the)g(windo)m(w)d(with) h Fh(C-x)h(0)f Fm(or)i(if)e(y)m(ou)h(w)m(an)m(t)150 4823 y(it)g(neat,)h(kill)d(the)j(bu\013er)e(and)h(remo)m(v)m(e)i(the)e (windo)m(w.)275 4960 y(Some)g(other)h(k)m(eys)g(are:)150 5178 y Fh(C-a)336 b Fm(Go)31 b(to)g(the)g(b)s(eginning)c(of)k(the)g(v) -5 b(alue)29 b(\014eld)g(\()p Fi(sgml-edit-attrib-field-star)o(t)p Fm(\).)150 5340 y Fh(C-e)336 b Fm(Go)31 b(to)g(the)g(end)e(of)i(the)g (v)-5 b(alue)29 b(\014eld)g(\()p Fi(sgml-edit-attrib-field-end)p Fm(\).)p eop %%Page: 17 19 17 18 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(17)150 299 y Fh(C-c)29 b(C-k)163 b Fm(Clear)30 b(the)g(v)-5 b(alue)30 b(\014eld)f(\()p Fi(sgml-edit-attrib-clear)p Fm(\).)150 457 y Fh(C-c)g(C-d)163 b Fm(Set)29 b(the)g(v)-5 b(alue)28 b(\014eld)g(to)h(`)p Fi(#DEFAULT)p Fm(')e(\()p Fi(sgml-edit-attrib-default)p Fm(\).)34 b(This)27 b(is)h(a)h(sp)s(e-)630 567 y(cial)h(v)-5 b(alue)30 b(that)g(will)e(mak)m(e)k(the)e(attribute)g(b)s(e)g(implied.) 150 823 y Fn(8.7)68 b(Changing)45 b(and)g(deleting)h(markup)150 1088 y Fh(C-c)29 b(=)259 b Fm(Change)31 b(the)g(name)f(of)h(the)g (curren)m(t)g(elemen)m(t)g(\()p Fi(sgml-change-element-name)p Fm(\).)36 b(T)-8 b(ries)630 1198 y(to)35 b(translate)f(attribute)g(sp)s (eci\014cations.)51 b(An)33 b(attribute)h(will)e(b)s(e)h(translated)h (to)h(an)f(at-)630 1307 y(tribute)25 b(with)g(the)h(same)h(name.)39 b(If)26 b(the)g(new)g(elemen)m(t)h(has)e(no)h(attribute)g(with)f(the)i (same)630 1417 y(name,)f(the)f(attribute)g(will)d(b)s(e)j(ignored.)38 b(If)24 b(there)h(is)f(an)h(attribute)g(with)e(the)j(same)f(name)630 1527 y(but)30 b(di\013eren)m(t)g(declared)f(con)m(ten)m(t,)k(a)e(w)m (arning)e(is)g(giv)m(en.)630 1661 y(ID)39 b(attributes)g(are)h(handled) d(sp)s(ecially)-8 b(,)40 b(an)g(attribute)f(with)f(declared)g(v)-5 b(alue)39 b(ID)h(will)630 1770 y(alw)m(a)m(ys)31 b(b)s(e)f(translated)g (to)h(the)f(attribute)g(with)g(declared)f(v)-5 b(alue)30 b(ID.)150 1929 y Fh(C-c)f(C-k)163 b Fm(Kill)28 b(next)i(tag,)i(markup)d (declaration)h(or)h(pro)s(cess)e(instruction)g(\()p Fi (sgml-kill-markup)p Fm(\).)150 2087 y Fh(C-M-k)240 b Fm(Kill)28 b(the)i(elemen)m(t)h(follo)m(wing)e(the)i(cursor)e(\()p Fi(sgml-kill-element)p Fm(\).)150 2246 y Fh(C-c)g(-)259 b Fm(Remo)m(v)m(e)32 b(tags)g(from)d(curren)m(t)i(elemen)m(t)g(\()p Fi(sgml-untag-element)p Fm(\).)150 2404 y Fh(C-c)e(#)259 b Fm(Con)m(v)m(ert)27 b(c)m(haracter)h(after)f(p)s(oin)m(t)f(to)h(a)g (c)m(haracter)h(reference)f(\()p Fi(sgml-make-character-)630 2514 y(reference)p Fm(\).)47 b(If)33 b(called)f(with)g(a)i(n)m(umeric)e (argumen)m(t,)i(con)m(v)m(ert)h(a)f(c)m(haracter)g(reference)630 2623 y(bac)m(k)d(to)g(a)g(normal)e(c)m(haracter.)150 2782 y Fh(C-c)g(C-q)163 b Fm(Fills)38 b(an)i(elemen)m(t)h(as)f(a)g (paragraph)g(\()p Fi(sgml-fill-element)p Fm(\).)66 b(This)38 b(is)i(a)g(substitute)630 2891 y(for)30 b(the)g(normal)f Fi(fill-paragraph)p Fm(.)37 b(The)29 b(command)h(uses)g(heuristics)e (to)j(decide)e(what)630 3001 y(should)f(b)s(e)i(a)h(paragraph.)679 3135 y(1.)61 b(If)30 b(p)s(oin)m(t)f(is)h(in)f(an)h(elemen)m(t)h(con)m (ten)m(t,)h(recursiv)m(ely)d(\014ll)g(the)h(sub-elemen)m(ts.)679 3269 y(2.)61 b(Find)29 b(the)h(biggest)h(elemen)m(t)g(with)e(mixed)g (con)m(ten)m(t)j(con)m(taining)e(p)s(oin)m(t.)679 3403 y(3.)61 b(If)41 b(the)h(ab)s(o)m(v)m(e)g(elemen)m(t)g(is)f(mixed)f(but) h(con)m(tains)h(elemen)m(ts)g(with)e(pure)g(elemen)m(t)810 3513 y(con)m(ten)m(t)33 b(then)e(\014ll)f(what)h(is)g(b)s(et)m(w)m(een) h(the)f(pure)g(elemen)m(ts)h(as)f(paragraphs)g(and)g(\014ll)810 3622 y(the)g(pure)e(elemen)m(ts)i(recursiv)m(ely)-8 b(.)150 3829 y Fh(M-x)29 b(sgml-expand-all-shortrefs)630 3939 y Fm(Short)37 b(references)h(to)g(text)g(en)m(tities)f(are)h(expanded)f (to)h(the)g(replacemen)m(t)g(text)g(of)g(the)630 4049 y(en)m(tit)m(y)43 b(other)f(short)g(references)h(are)f(expanded)g(in)m (to)g(general)g(en)m(tit)m(y)h(references.)76 b(If)630 4158 y(argumen)m(t,)48 b Fj(to-en)m(tit)m(y)p Fm(,)i(is)43 b(non-)p Fi(nil)p Fm(,)j(or)e(if)f(called)h(in)m(teractiv)m(e)g(with)f (n)m(umeric)g(pre\014x)630 4268 y(argumen)m(t,)31 b(all)e(short)h (references)h(are)g(replaced)f(b)m(y)g(generally)g(en)m(tit)m(y)h (references.)150 4426 y Fh(M-x)e(sgml-normalize)630 4536 y Fm(Normalize)h(the)h(do)s(cumen)m(t)f(in)f(the)h(bu\013er.)40 b(This)29 b(will)679 4670 y(1.)61 b(expand)30 b(short)g(references,)679 4804 y(2.)61 b(insert)29 b(missing)g(tags,)679 4938 y(3.)61 b(replace)30 b(minimized)e(tags)j(with)e(full)f(tags,)679 5072 y(4.)61 b(\014x)30 b(attribute)g(sp)s(eci\014cation)f(lists)g (according)h(to)h(options)f(set.)630 5230 y(There)f(is)g(one)h(argumen) m(t,)g Fj(to-en)m(tit)m(y)p Fm(,)i(with)c(the)i(same)g(meaning)f(as)h (for)f Fi(sgml-expand-)630 5340 y(all-shortrefs)p Fm(.)p eop %%Page: 18 20 18 19 bop 150 -116 a Fm(Chapter)30 b(8:)41 b(Commands)29 b(for)h(editing)2156 b(18)630 299 y(There)35 b(is)f(one)h(option)g(for) g(the)g(normalize)f(command.)55 b(With)34 b(its)h(default)f(v)-5 b(alue,)36 b(nor-)630 408 y(malize)g(ma)m(y)i(actually)f(c)m(hange)h (the)f(data)h(con)m(ten)m(t)g(of)g(some)f(elemen)m(ts.)61 b(But)37 b(only)f(b)m(y)630 518 y(remo)m(ving)30 b(some)h(white-space)f (from)g(the)h(end)f(of)g(elemen)m(ts)h(with)e(omitted)h(end-tags.)3386 752 y(User)h(Option)-3726 b Fd(sgml-normalize-trims)390 862 y Fm(If)23 b(non-nil,)g Fi(sgml-normalize)d Fm(will)h(trim)h(o\013) i(white)f(space)h(from)f(end)g(of)h(elemen)m(t)g(when)e(adding)390 971 y(end-tag.)390 1106 y(Default:)41 b Fi(t)p Fm(.)150 1363 y Fn(8.8)68 b(T)-11 b(ranslating)46 b(b)t(et)l(w)l(een)g(c)l (haracters)f(and)g(en)l(tit)l(y)i(references)275 1556 y Fm(Set)35 b(the)h(v)-5 b(ariable)34 b Fi(sgml-display-char-list-f)o (ilen)o(ame)29 b Fm(to)36 b(a)g(\014le)e(that)i(con)m(tains)g(mappings) 150 1665 y(b)s(et)m(w)m(een)j(all)f(c)m(haracters)i(presen)m(t)e(in)g (the)g(presen)m(tation)h(c)m(haracter)h(set,)i(and)c(their)f Fi(")p Fm(standard)h(re-)150 1775 y(placemen)m(t)31 b(text)p Fi(")g Fm(names,)f(e.g.)42 b Fi("")30 b Fm(-)p Fi(>)g(")p Fm([aring)g(])p Fi(")p Fm(,)g(e.t.c.)275 1910 y(The)f(default)h(v)-5 b(alue)30 b(for)g(this)f(v)-5 b(ariable)29 b(is)h(`iso88591.map'.)275 2044 y(Then)f(use)h(the)h(functions)d(\(also)j(in)e(the)i(Mo)s(dify)e (men)m(u\))150 2253 y Fi(sgml-charent-to-display-)o(char)150 2388 y(sgml-display-char-to-cha)o(rent)275 2522 y Fm(to)i(translate)f (b)s(et)m(w)m(een)h(en)m(tities)f(and)g(c)m(haracters.)p eop %%Page: 19 21 19 20 bop 150 -116 a Fm(Chapter)30 b(9:)41 b(App)s(earance)30 b(of)h(text)g(in)e(the)i(bu\013er)1757 b(19)150 299 y Fk(9)80 b(App)t(earance)53 b(of)h(text)f(in)i(the)d(bu\013er)150 618 y Fn(9.1)68 b(F)-11 b(olding)45 b(editing)275 805 y Fm(With)32 b(these)i(commands)f(y)m(ou)h(can)f(mak)m(e)h(parts)f(of)h (the)f(text)i(temp)s(orarily)c(in)m(visible)f(to)k(mak)m(e)g(it)150 915 y(easier)c(to)h(see)g(the)g(o)m(v)m(erall)g(structure)e(of)i(y)m (our)f(text.)275 1044 y(When)35 b(folding)f(a)i(region)f(all)f(the)i (lines)e(but)h(the)g(\014rst)g(will)e(b)s(e)i(in)m(visible.)53 b(The)35 b(\014rst)g(line)f(of)i(the)150 1154 y(region)30 b(will)e(still)g(b)s(e)i(visible)e(with)h(an)h(ellipsis)d(at)k(the)f (end.)275 1283 y(See)g(section)h(\\Outline)d(Mo)s(de")j(in)e Fj(The)h(Emacs)h(Editor)7 b Fm(.)150 1470 y Fh(C-c)29 b(C-f)h(C-r)630 1580 y Fm(The)g(region)g(b)s(et)m(w)m(een)h(p)s(oin)m (t)e(and)h(mark)g(will)e(b)s(e)i(folded)f(\()p Fi(sgml-fold-region)p Fm(\).)150 1729 y Fh(C-c)g(C-f)h(C-e)630 1838 y Fm(The)41 b(region)f(b)s(et)m(w)m(een)i(the)f(start)h(and)e(end)h(of)g(the)g (curren)m(t)g(elemen)m(t)g(will)e(b)s(e)h(folded)630 1948 y(\()p Fi(sgml-fold-element)p Fm(\).)630 2077 y(This)26 b(command)i(can)h(also)f(fold)f(the)i(SGML)f(declaration)f(or)i(the)f (DOCTYPE)g(declara-)630 2186 y(tion.)150 2335 y Fh(C-c)h(C-f)h(C-s)630 2445 y Fm(F)-8 b(old)30 b(all)g(the)g(sub)f(elemen)m(ts)i(of)g(the)f (curren)m(t)g(elemen)m(t)h(\()p Fi(sgml-fold-subelement)p Fm(\).)150 2593 y Fh(C-c)e(C-s)150 2703 y(C-c)g(C-u)h(C-l)630 2812 y Fm(Unfold)j(the)i(curren)m(t)g(line,)f(assuming)g(it)g(is)g(the) h(\014rst)f(line)f(of)i(a)g(folded)f(region)g(\()p Fi(sgml-)630 2922 y(unfold-line)p Fm(\).)150 3071 y Fh(C-c)29 b(C-u)h(C-e)630 3180 y Fm(Mak)m(e)i(all)d(lines)g(in)g(curren)m(t)h(elemen)m(t)h (visible)d(\()p Fi(sgml-unfold-element)p Fm(\).)150 3329 y Fh(C-c)h(C-u)h(C-a)630 3438 y Fm(Mak)m(e)i(all)d(lines)g(in)g(curren) m(t)h(bu\013er)f(visible)f(\()p Fi(sgml-unfold-all)p Fm(\).)150 3587 y Fh(C-c)h(C-f)h(C-x)630 3697 y Fm(Unfold)21 b(curren)m(t)h(elemen)m(t)h(and)f(then)g(fold)f(the)i(sub)s(elemen)m (ts)e(\()p Fi(sgml-expand-element)p Fm(\).)630 3806 y(If)30 b(the)g(curren)m(t)h(elemen)m(t)f(is)g(folded)f(this)g(expands)h(what)g (is)g(visible.)150 4047 y Fn(9.2)68 b(Hiding)45 b(markup)275 4235 y Fm(***)31 b(Describ)s(e)f(hide-tags)150 4476 y Fn(9.3)68 b(Highligh)l(ting)47 b(markup)275 4663 y Fm(PSGML)25 b(can)h(highligh)m(t)d(the)j(markup)e(giving)h(the)g(markup)g(a)g (di\013eren)m(t)g Fj(face)32 b Fm(\(see)27 b(section)e(\\Using)150 4773 y(Multiple)42 b(T)m(yp)s(efaces")j(in)e Fj(The)h(Emacs)g(Editor)7 b Fm(\).)82 b(The)43 b(highligh)m(ting)f(will)f(only)j(b)s(e)f(done)i (if)e(the)150 4882 y(v)-5 b(ariable)37 b Fi(sgml-set-face)d Fm(is)j(non-)p Fi(nil)p Fm(.)61 b(The)38 b(default)f(settings)g(mak)m (e)i(tags)g(b)s(old)d(and)h(commen)m(ts)150 4992 y(italic,)32 b(but)f(this)g(can)h(b)s(e)g(mo)s(di\014ed)e(with)h(the)h(v)-5 b(ariable)31 b Fi(sgml-markup-faces)p Fm(.)41 b(When)32 b(highligh)m(ting)150 5101 y(is)24 b(on)i(PSGML)f(will)e(parse)i(after) h(ev)m(ery)g(command)f(un)m(til)f(the)i(whole)e(bu\013er)h(has)g(b)s (een)g(parsed)f(or)i(user)150 5211 y(ev)m(en)m(t)32 b(o)s(ccurs.)275 5340 y(T)-8 b(o)30 b(remo)m(v)m(e)i(the)f(highligh)m(ting)c(t)m(yp)s(e) k Fh(M-x)e(sgml-clear-faces)p Fm(.)p eop %%Page: 20 22 20 21 bop 150 -116 a Fm(Chapter)30 b(9:)41 b(App)s(earance)30 b(of)h(text)g(in)e(the)i(bu\013er)1757 b(20)3386 299 y(User)31 b(Option)-3726 b Fd(sgml-set-face)390 408 y Fm(If)30 b(non-nil,)e(psgml)h(will)f(set)j(the)g(face)g(of)f(parsed)g (markup.)3386 643 y(User)h(Option)-3726 b Fd(sgml-markup-faces)390 752 y Fm(A)35 b(list)f(of)i(markup)e(to)i(face)g(mappings.)54 b(Eac)m(h)36 b(elemen)m(t)g(lo)s(oks)f(lik)m(e)f Fi(\()p Fj(markup-t)m(yp)s(e)h Fi(.)30 b Fj(face)5 b Fi(\))p Fm(.)390 862 y(P)m(ossible)29 b(v)-5 b(alues)30 b(for)g Fj(markup-t)m(yp)s(e)35 b Fm(is:)390 1021 y Fi(comment)144 b Fm(commen)m(t)31 b(declaration)390 1181 y Fi(doctype)144 b Fm(do)s(ct)m(yp)s(e)30 b(declaration)390 1340 y Fi(end-tag)144 b Fm(end-tag)390 1499 y Fi(ignored)g Fm(ignored)29 b(mark)m(ed)i (section)390 1659 y Fi(ms-start)96 b Fm(mark)m(ed)30 b(section)h(end,)f(if)f(not)i(ignored)390 1818 y Fi(ms-end)192 b Fm(mark)m(ed)30 b(section)h(start,)g(if)f(not)g(ignored)390 1978 y Fi(pi)384 b Fm(pro)s(cessing)29 b(instruction)390 2137 y Fi(sgml)288 b Fm(SGML)30 b(declaration)390 2296 y Fi(start-tag)870 2406 y Fm(start-tag)390 2565 y Fi(entity)192 b Fm(en)m(tit)m(y)31 b(reference)390 2725 y Fi(shortref)96 b Fm(short)30 b(reference)p eop %%Page: 21 23 21 22 bop 150 -116 a Fm(Chapter)30 b(10:)41 b(Miscellaneous)30 b(options)2135 b(21)150 299 y Fk(10)80 b(Miscellaneous)54 b(options)275 533 y Fm(***)31 b(describ)s(e)e(sgml-sa)m(v)m(e-options) 3386 767 y(User)i(Option)-3726 b Fd(sgml-ignore-unde\014ned-elemen)m (ts)390 877 y Fm(Start-tags)29 b(for)e(unde\014ned)f(elemen)m(ts)h (will)e(either)i(b)s(e)g(ignored,)h(if)e Fi(sgml-ignore-undefined-)390 986 y(elements)j Fm(is)i Fi(t)p Fm(,)h(or)f(assumed)g(to)h(b)s(e)f (acceptable)i(in)d(the)i(curren)m(t)f(elemen)m(t)h(and)f(de\014ned)f (with)390 1096 y Fi(O)g(O)g(ANY)3386 1330 y Fm(User)h(Option)-3726 b Fd(sgml-range-indicator-max-length)390 1440 y Fm(Maxim)m(um)32 b(n)m(um)m(b)s(er)g(of)h(c)m(haracters)h(used)e(from)h(the)g(\014rst)f (and)g(last)h(en)m(try)g(of)g(a)h(sub-men)m(u)d(to)390 1549 y(indicate)e(the)i(range)g(of)f(that)h(men)m(u.)390 1684 y(This)25 b(is)h(used)h(for)f(long)h(men)m(us)g(of)g(elemen)m(ts,) h(tags)g(or)f(en)m(tities)g(that)h(are)f(split)e(in)m(to)i Fi(sgml-max-)390 1793 y(menu-size)h Fm(big)h(sub-men)m(us.)p eop %%Page: 22 24 22 23 bop 150 -116 a Fm(Chapter)30 b(11:)41 b(Bugs)2803 b(22)150 299 y Fk(11)80 b(Bugs)275 533 y Fm(If)33 b(y)m(ou)i(encoun)m (ter)g(something)f(that)g(y)m(ou)h(think)e(is)g(a)i(bug,)g(please)f (rep)s(ort)g(it.)52 b(T)-8 b(ry)33 b(to)i(include)e(a)150 643 y(clear)e(description)e(of)i(the)g(undesired)d(b)s(eha)m(viour.)41 b(A)31 b(test)h(case)f(that)h(exhibits)d(the)i(bug,)f(w)m(ould)g(also) 150 752 y(b)s(e)g(useful.)275 887 y(Y)-8 b(ou)30 b(can)h(rep)s(ort)f(a) h(bug)e(with)g(the)i(command)f Fh(M-x)g(sgml-submit-bug-report)p Fm(.)275 1021 y(When)38 b(PSGML)g(needs)h(con)m(textual)g(information)e (it)h(parses)h(the)f(do)s(cumen)m(t)h(up)e(to)j(the)f(p)s(oin)m(t.)150 1131 y(During)24 b(the)i(parsing,)f(it)g(builds)e(a)j(parse)f(tree.)40 b(The)25 b(parse)g(tree)h(is)f(used)f(to)j(initialize)c(the)i(next)h (parse,)150 1240 y(to)j(a)m(v)m(oid)g(ha)m(ving)f(to)i(parse)e(things)g (already)g(parsed.)39 b(Changes)28 b(to)i(the)e(bu\013er)g(is)g(supp)s (osed)e(to)j(prune)150 1350 y(the)f(tree)h(of)f(all)f(outdated)h (information.)39 b(But)28 b(if)f(y)m(ou)h(get)h(strange)g(complain)m (ts)e(from)h(the)g(parser,)g(try)150 1460 y(and)i(bac)m(k)h(up)e(a)i (bit)e(and)h(use)g Fh(C-c)g(C-o)f Fm(\()p Fi(sgml-next-trouble-spot)p Fm(\).)p eop %%Page: 23 25 23 24 bop 150 -116 a Fm(Chapter)30 b(12:)41 b(Index)2776 b(23)150 299 y Fk(12)80 b(Index)275 658 y Fb(\(Index)24 b(is)i(nonexisten)n(t\))p eop %%Page: -1 26 -1 25 bop 3725 -116 a Fm(i)150 299 y Fk(T)-13 b(able)54 b(of)g(Con)l(ten)l(ts)150 641 y Fn(1)135 b(In)l(tro)t(duction)15 b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f (.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)60 b Fn(1)150 911 y(2)135 b(Installing)46 b(PSGML)34 b Fa(.)19 b(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h (.)f(.)h(.)f(.)g(.)h(.)f(.)80 b Fn(2)150 1181 y(3)135 b(Ho)l(w)45 b(to)h(in)l(v)l(ok)l(e)g(PSGML)12 b Fa(.)18 b(.)h(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f (.)h(.)f(.)56 b Fn(3)150 1450 y(4)135 b(The)44 b(En)l(tit)l(y)j (Manager)33 b Fa(.)19 b(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h (.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)77 b Fn(4)150 1720 y(5)135 b(Running)44 b(an)h(external)i(SGML)c(parser)14 b Fa(.)20 b(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)58 b Fn(6)150 1990 y(6)135 b(SGML)43 b(Declaration)16 b Fa(.)22 b(.)e(.)f(.)g(.)h(.)f (.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.) f(.)61 b Fn(7)150 2260 y(7)135 b(Do)t(cumen)l(t)45 b(T)l(yp)t(e)f (Declaration)16 b Fa(.)22 b(.)d(.)h(.)f(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h (.)f(.)h(.)f(.)61 b Fn(8)449 2397 y Fm(7.1)92 b(Precompiled)29 b(DTD)i(Subsets)22 b Fe(.)14 b(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)52 b Fm(8)449 2506 y(7.2)92 b(Using)30 b(a)g(Split)e(Do)s (cumen)m(t)i Fe(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)59 b Fm(9)449 2616 y(7.3)92 b(Inserting)29 b(a)i(DOCTYPE)23 b Fe(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)53 b Fm(10)449 2726 y(7.4)92 b(Information)29 b(from)h(the)h(DTD)11 b Fe(.)k(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)40 b Fm(10)150 2968 y Fn(8)135 b(Commands)45 b(for)g(editing)39 b Fa(.)20 b(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f (.)g(.)h(.)f(.)83 b Fn(12)449 3105 y Fm(8.1)92 b(Inserting)29 b(Markup)g Fe(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)h(.)f(.)g(.)g(.)g(.)58 b Fm(12)449 3215 y(8.2)92 b(Markup)30 b(completion)9 b Fe(.)14 b(.)h(.)g(.)g(.)g(.)h(.)f(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)39 b Fm(15)449 3324 y(8.3)92 b(Sho)m(wing)29 b(information)8 b Fe(.)14 b(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.) 37 b Fm(15)449 3434 y(8.4)92 b(Inden)m(tation)30 b(according)g(to)h (structure)15 b Fe(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)44 b Fm(15)449 3543 y(8.5)92 b(Mo)m(v)m(e)32 b(in)d(the)i(elemen)m(t)g(structure)13 b Fe(.)i(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)43 b Fm(16)449 3653 y(8.6)92 b(Editing)28 b(attributes)20 b Fe(.)15 b(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)49 b Fm(16)449 3763 y(8.7)92 b(Changing)29 b(and)h(deleting)f (markup)17 b Fe(.)e(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)47 b Fm(17)449 3872 y(8.8)92 b(T)-8 b(ranslating)29 b(b)s(et)m(w)m(een)i(c)m (haracters)h(and)e(en)m(tit)m(y)h(references)20 b Fe(.)15 b(.)g(.)g(.)g(.)g(.)49 b Fm(18)150 4115 y Fn(9)135 b(App)t(earance)44 b(of)h(text)h(in)f(the)g(bu\013er)20 b Fa(.)g(.)g(.)f(.)g(.)h(.)f(.)h (.)f(.)h(.)f(.)65 b Fn(19)449 4252 y Fm(9.1)92 b(F)-8 b(olding)29 b(editing)14 b Fe(.)g(.)h(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)43 b Fm(19)449 4361 y(9.2)92 b(Hiding)28 b(markup)12 b Fe(.)i(.)h(.)g(.)g (.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)h(.) f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)41 b Fm(19)449 4471 y(9.3)92 b(Highligh)m(ting)28 b(markup)f Fe(.)15 b(.)g(.)g(.)g(.)h(.)f(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.) g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g(.)g (.)g(.)g(.)g(.)58 b Fm(19)150 4713 y Fn(10)135 b(Miscellaneous)46 b(options)21 b Fa(.)f(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f (.)g(.)h(.)f(.)h(.)f(.)h(.)65 b Fn(21)150 4983 y(11)135 b(Bugs)17 b Fa(.)i(.)g(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g (.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.) f(.)h(.)f(.)g(.)62 b Fn(22)150 5253 y(12)135 b(Index)27 b Fa(.)20 b(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f (.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.)h(.)f(.)h(.)f(.)h(.)f(.)g(.) h(.)72 b Fn(23)p eop %%Trailer end userdict /end-hook known{end-hook}if %%EOF ./psgml-1.4.0/psgml.texi0000640000076500000240000016756510212356414013326 0ustar dialout\input texinfo @c -*-texinfo-*- @c %**start of header @setfilename psgml.info @settitle psgml @c @setchapternewpage odd @syncodeindex fn cp @syncodeindex vr cp @synindex ky cp @c %**end of header @c $Id: psgml.texi,v 1.8 2005/03/02 19:44:20 lenst Exp $ @ifinfo @format START-INFO-DIR-ENTRY * PSGML: (psgml). PSGML, a major mode for SGML documents. END-INFO-DIR-ENTRY @end format @end ifinfo @ifinfo Documentation for PSGML, a major mode for SGML. Copyright 1994, 1996, 1998 Lennart Staflin Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end ifinfo @titlepage @title Editing SGML with Emacs and PSGML @author Lennart Staflin @c The following two commands @c start the copyright page. @page @vskip 0pt plus 1filll Copyright @copyright{} 1994, 1996, 1998 Lennart Staflin @c Published by ... Permission is granted to make and distribute verbatim copies of this manual provided the copyright notice and this permission notice are preserved on all copies. @ignore Permission is granted to process this file through TeX and print the results, provided the printed document carries a copying permission notice identical to this one except for the removal of this paragraph (this paragraph not being relevant to the printed manual). @end ignore Permission is granted to copy and distribute modified versions of this manual under the conditions for verbatim copying, and provided that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this manual into another language, under the above conditions for modified versions, except that this permission notice may be stated in a translation approved by the Free Software Foundation. @end titlepage @node Top, Introduction, (dir), (dir) @comment node-name, next, previous, up @ifinfo @top PSGML PSGML is a major mode for editing SGML documents. This is the DRAFT documentation for PSGML version 1.4. @end ifinfo @menu * Introduction:: Introduction * Install:: How to install PSGML * Invoke:: How to invoke PSGML * Entity manager:: The Entity Manager * Validate:: Running an external SGML parser * SGML declaration:: Using an SGML declaration * Managing the DTD:: Specifying what DTD to use * Edit:: Commands for editing * Display:: Appearance of text in the buffer * Miscellaneous options:: * Bugs:: Reporting bugs * Index:: @end menu @c *** section about error recovery ?? @c ------------------------------------------------------------------ @node Introduction, Install, Top, Top @comment node-name, next, previous, up @chapter Introduction @cindex CONCUR @cindex DATATAG @cindex LINK @cindex RANK @cindex SGML Declaration PSGML is a major mode for editing SGML and XML documents. It works with GNU Emacs 19.34, 20.3 and later or with XEmacs 19.9 and later. PSGML contains a simple SGML parser and can work with any DTD. Functions provided includes menus and commands for inserting tags with only the contextually valid tags, identification of structural errors, editing of attribute values in a separate window with information about types and defaults, and structure based editing. SGML, a language for encoding the structure of a document, is an ISO standard: ISO 8879:1986 ``Information processing -- Text and office systems -- Standard Generalized Markup Language (SGML)''. A good introduction to SGML is @cite{A Gentle Introduction to SGML} produced by Text Encoding Initiative (this is really chapter 2 of TEI P3). This can be found on @display @file{ftp://ftp.ifi.uio.no/pub/SGML/TEI/P3SG.DOC}. @end display A SGML document has three major parts, in order: @enumerate @item SGML Declaration (@samp{}) @item Document Type Declaration (@samp{}) @item Document Element (@samp{<@var{name}> @dots{} }) @end enumerate The SGML declaration contains general information about character sets, concrete syntax, and SGML features used. PSGML does not use the SGML Declaration, it can be left out, and if included is ignored. Many SGML systems allow the SGML declaration to be defaulted. PSGML always use the Concrete Reference Syntax but without limitations on lengths. Features used has to be indicated with variables (@pxref{SGML declaration}). The document type declaration specifies the valid elements and entities and how they can be nested. A document type is usually needed, but can reside in another file (@pxref{Managing the DTD}). The system declaration for PSGML: @example SYSTEM "ISO 8879:1986" CHARSET BASESET "ISO 646-1983//CHARSET International Reference Version (IRV)//ESC 2/5 4/0" DESCSET 0 128 0 CAPACITY PUBLIC "ISO 8879:1986//CAPACITY Reference//EN" FEATURES MINIMIZE DATATAG NO OMITTAG YES RANK NO SHORTTAG YES LINK SIMPLE NO IMPLICIT NO EXPLICIT NO OTHER CONCUR NO SUBDOC YES 1 FORMAL YES SCOPE DOCUMENT SYNTAX PUBLIC "ISO 8879:1986//SYNTAX Reference//EN" @c SYNTAX PUBLIC "ISO 8879:1986//SYNTAX Core//EN" VALIDATE GENERAL NO MODEL NO EXCLUDE NO CAPACITY NO NONSGML NO SGML NO FORMAL NO SDIF PACK NO UNPACK NO @end example @c ------------------------------------------------------------------------- @node Install, Invoke, Introduction, Top @comment node-name, next, previous, up @chapter Installing PSGML To install PSGML you first need to uncompress and unpack the source archive. This is done with the @code{gunzip} and @code{tar} commands. @example gunzip psgml-1.2.0.tar.gz; tar xf psgml-1.2.0.tar @end example This should create a subdirectory to the current directory with the source code. This directory contains a @code{configure} command (see the file INSTALL for more information about configure). You can use the @code{configure} command to configure the package or you can load the file @file{psgml-maint} and execute the @code{psgml-compile-files} command. Place the @file{*.el} and the @file{*.elc} files in a directory where Emacs can find it (i.e. one of the directories in the @code{load-path} variable, you can add a directory to this variable in your @file{.emacs}.) If you use the @code{configure} approach, compile psgml with @code{make} and the you can run @code{make install} to install it in the system library @file{site-lisp}. The location of @file{site-lisp} is figured out by @code{configure}, but you can change it in the @file{Makefile}. Put the following line in your .emacs: @lisp (autoload 'sgml-mode "psgml" "Major mode to edit SGML files." t) (autoload 'xml-mode "psgml" "Major mode to edit XML files." t) @end lisp You may also want to set up search paths for external entities, @xref{Entity manager}. The @file{psgml.info} is the documentation for PSGML in the info format. You can read this with the Emacs command @kbd{C-u C-h i}. You can also install the file in your systems info directory and edit the @file{dir} file to include @file{psgml.info} in the menu. The info file @file{psgml.info} is created from the texinfo file @file{psgml.texi}. The texinfo file can also be used to create a hard copy of the documentation. To do this you need the @TeX{} program and a copy of @file{texinfo.tex}. @c -------------------------------------------------------------------------- @node Invoke, Entity manager, Install, Top @comment node-name, next, previous, up @chapter How to invoke PSGML @cindex invoke @cindex start up @cindex major mode @findex sgml-mode PSGML defines major modes called @code{sgml-mode} and @code{xml-mode}. Files with extensions @file{.sgml}, @file{.sgm} or @file{.dtd} will automatically be edited in SGML mode. To edit some other file in SGML mode, type @kbd{M-x sgml-mode @key{RET}} after finding the file. To edit XML files, type @kbd{M-x xml-mode @key{RET}}. If you can modify the file you can add a @dfn{Local Variables} list (@pxref{file variables, , Local Variables in Files, emacs, The Emacs Editor}) to the end of the file. This can make Emacs automatically set sgml mode and user options when the file is loaded. The simplest Local Variables list would look like: @example @end example You can also put a line at the top of the file to tell emacs to use sgml mode: @example @end example For XML replace @samp{sgml} with @samp{xml} in the above examples. But remember that you can't have a comment before the @emph{SGML declaration} or the @emph{XML declaration}. @c ------------------------------------------------------------------------- @node Entity manager, Validate, Invoke, Top @comment node-name, next, previous, up @chapter The Entity Manager @cindex public identifier @cindex system identifier @cindex external identifier @cindex entity catalog @c *** sgml-sysid-resolve-functions SGML can refer to an external file (really entity) with an @emph{external identifier}, this is a @emph{public identifier} or a @emph{system identifier}, or both. A typical public identifier looks like @example PUBLIC "ISO 8879:1986//ENTITIES Added Latin 1//EN" @end example @noindent where ``ISO 8879:1986'' is the owner, ``ENTITIES'' is the text class and ``Added Latin 1'' is the text description (and ``EN'' is language). A system identifier looks like @example SYSTEM "htmlplus.dtd" @end example @noindent where ``htmlplus.dtd'' is a system-specific identifier. To map external identifiers to file names, PSGML first searches entity catalog files and then search the list of file name templates in the variable @code{sgml-public-map}. The catalog format is according to SGML/Opens resolution on entity management. The catalog consists of a series of entries and comments. A comment is delimited by @samp{--} like in a markup declaration. The entry types recognized are described in the following table. @table @samp @item public @var{pubid} @var{file} The @var{file} will be used for the entity text of an entity with the public identifier @var{pubid}. @item entity @var{name} @var{file} The @var{file} will be used for the entity text of an entity with the name @var{name}. If the @var{name} starts with a @samp{%} the rest of the name will be matched against parameter entities. @item doctype @var{name} @var{file} The @var{file} will be used for the entity text of an entity used as external subset of a document declaration with @var{name} as document type name. @item sgmldecl @var{file} Used to specify a default SGML declaration. Recognized but not used by PSGML other than to pass to an external validation command (@code{sgml-validate-command}). @end table When PSGML is looking for the file containing an external entity, the following things will be tried in order: @enumerate @vindex sgml-system-identifiers-are-preferred @item Try the system identifier, as a file name, if there is a system identifier and the variable @code{sgml-system-identifiers-are-preferred} is non-@code{nil} and there is no elements containing @samp{%s} in @code{sgml-public-map}. If the system identifier is a relative file name it will be relative to the directory containing the defining entity. @item Look thru each catalog in @code{sgml-local-catalogs} and @code{sgml-catalog-files} in order. For each catalog look first for entries matching the public identifier, if any. Then look for other matching entries in the order they appear in the catalog. Currently an entry will be ignored if it is matching but its file is non-existent or unreadable. (This is under reconsideration, perhaps it should signal error instead). @item Try the system identifier, if any, as a file name. If @code{sgml-system-identifiers-are-preferred} is @code{nil} and there is no elements containing @samp{%s} in @code{sgml-public-map}. @item Try the entries in @code{sgml-public-map}. Using the catalogs are preferred. The @code{sgml-public-map} may disappear in a future version of PSGML (not soon though). @end enumerate The @code{sgml-public-map} variable can contain a list of file name templates where @samp{%P} will be substituted with the whole public identifier, owner is substituted for @samp{%O}, public text class for @samp{%C}, and public text description for @samp{%D}. The text class will be converted to lower case and the owner and description will be transliterated according to the variable @code{sgml-public-transliterations}. The templates in the list is tried in order until an existing file is found. The @code{sgml-public-map} is modeled after @file{sgmls} environment variable @code{SGML_PATH} and psgml understand the following substitution characters: %%, %N, %P, %S, %Y, %C, %L, %O, %T, and %V. The default value of @code{sgml-public-map} is taken from the environment variable @code{SGML_PATH}. Given the public identifier above and the file name template @samp{/usr/local/lib/sgml/%o/%c/%d}, the resulting file name is @example /usr/local/lib/sgml/ISO_8879:1986/entities/Added_Latin_1 @end example Note: blanks are transliterated to @samp{_} (and also @samp{/} to @samp{%}) and the text class is down cased. @defopt sgml-catalog-files This is a list of catalog entry files. The files are in the format defined in the SGML Open Draft Technical Resolution on Entity Management. The Emacs variable is initialized from the environment variable @code{SGML_CATALOG_FILES} or if this variable is undefined the default is @lisp ("CATALOG" "/usr/local/lib/sgml/CATALOG") @end lisp @end defopt @defopt sgml-local-catalogs A list of SGML entity catalogs to be searched first when parsing the buffer. This is used in addition to @code{sgml-catalog-files}, and @code{sgml-public-map}. This variable is automatically local to the buffer. @end defopt @defopt sgml-system-identifiers-are-preferred If @code{nil}, PSGML will look up external entities by searching the catalogs in @code{sgml-local-catalogs} and @code{sgml-catalog-files} and only if the entity is not found in the catalogs will a given system identifier be used. If the variable is non-nil and a system identifier is given, the system identifier will be used for the entity. If no system identifier is given the catalogs will searched. @end defopt @defopt sgml-public-map This should be a list of file name templates. This variable is initialized from the environment variable @code{SGML_PATH}. This is the same environment variable that @file{sgmls} uses. If the environment variable is undefined the default is @lisp ("%S" "/usr/local/lib/sgml/%o/%c/%d") @end lisp @c Mapping from public identifiers to file names. @end defopt @c the colon separated list in @code{SGML_PATH} is converted to a lisp list @c ------------------------------------------------------------------------- @node Validate, SGML declaration, Entity manager, Top @comment node-name, next, previous, up @chapter Running an external SGML parser @kindex C-c C-v @findex sgml-validate PSGML can not validate an SGML document (see below what it can and can't do). If you have a validating SGML parser, like @file{sgmls}, you can run the parser on your file with the command @kbd{C-c C-v} (@code{sgml-validate}). Some variables control this function: @defopt sgml-validate-command The shell command to validate an SGML document. This is a @code{format} control string that by default should contain two @code{%s} conversion specifications: the first will be replaced by the value of @code{sgml-declaration} (or the empty string, if nil); the second will be replaced by the current buffer's file name (or the empty string, if nil). If @code{sgml-validate-files} is non-nil, the format string should contain one @code{%s} conversion specification for each element of its result. If sgml-validate-command is a list, then every element should be a string. The strings will be tried in order and @samp{%}-sequences in the string will be replaced according to the list below, if the string contains @samp{%}-sequences with no replacement value the next string will be tried. @table @code @item %b means the visited file of the current buffer @item %s means the SGML declaration specified in the sgml-declaration variable @item %d means the file containing the DOCTYPE declaration, if not in the buffer @end table The default value is @code{nsgmls -s %s %s}. @end defopt @defopt sgml-validate-files If non-nil, a function of no arguments that returns a list of file names. These file names will serve as the arguments to the @code{sgml-validate-command} format control string instead of the defaults. @end defopt @defopt sgml-declaration The name of the SGML declaration file. @end defopt @defopt sgml-offer-save If non-nil, @kbd{C-c C-v} (@code{sgml-validate}) will ask about saving modified buffers before running the validate command. The default value is @code{t}. @end defopt @kindex C-c C-o @findex sgml-next-trouble-spot The built-in parser can find some markup errors. The command @kbd{C-c C-o} (@code{sgml-next-trouble-spot}) is the best way to use the built-in parser for this. To check the whole file go to the beginning of the buffer and use @kbd{C-c C-o}. Some of the markup errors not found are: @itemize @bullet @item Errors in the SGML declaration. @item Errors in attribute specifications. @item Omitted start-tags for empty elements. @end itemize @c -------------------------------------------------------------------------- @node SGML declaration, Managing the DTD, Validate, Top @comment node-name, next, previous, up @chapter SGML Declaration @cindex SHORTTAG @cindex OMITTAG @cindex NAMECASE GENERAL @cindex case sensitivity PSGML does not understand the SGML declaration, it accepts one in the file but it is ignored. If you have the SGML declaration in another file you can make @file{sgmls} use it when you use the @kbd{C-c C-v} (@code{sgml-validate}) command (@pxref{Validate}). PSGML has some options in what features it uses and what markup it creates. You have to set these options to make PSGML's behavior consistent with your SGML declaration and personal preferences. @defopt sgml-omittag Set this to @code{t} if the SGML declaration has @samp{OMITTAG YES} and to @code{nil} otherwise. @end defopt @defopt sgml-shorttag Set this to @code{t} if the SGML declaration has @samp{SHORTTAG YES} and to @code{nil} otherwise. @end defopt @defopt sgml-namecase-general Set this to @code{t} if the SGML declaration has @samp{NAMECASE GENERAL YES} and to @code{nil} otherwise. I.e., this controls whether names, except entity names, will be case insensitive (translated to upper case). @end defopt @defopt sgml-always-quote-attributes If non-nil, quote all attribute values inserted after finishing edit attributes. If this variable is @code{nil} and @code{sgml-shorttag} is non-@code{nil}, attribute values that consists of only name characters will not be quoted. @end defopt @defopt sgml-minimize-attributes Determines minimization of attributes inserted by edit-attributes. If non-nil, omit attribute name if the attribute value is from a token group. If @code{max}, omit attributes with default value. Minimization will only be done if they produce legal SGML (assuming @code{sgml-omittag} and @code{sgml-shorttag} are set correctly). @end defopt @c -------------------------------------------------------------------------- @node Managing the DTD, Edit, SGML declaration, Top @comment node-name, next, previous, up @chapter Document Type Declaration @cindex DOCTYPE @cindex DTD @vindex sgml-default-doctype-name PSGML needs to know about the DTD you are using for many of its commands. If you do not have a @samp{DOCTYPE} declaration in your file, PSGML will try assume that there is one of the form @example @end example where @var{name} is the value of @code{sgml-default-doctype-name}, if the value is non-@code{nil}, else the GI of the first tag will be used. @findex sgml-parse-prolog @vindex sgml-auto-activate-dtd PSGML will try to parse the document type declaration the first time you do something that needs to parse the document or immediately if the variable @code{sgml-auto-activate-dtd} is @code{t}. You can also initiate the parsing of the document type declaration with the command @code{sgml-parse-prolog}. Big DTDs take some time to parse. When the DTD has been parsed or loaded the name of the document element will be displayed in the mode line inside brackets. If there was an error parsing the DTD or there is no DTD, the mode line will display @samp{[ANY]} (*** this is not really correct! a DTD will be established even if there are missing entities, it may even be empty). @menu * Precompiled DTD Subsets:: * Using a Split Document:: * Inserting a DOCTYPE:: * Information from the DTD:: * Customizing DTD:: @end menu @c ------------------------------------------------------------ @node Precompiled DTD Subsets, Using a Split Document, Managing the DTD, Managing the DTD @comment node-name, next, previous, up @section Precompiled DTD Subsets If parsing the DTD takes too long time you can arrange to have PSGML cache an internal complied version of the DTD. Caching can be done of DTD fragments in favourable situations. It is possible to have an external DTD subset cached but still have an internal DTD subset as long as the internal subset does not define parameter entities that affect the parsing of the external subset (*** what is the exact conditions?, probably you can't use the cached external subset if the internal subset defines parameter entities that are also defined in the external subset with another value). @vindex sgml-ecat-files @vindex sgml-local-ecat-files To enable caching you have to create special catalog files, hereafter called ECAT files due to (temporary) lack of imagination. These catalogs have similar syntax to the entity catalogs and there are two variables containing lists of catalogs to search: @code{sgml-ecat-files} and @code{sgml-local-ecat-files}. The ECAT files can contain the following types of entries: @table @samp @item file @var{dtdfile} @var{entitydef} @var{cfile} The @var{dtdfile} is the name of a file containing a DTD subset that should be cached in @var{cfile}. The @var{entitydef} is optional and if given have the following syntax: @example [ @var{name1} @var{literal1} @var{name2} @var{literal2} @dots{} ] @end example Using @var{entitydef} will modify the DTD subset by defining the parameter entity with name @var{name1} to be @var{literal1}, @dots{}. The cached version of the subset will be created with those entity definitions, and when PSGML search for a matching cached subset will check that the parameter entities in @var{entitydef} has been defined with those values before trying to use @file{cfile}. @item public @var{pubid} @var{entitydef} @var{cfile} Cache the DTD subset with public identifier @var{pubid} in file @var{cfile}. @end table @defopt sgml-recompile-out-of-date-cdtd If non-@code{nil}, out of date compiled DTDs will be automatically recompiled. If the value is @code{ask}, PSGML will ask before recompiling. A @code{nil} value will cause PSGML to silently load an out of date compiled DTD. A DTD that refers to undefined external entities is always out of date, thus in such case it can be useful to set this variable to @code{nil}. @end defopt Previous versions of PSGML have had another way of speeding up DTD parsing. This code remains in this version of PSGML, but is not actively maintained and may disappear in the future. @findex sgml-save-dtd @findex sgml-load-dtd @vindex sgml-default-dtd-file You can save the parsed DTD in a file using the command @kbd{M-x sgml-save-dtd}. Next time PSGML can load that file instead of parsing the DTD. For PSGML to find the saved DTD you must either save the DTD using the default name or do a @kbd{M-x sgml-save-options} after saving the DTD. To directly use an already parsed and saved DTD, load the file containing the saved DTD with the command @kbd{M-x sgml-load-dtd}. @defopt sgml-default-dtd-file This is the default file name for saved DTD. This is set by @code{sgml-mode} to the buffer file name less extension plus the extension @code{.ced}, if that file exists. Can be changed in the Local variables section of the file. @end defopt @c true with system-path @c either or by creating a saved DTD and setting @c @code{sgml-default-dtd-file} to that file. If @c @code{sgml-default-dtd-file} contains a relative file name, the @c directories in @code{sgml-system-path} will be searched for the file. @c ------------------------------------------------------------ @node Using a Split Document, Inserting a DOCTYPE, Precompiled DTD Subsets, Managing the DTD @comment node-name, next, previous, up @section Using a Split Document @c *** why not defopt?? @vindex sgml-doctype You can have the @samp{DOCTYPE} declaration in another file by setting @code{sgml-doctype} to the other file. @defopt sgml-parent-document Used when the current file is part of a bigger document. The variable describes how the current file's content fit into the element hierarchy. The variable should have the form @lisp (@var{parent-file} @var{context-element}* @var{top-element} (@var{has-seen-element}*)?) @end lisp @table @var @item parent-file is a string, the name of the file containing the document entity. @item context-element is a string, that is the name of an element type. It can occur 0 or more times and is used to set up exceptions and short reference map. Good candidates for these elements are the elements open when the entity pointing to the current file is used. @item top-element is a string that is the name of the element type of the top level element in the current file. The file should contain one instance of this element, unless the last (lisp) element of sgml-parent-document is a list. If it is a list, the top level of the file should follow the content model of top-element. @item has-seen-element is a string that is the name of an element type. This element is satisfied in the content model of top-element. @end table @end defopt @c ------------------------------------------------------------ @node Inserting a DOCTYPE, Information from the DTD, Using a Split Document, Managing the DTD @comment node-name, next, previous, up @section Inserting a DOCTYPE @kindex C-c C-u C-d @findex sgml-custom-dtd *** Describe the DTD menu in general. Describe customized entries for special DTDs. Mention @kbd{C-c C-u C-d} for inserting a DOCTYPE from keyboard. If you change the doctype you must execute @code{sgml-parse-prolog}, changes in the doctype are not automatically recognized. @defopt sgml-custom-dtd Menu entries to be added to the DTD menu. The value should be a list of entries to be added to the DTD menu. Every entry should be a list. The first element of the entry is a string used as the menu entry. The second element is a string containing a doctype declaration (this can be nil if no doctype). The rest of the list should be a list of variables and values. For backward compatibility a single string instead of a variable is assigned to @code{sgml-default-dtd-file}. All variables are made buffer local and are also added to the buffers local variables list. When an entry is selected from the DTD menu, the doctype declaration will be inserted, the variables will be set to the values in the entry and a local variables list will be created in the buffer. Example: @example (("HTML" nil sgml-default-dtd-file "~/sgml/html.ced" sgml-omittag nil sgml-shorttag nil) ("HTML+" "" "~/sgml/htmlplus.ced" sgml-omittag t sgml-shorttag nil) ("DOCBOOK" "" "~/sgml/docbook.ced" sgml-omittag nil sgml-shorttag t))) @end example @end defopt @c ------------------------------------------------------------ @node Information from the DTD, Customizing DTD, Inserting a DOCTYPE, Managing the DTD @comment node-name, next, previous, up @section Information from the DTD @cindex DTD @cindex Element PSGML can list various information about the current DTD. The following commands can be used via @kbd{M-x} and can also be found in the DTD menu. @table @code @findex sgml-describe-dtd @item sgml-describe-dtd Display information about the current DTD. @findex sgml-describe-element-type @item sgml-describe-element-type Describe the properties of an element type as declared in the current DTD. @cindex entity @findex sgml-describe-entity @item sgml-describe-entity Describe the properties of an entity as declared in the current DTD. @findex sgml-list-elements @item sgml-list-elements Will list all elements and the attributes declared for the element. @findex sgml-list-attributes @item sgml-list-attributes Will list all attributes declared and the elements that use them. @findex sgml-list-terminals @item sgml-list-terminals Will list all elements that can contain data. @findex sgml-list-occur-in-elements @item sgml-list-occur-in-elements Will list all element types and where it can occur. @findex sgml-list-content-elements @item sgml-list-content-elements Will list all element types and the element types that can occur in its content. @end table @c --------------------------------------------------------------------------- @node Customizing DTD, , Information from the DTD, Managing the DTD @comment node-name, next, previous, up @section Customizing DTD PSGML can be customized by process instructions starting with ``PSGML'' in the DTD. Generally this associates some information with element types. E.g., if @code{sgml-fill-element} should skip the element type or if the content should be displayed with a special font. The general syntax is @display @samp{} @end display Note: in XML the ending delimiter is @samp{?>}, in SGML mode a trailing @samp{?} will be ignored if preceded by a space. Where @var{gi} is the element type, @var{prop} is a propery described below, and @var{value} is the value for the property. The first part from @samp{PSGML} to @var{gi} is read with current setting for @samp{NAMECASE GENERAL}, i.e., case insensitive for normal SGML but case sensitive in XML mode. The @var{prop} and @var{value} is read using Emacs Lisp conventions, i.e. case sensitive and @var{value} is a lisp expression (not evaluated). Example @example @end example Properties @table @code @item nofill Set to either @code{t} or @code{nil}. If @code{t} the elements of this type will be ignored when filling with @code{sgml-fill-element}. Note that Emacs normal filling functions will not honor this. @item font Set to the name of an Emacs face. Should be a face that exists in Emacs. E.g. @code{bold}, @code{italic}, @code{fixed-pitch}. The content of elements of this type will be displayed in that face. @item attnames Set to a list of attribute names. E.g., @code{attnames=("ID" "CLASS" "ONCLICK")}. This controls the attributes included when using the @code{sgml-edit-attributes} (@kbd{C-c C-a}) command. Only the attributes in the list will be included and in that order. You can also end the list with a @code{*} to include all attributes, but the listed attributes will be on the top. E.g., @code{attnames=("ID" "CLASS" "ONCLICK" *)}. Note: that the attribute names need to be written with the correct case and in string quotes. @item structure Control if element is included in @code{sgml-show-structure} (@kbd{C-c C-s}). If set to @code{t}, the element is included and if set to @code{ignore} it will not be included. @xref{Information, Showing information}. @item help-text Should be a string. The string will be displayed by @code{sgml-show-current-element-type} (@kbd{C-c C-t}). @end table @c --------------------------------------------------------------------------- @node Edit, Display, Managing the DTD, Top @comment node-name, next, previous, up @chapter Commands for editing @menu * Insert:: Inserting Markup * Complete:: Markup completion * Information:: Showing information * Indent:: Indentation according to structure * Move:: Move in the element structure * Attributes:: Editing attributes * Change and delete:: Changing and deleting markup * Translating characters and entities:: @end menu @c ------------------------------------------------------------------ @node Insert, Complete, Edit, Edit @comment node-name, next, previous, up @section Inserting Markup @c erik says "inserts" ?? The commands that insert start-tags works only if the document has an associated DTD. Keyboard commands for inserting: @table @kbd @kindex C-c < @findex sgml-insert-tag @item C-c < Will ask, for the tag to insert, in the mini-buffer with completion on the tags that are valid at point (@code{sgml-insert-tag}). If @code{sgml-auto-insert-required-elements} is non-nil, tags for elements required between the inserted tags will also be inserted. The list of valid tags, computed for a position in the buffer, will contain: @enumerate @item The end-tag for the current element, if it can be ended at the position. Furthermore it will contain end-tags for enclosing elements if the necessary omissible end-tag declarations have been made in the DTD. @item The start-tags of all elements that could occur after point. If @code{sgml-omittag-transparent} is nil, the above will be limited to the elements that can occur within the current element. @end enumerate @kindex C-c C-e @findex sgml-insert-element @vindex sgml-insert-end-tag-on-new-line @item C-c C-e Insert start and end-tags for an element (@code{sgml-insert-element}). The name of the element is read from the mini-buffer with completion on valid elements. If @code{sgml-insert-end-tag-on-new-line} is non-nil or the element has element content, the end-tag will be inserted on a new line after the start-tag. @vindex sgml-omittag-transparent If @code{sgml-omittag-transparent} is nil, the list of valid elements will only contain the elements that can be in the content of the current element. @vindex sgml-auto-insert-required-elements @vindex sgml-insert-missing-element-comment Required elements in the content will be automatically inserted if the option @code{sgml-auto-insert-required-elements} is non-nil. When the content model demands an element but there is more than one to choose from, a comment can be inserted with the available choices if the option @code{sgml-insert-missing-element-comment} is non-nil. @kindex C-c C-i @findex sgml-add-element-to-element @item C-c C-i Inserts a new element in the current element where it is legal. Prompts for element name with completion. The completion list contains all elements that could be added to the current element somewhere, without making the content invalid. This assumes that the content is valid to begin with. Currently this list only has regular elements, not inclusions. The new element will be inserted as late as possible in the current element (unless prefix argument is given, then as early as possible.) @kindex C-c C-r @findex sgml-tag-region @item C-c C-r Makes the region into a new element (@code{sgml-tag-region}). Reads element name from mini-buffer with completion as for @kbd{C-c C-e}. @kindex C-c / @findex sgml-insert-end-tag @item C-c / Inserts an end-tag for the current element (@code{sgml-insert-end-tag}). @c note that this keybinding doesn't follow the conventions for @c major-modes. Perhaps warn that this binding may change in the next @c major release? @kindex C-c RET @findex sgml-split-element @item C-c RET Split the current element at point. If repeated, the containing element will be split before the beginning of then current element. Typical use is to start a new paragraph element when inside a paragraph. @kindex C-c + @findex sgml-insert-attribute @item C-c + Read attribute name and value from mini-buffer and insert attribute specification (@code{sgml-insert-attribute}). If point is immediately after a start-tag, this command operates on that start-tag. Otherwise the command will operate on the element after point. The attribute name will be read with completion. If the attribute has a token list as declared value the attribute value will also be read with completion. The prompt for attribute value will typically look like: @example Value for @var{attribute} (@var{type} Default: @var{current value}): @end example @c note that this keybinding doesn't follow the conventions for @c major-modes. Perhaps warn that this binding may change in the next @c major release? @kindex C-c C-u C-m @findex sgml-custom-markup @item C-c C-u C-m Give keyboard access to the customized part of the Markup menu. Emacs will prompt for the markup to insert using the menu line as selector. (See @var{sgml-custom-markup} below.) @end table Menu bar: @table @samp @item Markup Selecting from this menu will insert markup. The menu contains sub menus with tags and with entities, some other markup and a user defined section. Sub menus: @item Insert element Pops up a menu of valid elements and insert start and end-tags for the selected element. Selections from the menu works like the @kbd{C-c C-e} command. @item Insert start-tag Pops up a menu of valid start-tags and insert the selected tag. The menu has the same start-tags as the completion list for @kbd{C-c <}. @item Insert end-tag Pops up a menu of valid end-tags and insert the selected tag. @item Tag region Pops up a menu of valid elements and tag the region with the selection. Selections from the menu works like the @kbd{C-c C-r} command. @item Insert entity Menu of all general entities defined in the DTD. @item Add Element to Element Pops up a menu of all elements valid somewhere in the current element. The menu contains all elements that could be added to the current element somewhere, without making the content invalid. The new element will be inserted as late as possible in the current element. @item Insert attribute Pops up a menu with all the attributes of an element. The element is either the one which start-tag is immediately before point or the element after point. Selecting from this menu edits the attribute specification list for the element. The menu has a sub menu for every attribute which declared value is a token list. The rest of the attributes are collected in one sub menu. For the token list attributes, selecting a value will insert that attribute-value pair. Selecting some other attribute reads the attribute-value from the mini-buffer and inserts the attribute value pair. @end table @kindex S-@key{mouse-3} A menu is also available directly with a mouse button click in the buffer. In GNU Emacs it is the first mouse button combined with shift (@kbd{S-@key{mouse-3}}). In Lucid Emacs it is bound to the third mouse button. The mouse button click will pop-up a menu of valid tags or a menu of attributes if the point is in a start-tag. The attributes menu works as the ``Insert attribute'' menu from the menu-bar. The tags list is the list of valid tags described above for command @kbd{C-c <}. Selection from the tags menu works like the @kbd{C-c <} command, with the following exception: You can tag a region, with start and end-tag. There are two ways to indicate the region to mark: @enumerate @item Use the normal mouse commands to mark region. For this to work you must either use @dfn{transient mark mode} (@pxref{Transient Mark, , Transient Mark Mode, emacs, The Emacs Editor}) or set the option @code{sgml-tag-region-if-active} to non-nil (don't set this unless you are sure that you want it). @item Alternatively make a secondary selection, this is done by holding down the meta key and using the mouse buttons. @xref{Secondary selection, , , emacs, The Emacs Editor}. Some window managers intercept these events, which makes it hard use the secondary selection in Emacs. @end enumerate @defopt sgml-balanced-tag-edit If non-nil, inserting a start-tag using the context menu will also insert the corresponding end-tag. @end defopt @defopt sgml-auto-insert-required-elements If non-nil, automatically inserts required elements in the content of an inserted element. @end defopt @defopt sgml-omittag-transparent If non-nil, will show legal tags inside elements with omissible start-tags and legal tags beyond omissible end-tags. @end defopt @defopt sgml-tag-region-if-active If non-nil, the @samp{Insert tags} menu will tag a region if the region is considered active by emacs. If nil, region must be active and @code{transient-mark-mode} must be on for the region to be tagged. @end defopt @defopt sgml-custom-markup Menu entries to be added to the Markup menu. The value should be a list of lists of two strings. The first string is the menu line and the second string is the text inserted when the menu item is selected. The second string can contain a @samp{\r} where the cursor should be left. Also, if a selection is made according to the same rules as for the @kbd{S-mouse-1} menu, the selection is replaced with the second string and @samp{\r} is replaced with the selection. Example: @example (("Version1" "") ("New page" "")) @end example @end defopt @defopt sgml-insert-missing-element-comment If non-nil, and sgml-auto-insert-required-elements also true, @code{sgml-insert-element} will insert a comment if there is an element required but there is more than one to choose from. @end defopt @defopt sgml-insert-end-tag-on-new-line If non-nil, @code{sgml-insert-element} will put the end-tag on a new line after the start-tag. Useful on slow terminals if you find the end-tag after the cursor irritating. @end defopt @c ------------------------------------------------------------------------- @node Complete, Information, Insert, Edit @comment node-name, next, previous, up @section Markup completion @kindex M-TAB @findex sgml-complete If you are typing in markup directly, @kbd{M-TAB} will help you by completing a tag name, an entity name or a markup declaration name. If you type @kbd{M-TAB} after a plain word, @code{ispell-complete-word} will be invoked instead. If you have typed (@point{} marks the position of point) @example &At@point{} @end example @noindent and type @kbd{M-TAB} (assuming you use the @file{ISOLat1} entity set) you get: @example Ã@point{} @end example @c --------------------------------------------------------------------------- @node Information, Indent, Complete, Edit @comment node-name, next, previous, up @section Showing information Commands for showing information obtained by parsing the buffer. @table @kbd @kindex C-c C-c @findex sgml-show-context @item C-c C-c Shows in the message area: context at point, if in a tag or in mixed content and the open elements (@code{sgml-show-context}). The form of the string is controled by the user option @code{sgml-show-context-function}. @kindex C-c C-w @findex sgml-what-element @item C-c C-w Shows what element the character after point (under the cursor) belongs to; also shows context of element (@code{sgml-what-element}). @kindex C-c C-t @findex sgml-show-current-element-type @item C-c C-t Show information about the current element type and the valid element following the point. @kindex C-c C-s @findex sgml-show-structure @item C-c C-s Show the major element structure in a separate buffer (@samp{*Document structure*}). That buffer can be used to navigate the document, like an Occur buffer (@pxref{Other Repeating Search, , Other Search-and-Loop Commands, emacs, The Emacs Editor}). The structure shows container elements and the text of the first child element (if it is not a container). This works best for document types which uses containers and title structure (e.g. @samp{
Heder ..
}). PSGML uses a heuristic rule to identify container elements: it should have element content and be non empty. You can configure exceptions from this rule using a process instruction in the DTD (@pxref{Customizing DTD}). To include an element type @var{el1} that would otherwise be excluded: @example @end example To exclude an element type @var{el2} that would otherwise be included: @example @end example @end table @findex sgml-list-valid-tags List contextually valid tags (@code{sgml-list-valid-tags}). Displays information about current element, all valid end-tags, valid start-tags in current element, and start-tags valid at this point but in other elements together with the tags omitted. @ignore *** This is no longer working You can make the mode-line display the name of the current open element by setting the @code{sgml-live-element-indicator} variable. Setting this will make all commands slower due to the work needed to keep the mode-line up to date. @defopt sgml-live-element-indicator If non-nil, indicate current element in mode line. NOTE: Setting this implies that every command can cause a parse. @end defopt @end ignore @defopt sgml-show-context-function The value shold be a function that generates a string from an element and the current markup type (if any). There are two ready made functions for this. The function @code{sgml-show-context-standard}, the default, generates a string like @samp{#PCDATA in para in chapter in book}. The function @code{sgml-show-context-backslash} generates a string like @samp{book\chapter\para}. @end defopt @c -------------------------------------------------------------------------- @node Indent, Move, Information, Edit @comment node-name, next, previous, up @section Indentation according to structure @kindex @key{TAB} @kindex @key{LFD} @findex sgml-indent-or-tab @findex newline-and-indent You can indent a line according to the depth of element nesting at the beginning of the line. To indent the current line use @kbd{@key{TAB}}. You can also use @kbd{@key{LFD}} (@code{newline-and-indent}) to start a new line with correct indentation. @defopt sgml-indent-step How much to increment indent for every element level. If nil, no indentation. If this is nil, @kbd{@key{TAB}} will insert a tab instead of indenting. @end defopt @defopt sgml-indent-data If non-nil, indent in data/mixed context also. @end defopt @c --------------------------------------------------------------------------- @node Move, Attributes, Indent, Edit @comment node-name, next, previous, up @section Move in the element structure These commands move in the element structure. The commands uses knowledge of SGML syntax, and if available the specific DTD. @table @kbd @kindex C-M-a @findex sgml-beginning-of-element @item C-M-a Move to the (content) beginning of the current element (@code{sgml-beginning-of-element}). @kindex C-M-e @findex sgml-end-of-element @item C-M-e Move to the (content) end of the current element (@code{sgml-end-of-element}). @kindex C-M-f @findex sgml-forward-element @item C-M-f Move forward by element (@code{sgml-forward-element}). @kindex C-M-b @findex sgml-backward-element @item C-M-b Move backward by element (@code{sgml-backward-element}). @kindex C-M-u @findex sgml-backward-up-element @item C-M-u Move up to before current element (@code{sgml-backward-up-element}). @kindex C-c C-n @findex sgml-up-element @item C-c C-n Move up to after current element (@code{sgml-up-element}). @kindex C-M-d @findex sgml-down-element @item C-M-d Move down to the (content) beginning of the next element (@code{sgml-down-element}). @kindex C-c C-d @findex sgml-next-data-field @item C-c C-d Move to the next place where data is allowed (@code{sgml-next-data-field}). @end table You can also move to the next place where there is some structural error with @kbd{C-c C-o} (@pxref{Validate}). @c --------------------------------------------------------------------------- @node Attributes, Change and delete, Move, Edit @comment node-name, next, previous, up @section Editing attributes @findex sgml-edit-attributes @kindex C-c C-a If you want to change the attributes of a start-tag you can simply edit them directly in the buffer. Or you can place the cursor at or after the start-tag and use the @code{sgml-edit-attributes} command, available from the @samp{SGML}-menu or on @kbd{C-c C-a}. This will create a new Emacs window with all possible attributes listed in the form @example @var{attribute name} = @var{current value}. @end example The @var{current value} may be shown as @samp{#DEFAULT} if the attribute has not been given a value in the start-tag. The list also contains the attributes declaration as a comment. Note also that the @var{current value} is show without eventual quotes. @kindex C-c C-d @kindex @key{TAB} It is now possible to edit the attribute values. You can move to the next attribute with @kbd{@key{TAB}}. If you want to let an attribute have its default value use @kbd{C-c C-d}, this will insert a @samp{#DEFAULT} in the value field. If Emacs is running in an X window, the @samp{#DEFAULT} will be underlined to distinguish it from normal values. @kindex C-c C-c Finish the editing with @kbd{C-c C-c}; this will replace the attribute values in the main buffer with those edited. Note that values will be quoted as needed. If you want to abort the editing, you can remove the window with @kbd{C-x 0} or if you want it neat, kill the buffer and remove the window. Some other keys are: @table @kbd @kindex C-a @findex sgml-edit-attrib-field-start @item C-a Go to the beginning of the value field (@code{sgml-edit-attrib-field-start}). @kindex C-e @findex sgml-edit-attrib-field-end @item C-e Go to the end of the value field (@code{sgml-edit-attrib-field-end}). @kindex C-c C-k @findex sgml-edit-attrib-clear @item C-c C-k Clear the value field (@code{sgml-edit-attrib-clear}). @kindex C-c C-d @findex sgml-edit-attrib-default @item C-c C-d Set the value field to @samp{#DEFAULT} (@code{sgml-edit-attrib-default}). This is a special value that will make the attribute be implied. @end table @c -------------------------------------------------------------------------- @node Change and delete, Translating characters and entities, Attributes, Edit @comment node-name, next, previous, up @section Changing and deleting markup @table @kbd @kindex C-c = @findex sgml-change-element-name @item C-c = Change the name of the current element (@code{sgml-change-element-name}). Tries to translate attribute specifications. An attribute will be translated to an attribute with the same name. If the new element has no attribute with the same name, the attribute will be ignored. If there is an attribute with the same name but different declared content, a warning is given. ID attributes are handled specially, an attribute with declared value ID will always be translated to the attribute with declared value ID. @kindex C-c C-k @findex sgml-kill-markup @item C-c C-k Kill next tag, markup declaration or process instruction (@code{sgml-kill-markup}). @kindex C-M-k @findex sgml-kill-element @item C-M-k Kill the element following the cursor (@code{sgml-kill-element}). @kindex C-c - @findex sgml-untag-element @item C-c - Remove tags from current element (@code{sgml-untag-element}). @kindex C-c # @findex sgml-make-character-reference @item C-c # Convert character after point to a character reference (@code{sgml-make-character-reference}). If called with a numeric argument, convert a character reference back to a normal character. @kindex C-c C-q @findex sgml-fill-element @item C-c C-q Fills an element as a paragraph (@code{sgml-fill-element}). This is a substitute for the normal @code{fill-paragraph}. The command uses heuristics to decide what should be a paragraph. @enumerate @item If point is in an element content, recursively fill the sub-elements. @item Find the biggest element with mixed content containing point. @item If the above element is mixed but contains elements with pure element content then fill what is between the pure elements as paragraphs and fill the pure elements recursively. @end enumerate @findex sgml-expand-all-shortrefs @item M-x sgml-expand-all-shortrefs Short references to text entities are expanded to the replacement text of the entity other short references are expanded into general entity references. If argument, @var{to-entity}, is non-@code{nil}, or if called interactive with numeric prefix argument, all short references are replaced by generally entity references. @findex sgml-normalize @item M-x sgml-normalize Normalize the document in the buffer. This will @enumerate @item expand short references, @item insert missing tags, @item replace minimized tags with full tags, @item fix attribute specification lists according to options set. @end enumerate There is one argument, @var{to-entity}, with the same meaning as for @code{sgml-expand-all-shortrefs}. There is one option for the normalize command. With its default value, normalize may actually change the data content of some elements. But only by removing some white-space from the end of elements with omitted end-tags. @end table @defopt sgml-normalize-trims If non-nil, @code{sgml-normalize} will trim off white space from end of element when adding end-tag. Default: @code{t}. @end defopt @c -------------------------------------------------------------------------- @node Translating characters and entities, , Change and delete, Edit @comment node-name, next, previous, up @section Translating between characters and entity references @c *** Need work.. Set the variable @code{sgml-display-char-list-filename} to a file that contains mappings between all characters present in the presentation character set, and their "standard replacement text" names, e.g. "å" -> "[aring ]", e.t.c. The default value for this variable is `iso88591.map'. Then use the functions (also in the Modify menu) @table @code @findex sgml-charent-to-display-char @item sgml-charent-to-display-char @findex sgml-display-char-to-charent @item sgml-display-char-to-charent @end table to translate between entities and characters. @c --------------------------------------------------------------------------- @node Display, Miscellaneous options, Edit, Top @comment node-name, next, previous, up @chapter Appearance of text in the buffer @menu * Fold:: Folding editing * Hiding markup:: * Highlight:: Highlighting markup @end menu @c --------------------------------------------------------------------------- @node Fold, Hiding markup, Display, Display @comment node-name, next, previous, up @section Folding editing With these commands you can make parts of the text temporarily invisible to make it easier to see the overall structure of your text. When folding a region all the lines but the first will be invisible. The first line of the region will still be visible with an ellipsis at the end. @xref{Outline Mode, , , emacs, The Emacs Editor}. @table @kbd @kindex C-c C-f C-r @findex sgml-fold-region @item C-c C-f C-r The region between point and mark will be folded (@code{sgml-fold-region}). @kindex C-c C-f C-e @findex sgml-fold-element @item C-c C-f C-e The region between the start and end of the current element will be folded (@code{sgml-fold-element}). This command can also fold the SGML declaration or the DOCTYPE declaration. @kindex C-c C-f C-s @findex sgml-fold-subelement @item C-c C-f C-s Fold all the sub elements of the current element (@code{sgml-fold-subelement}). @kindex C-c C-s @kindex C-c C-u C-l @findex sgml-unfold-line @item C-c C-s @itemx C-c C-u C-l Unfold the current line, assuming it is the first line of a folded region (@code{sgml-unfold-line}). @kindex C-c C-u C-e @findex sgml-unfold-element @item C-c C-u C-e Make all lines in current element visible (@code{sgml-unfold-element}). @kindex C-c C-u C-a @findex sgml-unfold-all @item C-c C-u C-a Make all lines in current buffer visible (@code{sgml-unfold-all}). @kindex C-c C-f C-x @findex sgml-expand-element @item C-c C-f C-x Unfold current element and then fold the subelements (@code{sgml-expand-element}). If the current element is folded this expands what is visible. @end table @c --------------------------------------------------------------------------- @node Hiding markup, Highlight, Fold, Display @comment node-name, next, previous, up @section Hiding markup *** Describe hide-tags @c --------------------------------------------------------------------------- @node Highlight, , Hiding markup, Display @comment node-name, next, previous, up @section Highlighting markup PSGML can highlight the markup giving the markup a different @dfn{face} (@pxref{Faces, , Using Multiple Typefaces, emacs, The Emacs Editor}). The highlighting will only be done if the variable @code{sgml-set-face} is non-@code{nil}. The default settings make tags bold and comments italic, but this can be modified with the variable @code{sgml-markup-faces}. When highlighting is on PSGML will parse after every command until the whole buffer has been parsed or user event occurs. @findex sgml-clear-faces To remove the highlighting type @kbd{M-x sgml-clear-faces}. @defopt sgml-set-face If non-nil, psgml will set the face of parsed markup. @end defopt @defopt sgml-markup-faces A list of markup to face mappings. Each element looks like @code{(@var{markup-type} . @var{face})}. Possible values for @var{markup-type} is: @table @code @item comment comment declaration @item doctype doctype declaration @item end-tag end-tag @item ignored ignored marked section @item ms-start marked section end, if not ignored @item ms-end marked section start, if not ignored @item pi processing instruction @item sgml SGML declaration @item start-tag start-tag @item entity entity reference @item shortref short reference @end table @end defopt @c ------------------------------------------------------------------ @node Miscellaneous options, Bugs, Display, Top @comment node-name, next, previous, up @chapter Miscellaneous options *** describe sgml-save-options @defopt sgml-ignore-undefined-elements Start-tags for undefined elements will either be ignored, if @code{sgml-ignore-undefined-elements} is @code{t}, or assumed to be acceptable in the current element and defined with @code{O O ANY} @end defopt @defopt sgml-range-indicator-max-length Maximum number of characters used from the first and last entry of a sub-menu to indicate the range of that menu. @vindex sgml-max-menu-size This is used for long menus of elements, tags or entities that are split into @code{sgml-max-menu-size} big sub-menus. @end defopt @c ------------------------------------------------------------------ @node Bugs, Index, Miscellaneous options, Top @comment node-name, next, previous, up @chapter Bugs If you encounter something that you think is a bug, please report it. Try to include a clear description of the undesired behaviour. A test case that exhibits the bug, would also be useful. You can report a bug with the command @kbd{M-x sgml-submit-bug-report}. When PSGML needs contextual information it parses the document up to the point. During the parsing, it builds a parse tree. The parse tree is used to initialize the next parse, to avoid having to parse things already parsed. Changes to the buffer is supposed to prune the tree of all outdated information. But if you get strange complaints from the parser, try and back up a bit and use @kbd{C-c C-o} (@code{sgml-next-trouble-spot}). @c ------------------------------------------------------------------ @node Index, , Bugs, Top @comment node-name, next, previous, up @chapter Index @printindex cp @contents @bye