On Fri, 2002-09-06 at 02:06, Jeff Mincy wrote:
[...]
(put 'xml-mode 'font-lock-defaults
'(html-font-lock-keywords nil t))
The problem is that without the above html-font-lock hack, xml-mode
does not do font locking. xml-mode does some sort of font locking if
you have set various configuration variables sgml-auto-activate-dtd
and sgml-set-face. If these variables are set, then xml code will be
fontified according to sgml-markup-faces.
[...]
Ok. I wasn't quite up to date how the built-in fontification in psgml
works, thanks for the explanation. It looks a bit hairy indeed,
especially with the requirement for sgml-auto-activate-dtd.
> Those keywords contain stuff that is plain wrong in XML, such
as
> fontifying stuff inside the <strong> tag in bold.
Maybe. If you have xhtml stuff mixed in it would be correct?
Yes, for the XHTML parts of it. But I'm against blindly applying it to
*all* XML documents.
Additionally, it might be pretty hard to implement the fontification for
arbitrary XML docs containing XHTML inside, along with other namespaces,
properly. Doable, but IMHO not worth it. Instead, the HTML keywords
could be used if the DTD of the doc says it's XHTML. Hmm, maybe
detecting this requires auto-activation of the DTD... :(
> I think this is because psgml's own fontification kicks in
when one hits
> the TAB in the above. Doing M-x font-lock-fontify-buffer RET brings
> back a consistent state (ie. the one that psgml-html and its font-lock
> does), but editing the buffer after that again changes the colours.
I've noticed that as well. This xml-mode font-lock hack wouldn't
explain this particular problem though? html-mode doesn't call
xml-mode? Right?
Right, kind of. It isn't related to xml-mode, but sgml-mode and the
assumption that the built-in fontification of sgml-mode and the
font-lock stuff in psgml-html don't play together well. sgml-mode is
related, because html-mode derives from it.
> As you already note in [1], this is the first cut and most
likely work
> in progress, but could you give any estimates how/when/if you're
> planning to continue the work? I'm afraid that we'll start receiving
> bug reports about this soon...
Hmm, on a second look, this has been in CVS since last December, and at
least I don't remember seeing bug reports about this.
Nevertheless, this obviously needs some work. I'll see if I can come up
with a plan and/or patches soon.
Cheers,
--
\/ille Skyttä
ville.skytta at
xemacs.org