emacs-devel
[Top][All Lists]
Advanced

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

[patch] use font-lock


From: Daniel Colascione
Subject: [patch] use font-lock
Date: Fri, 23 May 2008 18:26:27 -0400

[Originally sent to the nxml mailing list]

I've converted nxml to font-lock. I used the existing fontification machinery 
and put it inside a cc-mode-style matcher. Efficiency and output are the 
same, but:

1) hi-lock-mode works now
2) all conventional font-locking functions work as expected. For example, you 
can turn fontification on and off with M-x font-lock-mode.
3) font-lock-add-keywords DTRT
4) multiple-major-modes modes should be able to use nXML fontification now, 
though this remains untested

I've also added a new function:
nxml-debug-region: Interactive function. Activate the region and call 
nxml-debug-region. The new region is what nxml thinks should be re-fontified 
if the original region is changed.

The new code probably works only on Emacs 22. Lightly tested, but it seems to 
handle corner highlighting cases fine. I removed a bunch of code that 
was "for redisplay", since I'm assuming font-lock handles those funky bits.

In addition to the patch, I've attached a set of files that demonstrates 
extending nXML mode to work with the Genshi template engine. The examples 
ought to work with some slight modification of the embedded paths.

(Does the Relax NG compact syntax offer a way to say "include the next file 
for this document type"?)


Attachment: nxml-font-lock.patch
Description: Text Data

Attachment: qtmstr-nxml-mode.el
Description: Text document

Attachment: genshi.rnc
Description: Text document

Attachment: qtmstr-xhtml.rnc
Description: Text Data

Attachment: schemas.xml
Description: Text Data

Attachment: xinclude.rnc
Description: Text Data

Hello from hello! Test ${name}

reply via email to

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