TODO                 -*- outline -*- 

* Cleanup-related todo list
** Use a keymap filter for sgml-update-options-menu?
** Get rid of (redundant) invisible handling in sgml-update-display.
** Make psgml-mode derive from sgml-mode.el?
** Figure out what sgml-attr-clean-and-insert does.
** Fix interaction with font-lock.
** Generate internal autoloads (at end of psgml.el) automatically.
** Allow cohabitation with sgml-mode.el.
** Rename sgml-xml-p (and maybe other variables ending in "-p").

* Old todo list
** Language fixup

legal -> valid


** parse prolog and parent document

Perhaps sgml-parse-prolog() should test whether
sgml-parent-document is non-nil, and if so, it should parse the
prolog of the parent document instead.  With the current
behaviour, it is that obvious commands that use the parsed DTD
(like inserting new elements) will not work either when there is
only a dummy DTD available, nor will they update the parse to the
correct DTD.  Just a suggestion.

OR perhaps sgml-load-doctype does what the interactive command should
do. 
[lenst/2005-02-27 15:31:57] I think so, changed C-c C-p to call
sgml-load-doctype


** Rewrite sgml-popup-multi-menu

Should also split the menu if larger than sgml-max-menu-size.
Construct the menu as a keymap.

What about XEmacs?


** Cosider removing sgml-balanced-tag-edit
Only affects sgml-tag-menu.
Perhaps replace with a "context menu type" option.

** Restore window config after edit-attr

** Indent and fill

Should probably not indent in NOFILL elements.

Perhaps indentation in a fillable element should be the same for all
lines. That would speed up fill. Exception for non-fillable elements
inside fillable elements (like list in paragraphs), these sould be
indented independently.

Make indentation algorithm pluggable.

sgml-compute-indent ELEMENT PART  =>  COLUMN

PART in stag, etag, content, attribute ?

Help func: sgml-current-indent-of ELEMENT => COLUMN

(sgml-compute-indent e 'content) ->
        (sgml-current-indent-of e) + sgml-ident-step

(sgml-compute-indent e 'stag) ->
        (sgml-current-indent-of (sgml-element-parent e)) + sgml-ident-step
or is this always =
   (sgml-compute-indent (sgml-element-parent e) 'content)




** sgml-kill-element

if there is no following element, kill up to the end tag of the
current element.

** sgml-do-data - needs a better docstring

** Set-faces has other variables sensible defaults

sgml-auto-activate-dtd

** Fix documentation of sgml-display-char-list-filename

File format is not properly descibed.

** Konstigt beteende när DOCTYPE specar en odefinierad elementtyp,
speciellt om det är nästan samma som topelementet i instansen men
skiljer sig i case.

** Change sgml-throw-on-warning to be a handler

I.e. instead of throwing call a handler hook.
The handler can then do the throw if that is desirable.

** Kanske sgml--add-before-p borde användas allmänt

T.ex. av sgml-insert-element

** Kolla #REQUIRED attribut

i sgml-parse-attribute-specification-list

    ;; Check all required attributes specified
    (let ((unspecified
           (loop for attdecl in attlist
                 if (and (sgml-default-value-type-p
                          'REQUIRED (sgml-attdecl-default-value attdecl))
                         (not (sgml-lookup-attspec (sgml-attdecl-name attdecl)
                                                   asl)))
                 collect attdecl)))
      (when unspecified
        (sgml-log-warning "Missing required attributes: %s"
                          (mapcar (function sgml-attdecl-name) unspecified))))


måste också plocka bort optimering av start-tag utan asl.

Hur mycket är funktionalliteten värd? Vad kostar den? 

** Determining legal elements

If the current element has valid content, then only elements that does
not make the current element invalid is legal.

If current element has invalid content, then ??

If current element has no end tag, and OMITTAG is on. Consider
elements legal after this element if the current position is last in
the element.

Possibly clean up old functions and variables like
sgml-omittag-transparent and sgml-insert-tag.

** Parsing start-tag

Parse the different consituents of the start tag without reference to
the DTD. If the tag is well-formed then check it against the DTD. If
this is XML w/o a DTD, adjust the constructed DTD to allow the element
and attributes.

Consequences for SGML: parse attspec does not always identify
attributes. The check against the DTD will fill in attribute names for
attributes specified with a value only. This is also the time to check
for CONREF and check that all required attributes are given.

** Change buffer local variables to processing instructions

Variables that defined in a local variables section of the document to
customize the parser like sgml-shorttag and sgml-default-document
should be processing instructions in the document prolog instead.
That way sgml-mode could parse the prolog and set everything up.

<?PSGML DECLARE  shorttag yes  namecase general yes ?>
<?PSGML PARENT "main.sgml" book body sect1          ?>
