-- Hrvoje Niksic <hrniksic(a)yahoo.com> spake thusly:
Note however that, under the hood, XEmacs is quite different from
GNU
Emacs. Specifically, there are no "text properties" in XEmacs, but
"extents". You would need to implement a `syntax-table' extent
property and make the code in syntax.c respect it. You might want to
introduce some optimizations to make this efficient (repeated querying
for extents from within syntax.c could be slow), but it's probably to
early to talk about that.
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?
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), it didn't seem to me that I was using them. No
matter; I'll figure it out.
You would also need to consider what happens when two overlapping
extents both have syntax-table properties define. You might want to
consider implementing a cascading scheme, so that e.g. the inner
extent takes precedence over the outer one, or you might declare such
overlappings undefined, if you think it's an overkill.
I'll definitely look into this. I hadn't realized that overlaps were a
possibility.
Also note that syntax engine implementation in XEmacs is probably
different from the GNU Emacs one. You might want to sync it with the
latest one in GNU Emacs, while being careful not to break XEmacs in
the process. Syncing is often tricky.
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.
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.
All in all, I don't want to give an impression that I'm
trying to
discourage you. In most places, XEmacs is very well written, and
adding new features is more of a challenge than just boring typing. I
hope that you will decide to undertake implementing this feature. You
have my support.
On the contrary, your comments seemed far more encouraging than
discouraging. In fact, I'd worried a bit about trying to do this (as
might have been discernible from my first email) due to rumors of
previous lukewarm responses from the XEmacs people (chocolate XEmacs
people, too?), but in fact all the responses I've had thus far have
been both helpful and encouraging, which I definitely appreciate.
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.