unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Re: sgml-mode.el: html-close-tag
       [not found] <87bsey1ng8.fsf@gmx.net>
@ 2002-02-11  2:09 ` Richard Stallman
  2002-02-12 17:36   ` Felix Natter
       [not found]   ` <87aduezjo3.fsf@gmx.net>
  0 siblings, 2 replies; 5+ messages in thread
From: Richard Stallman @ 2002-02-11  2:09 UTC (permalink / raw)
  Cc: emacs-devel

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

Why does it load them?

    - 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.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sgml-mode.el: html-close-tag
  2002-02-11  2:09 ` sgml-mode.el: html-close-tag Richard Stallman
@ 2002-02-12 17:36   ` Felix Natter
       [not found]   ` <87aduezjo3.fsf@gmx.net>
  1 sibling, 0 replies; 5+ messages in thread
From: Felix Natter @ 2002-02-12 17:36 UTC (permalink / raw)
  Cc: bug-gnu-emacs, emacs-devel, monnier+gnu/emacs/bug

Richard Stallman <rms@gnu.org> 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


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sgml-mode.el: html-close-tag
       [not found]   ` <87aduezjo3.fsf@gmx.net>
@ 2002-02-15 22:14     ` Stefan Monnier
  2002-02-16 21:56     ` Richard Stallman
  2002-02-16 21:56     ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Stefan Monnier @ 2002-02-15 22:14 UTC (permalink / raw)
  Cc: rms, bug-gnu-emacs, emacs-devel, monnier+gnu/emacs/bug

> (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:

These aren't really "empty tags" but tags for which it is legal (in SGML
but not in XML) to drop the closing tag.  I agree that there should be
such a sgml-unclosed-tags (or some such name) and it could also be used
by a hypothetical indentation algorithm (my hope is that the xml-lite
indentation algorithm can be generalized to support it so that it can
also be used for sgml indentation).

> => 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' ?

There's no problem with long names.


	Stefan


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sgml-mode.el: html-close-tag
       [not found]   ` <87aduezjo3.fsf@gmx.net>
  2002-02-15 22:14     ` Stefan Monnier
@ 2002-02-16 21:56     ` Richard Stallman
  2002-02-16 21:56     ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-02-16 21:56 UTC (permalink / raw)
  Cc: bug-gnu-emacs, emacs-devel, monnier+gnu/emacs/bug

    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 ?

If that is easy to do, it would be an improvement.
In general it is better to reduce the number of packages that
any one package depends on.  So if there is a major advantage
in using package FOO, do it; if there is only a minor advantage,
it may be better to avoid using it.

_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sgml-mode.el: html-close-tag
       [not found]   ` <87aduezjo3.fsf@gmx.net>
  2002-02-15 22:14     ` Stefan Monnier
  2002-02-16 21:56     ` Richard Stallman
@ 2002-02-16 21:56     ` Richard Stallman
  2 siblings, 0 replies; 5+ messages in thread
From: Richard Stallman @ 2002-02-16 21:56 UTC (permalink / raw)
  Cc: emacs-devel, monnier+gnu/emacs/bug

I mostly don't have opinions about the remaining questions.  The
features sound reasonable but I am not an expert so I can't be sure.
I hope other people who know SGML more than I do will think about these
questions and make some good decisions.

But I do have one comment:

    (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.")

This doc string has a problem because the first line needs to stand
on its own.


_______________________________________________
Emacs-devel mailing list
Emacs-devel@gnu.org
http://mail.gnu.org/mailman/listinfo/emacs-devel


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2002-02-16 21:56 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <87bsey1ng8.fsf@gmx.net>
2002-02-11  2:09 ` sgml-mode.el: html-close-tag Richard Stallman
2002-02-12 17:36   ` Felix Natter
     [not found]   ` <87aduezjo3.fsf@gmx.net>
2002-02-15 22:14     ` Stefan Monnier
2002-02-16 21:56     ` Richard Stallman
2002-02-16 21:56     ` Richard Stallman

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).