--- Matt Tucker <tuck(a)whistlingfish.net> wrote:
Perhaps I'm confused. I can use the get-text-property and
put-text-property defuns to apply "text properties" to a character.
Are these handled as extents under XEmacs? And would it then
be possible to apply one of these to a range of characters?
In XEmacs, text properties are just a fancy way of interfacing to
extents. This means that when you "apply one of these to a range of
characters", the `put-text-property' code defines an extent behind the
scenes. When you create two such regions that touch, the code notices
it and merges the two adjacent extents. And so on.
All of this code is implemented in Lisp (some stuff was converted to C
for speed, though). Therefore, at Lisp level, you can use both
interfaces (textprops have been provided as a convenience as well as a
porting help). However, to in order to add a new low-level feature, it
only makes sense to add it to the C implementation of extents.
Extents, as well as text properties, are described in the XEmacs Lisp
reference manual (Lispref) in depth.
That's the impression I get from what you were saying, but I must
confess that while I was aware of the concept of extents (Emacs has
them as well, in fact),
GNU Emacs has overlays, which are a parallel implementation of the same
or very similar feature. Under XEmacs, text properties are implemented
using extents. This is not the case with GNU Emacs.
I'll definitely look into this. I hadn't realized that
overlaps were
a possibility.
With GNU Emacs text properties, they're not. But in XEmacs, it's a bit
different. I just wanted to remind you of the option.
So I'd noticed. :) Case-in-point: Emacs does not contain the
syntactically-sectionize function, and in fact does most of the
fontification work in lisp rather than C.
Yup. But I don't think syntactically-sectionize and friends in
font-lock.c will be a problem to modify; they merely handle strings and
comments anyway. The real beef is in the engine behind
parse-partial-sexp.
My plan is to leave this structure mostly alone and simply modify it
to support the syntax-table property, as well as adding the necessary
support to syntax.c. Right now I'm doing the lookup for each
character, but I suspect by the time I'm done that I'll have mimicked
Emacs' caching mechanism in the interests of speed.
I'm not sure what caching mechanisms Emacs uses. It might well show
that different optimization strategies will apply to XEmacs, due to a
vastly different extents code. I have a feeling that under XEmacs it
is much more expensive to search for an extent on a char-by-char bases,
due to them being stored as a list, whereas under GNU Emacs, properties
are a balanced tree.
I've been much happier with the XEmacs product over GNU's
offering
ever since I switched (for a number of reasons, not the least of
which
is better appearance and implementation of GUI concepts), and
I'm
really looking forward to finally getting rid of this one major
thorn.
Thanks. I wish you the best of luck.
Then I might look into Tcl mode and making it suck less. :-)
__________________________________________________
Do You Yahoo!?
Send instant messages & get email alerts with Yahoo! Messenger.
http://im.yahoo.com/