• Bug#1007576: psgml: please consider upgrading to 3.0 source format (2/6

    From Bastian Germann@21:1/5 to All on Sat Mar 23 16:00:01 2024
    [continued from previous message]

    Make a completion table from the ENTITY-TABLE.

    - -- Function: sgml-map-entities fn entity-table &optional collect
    + - 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.
    + 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

    -2 Hooks
    -*******
    +Hooks
    +*****

    - -- Variable: sgml-open-element-hook
    - The hook run by 'sgml-open-element'. Theses functions are called
    + - 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-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
    + - 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
    + - 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
    @@ -450,34 +448,34 @@
    the system identifier is not handled the function should return
    nil.

    - -- Variable: sgml-doctype-parsed-hook
    + - 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.
    + - 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 +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

    -3 Implementation notes
    -**********************
    +Implementation notes
    +********************

    -3.1 Data Types and Operations
    -=============================
    +Data Types and Operations
    +=========================

    -3.1.1 Element Type
    -------------------
    +Element Type
    +------------

    - -- Data type: eltype
    + - 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.
    + `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
    @@ -485,99 +483,99 @@
    model. Other information about the element type is stored on the
    property list.

    - -- Function: sgml-eltype-name et
    + - Function: sgml-eltype-name et
    The name (a string) of the element type ET.

    - -- Function: sgml-eltype-appdata et prop
    + - 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
    + This function can be used as a place in `setf', `push' and other
    functions from the CL library.

    - -- Function: sgml-eltype-all-miscdata eltype
    + - 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
    + - Function: sgml-eltype-set-all-miscdata eltype miscdata
    Append the MISCDATA data properties to the properties of ELTYPE.

    - -- Function: sgml-eltype-attlist et
    + - Function: sgml-eltype-attlist et
    The attribute specification list for the element type ET.

    - -- Function: sgml-eltype-completion-table eltypes
    + - Function: sgml-eltype-completion-table eltypes
    Make a completion table from a list, ELTYPES, of element types.

    - -- Function: sgml-eltype-stag-optional et
    + - Function: sgml-eltype-stag-optional et
    True if the element type ET has optional start-tag.

    - -- Function: sgml-eltype-etag-optional et
    + - Function: sgml-eltype-etag-optional et
    True if the element type ET has optional end-tag.

    - -- Function: sgml-eltype-excludes et
    + - Function: sgml-eltype-excludes et
    The list of excluded element types for element type ET.

    - -- Function: sgml-eltype-includes et
    + - Function: sgml-eltype-includes et
    The list of included element types for element type ET.

    - -- Function: sgml-eltype-flags 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
    + - Function: sgml-eltype-mixed et
    True if element type ET has mixed content.

    - -- Function: sgml-eltype-model et
    + - 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 '<!USEMAP gi
    - #EMPTY>' or 'nil' (if no associated map).
    + - 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 `<!USEMAP gi
    + #EMPTY>' or `nil' (if no associated map).

    - -- Function: sgml-eltype-token et
    + - Function: sgml-eltype-token et
    Return a token for the element type ET.

    - -- Function: sgml-eltypes-in-state state tree
    + - Function: sgml-eltypes-in-state state tree
    List of element types valid in STATE and TREE.

    -3.1.2 DTD
    ----------
    +DTD
    +---

    -The DTD data type is realised as a lisp vector using 'defstruct'.
    + 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
    + - 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
    + - 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.

    -3.1.3 Element and Tree
    -----------------------
    +Element and Tree
    +----------------

    - -- Data Type: 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
    + 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.

    -3.2 Parsing model
    -=================
    +Parsing model
    +=============

    -PSGML uses finite state machines and a stack to parse SGML. Every
    + 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.

    @@ -585,7 +583,7 @@
    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
    +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
    @@ -594,9 +592,9 @@
    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.
    + 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:
    +example `(a & b & c)' is can be translated to:

    ((a, ((c, b) | (b, c))) |
    (b, ((a, c) | (c, a))) |
    @@ -606,68 +604,68 @@
    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.
    +satisfied. Most of this is hidden by the primitives for the state
    +type. The parser only sees states in a DFA and moves.

    -3.3 Entity manager
    -==================
    +Entity manager
    +==============

    - -- Function: sgml-push-to-entity entity &optional ref-start type
    + - 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
    + 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).
    + - 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
    + - 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
    + 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.
    + Use `sgml-pop-entity' to exit from this buffer.

    -3.4 Parser functions
    -====================
    +Parser functions
    +================

    - -- Function: sgml-need-dtd
    + - 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'
    + 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
    + - 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.
    + 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
    + - 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.
    + 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.

    -3.5 Saved DTD Format
    -====================
    +Saved DTD Format
    +================

    File = Comment,
    File version,
    - S-expression -dependencies-,
    + S-expression --dependencies--,
    Parameter entites,
    Document type name,
    Elements,
    General entities,
    - S-expression -shortref maps-,
    - S-expression -notations-
    + S-expression --shortref maps--,
    + S-expression --notations--

    -Elements = Counted Sequence of S-expression -element type name-,
    +Elements = Counted Sequence of S-expression --element type name--,
    Counted Sequence of Element type description

    File version = "(sgml-saved-dtd-version 5)
    @@ -677,24 +675,24 @@
    (CASE
    OF [0-9]
    OF [11-255])*,
    - [10] -end of line marker-)*
    + [10] --end of line marker--)*

    -Element type description = S-expression -Misc info-,
    +Element type description = S-expression --Misc info--,
    CASE
    - OF [0-7] -Flags 1:stag-opt, 2:etag-opt, 4:mixed-,
    + 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-
    + 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-
    + 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

    @@ -702,74 +700,72 @@
    OF Normal State
    OF And Node

    -Normal State = Moves -moves for optional tokens-,
    - Moves -moves for required tokens-
    +Normal State = Moves --moves for optional tokens--,
    + Moves --moves for required tokens--

    Moves = Counted Sequence of (Token,
    - OCTET -state #-)
    + OCTET --state #--)

    -And Node = [255] -signals an AND node-,
    - Number -next state (node number)-,
    - Counted Sequence of Model -set of models-
    +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-
    +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-
    + 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-
    +Parameter entites = S-expression --internal representation of parameter entities--

    -General entities = S-expression -internal representation of general entities- +General entities = S-expression --internal representation of general entities--

    -Document type name = S-expression -name of document type as a string- +Document type name = S-expression --name of document type as a string--

    S-expression = OTHER

    -Counted Sequence = Number_a -length of sequence-,
    +Counted Sequence = Number_a --length of sequence--,
    (ARG_1)^a

    -
    
    File: psgml-api.info, Node: Index, Prev: Implementation, Up: Top

    -4 Index
    -*******
    +Index
    +*****

    -Types
    + Types

    - [index ]
    * Menu:

    -* asl: attribute. (line 99)
    -* attdecl: attribute. (line 26)
    -* attlist: attribute. (line 12)
    -* attspec: attribute. (line 82)
    -* declared-value: attribute. (line 45)
    -* default-value: attribute. (line 64)
    -* dtd: DTD. (line 6)
    -* element: element. (line 6)
    -* eltype: Implementation. (line 12)
    -* entity: entities. (line 6)
    -* entity-table: entities. (line 43)
    -* pstate: parser state. (line 14)
    -* tree: Implementation. (line 103)
    +* 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: Top980
    -Node: Types1562
    -Node: element2282
    -Node: attribute6342
    -Node: parser state10439
    -Node: DTD11035
    -Node: entities11679
    -Node: Hooks13617
    -Node: Implementation15360
    -Node: Index24989
    +Node: Top942
    +Node: Types1526
    +Node: element2245
    +Node: attribute6165
    +Node: parser state10162
    +Node: DTD10750
    +Node: entities11379
    +Node: Hooks13294
    +Node: Implementation15026
    +Node: Index24613
    
    End Tag Table
    diff -Nru psgml-1.4.0/psgml-api.texi psgml-1.4.0/psgml-api.texi
    --- psgml-1.4.0/psgml-api.texi 2024-03-23 14:50:55.000000000 +0000
    +++ psgml-1.4.0/psgml-api.texi 2005-03-05 16:23:40.000000000 +0000
    @@ -7,7 +7,6 @@
    @c $Id: psgml-api.texi,v 1.2 1999/12/03 17:29:39 lenst Exp $

    @ifinfo
    -@dircategory Emacs editing modes
    @format
    START-INFO-DIR-ENTRY
    * PSGML-API: (psgml-api). PSGML, the API documentation.
    diff -Nru psgml-1.4.0/psgml-parse.el psgml-1.4.0/psgml-parse.el
    --- psgml-1.4.0/psgml-parse.el 2024-03-23 14:50:55.000000000 +0000
    +++ psgml-1.4.0/psgml-parse.el 2012-08-27 19:46:46.000000000 +0000
    @@ -359,7 +359,7 @@
    ((and (boundp 'emacs-major-version) (>= emacs-major-version 20))
    (set-buffer-multibyte
    (if (eq flag 'default)
    - (default-value 'enable-multibyte-characters)
    + default-enable-multibyte-characters
    flag)))
    ((boundp 'MULE)
    (set 'mc-flag flag))
    @@ -2532,7 +2532,7 @@
    ;; processing a cdtd.
    ;; FIXME: looks strange, we haven't changed bu