bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sgml-mode.el: html-close-tag


From: Felix Natter
Subject: Re: sgml-mode.el: html-close-tag
Date: 12 Feb 2002 18:36:44 +0100
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

Richard Stallman <address@hidden> writes:

>     - when I eval this code, it loads 'thingatpt (for thing-at-point
>       'word) and 'mule-util (?).
> 
> Why does it load them?

Well, (thing-at-point 'word) is used in two places.
I don't know about 'mule-util.
What is your point ?
Should I rewrite the code without using 'thing-at-point ?
 
>     - there are three variables, and they are likely used "file-locally"
>       (in <!-- Local Variables: ...). Should we still make them available
>       via defcustom ?
> 
> Definitely.
> 
>      if so, which group should they be put in ? (sgml or
>       html, which doesn't yet exist)
> 
> Probably use sgml.  It looks like there is not enough need for
> a new group.

I checked the sgml-mode.el from cvs and found that the variable
sgml-empty-tags makes it possible to generalize `html-close-tag' to
`sgml-close-tag'.

you didn't reply to this:

- do we need to support comments that end in i.e. "-- >" ?
  (allowed in HTML 4, section 3.2.4 of the specification)
  currently html-close-tag exits with an error.
=> I will make the behavior depend on `sgml-xml'

- I have written a testsuite for html-close-tag (included in
  closetag.el) Should we put it in sgml-mode.el, too ? It's about
  70 lines.
=> I suggest to include this testsuite (it might make maintenance easier)


Furthermore, there are three variables some of which can be translated
to existing variables:

(defvar html-close-tag-enforce-xhtml nil
  "Tell the user to use empty-element tags \(i.e. <img src=\"x.png\"/>\) or add
an end-tag \(i.e. <p>text</p>\) as required by xhtml 1.0.")
=> I suggest to translate this to `sgml-xml'.

(defvar html-close-tag-extra-empty-tags '()
  "List of (names of) extra tags which are not closed.")
=> IMHO there should be an `sgml-extra-empty-tags' variable, because
this is mostly used buffer-locally and you want to say:

Local Variables:
sgml-extra-empty-tags: ("p" "li")
End:

instead of:

Local Variables:
sgml-empty-tags: ("br" "hr" "img" "input" "area" "link" "param" "col"
  "base" "meta" "basefont" "frame" "isindex" "wbr" "p" "li")
End:
(this variable should also be used in `sgml-tag')


(defvar html-close-tag-ignore-nesting nil
  "If this is t, ignore \"Invalid nesting\" \(things like <b><i>Text</b></i>\).
Note that this only makes sense if you know that the nesting is wrong and you
declared all extra \"empty\" elements \(with `html-close-tag-extra-empty-tags'\)
and there's nothing else wrong and you don't want to fix it. If you have to
use this it will most often result in \"Nothing to do\" or a wrong end-tag.")

=> As it says in the docstring: this is not very useful, but it doesn't
hurt if we give it a long name like `sgml-close-tag-ignore-nesting' ?

-- 
Felix Natter




reply via email to

[Prev in Thread] Current Thread [Next in Thread]