>>>>> "Jonathan" == Jonathan B Leffert <jonathan(a)leffert.net> writes:
Jonathan> Are there any plans to add a mode for editing JSP files
Jonathan> to XEmacs? Basically, a jsp editing mode would consist
Jonathan> of HTML mode, but between the "<% %>" and "<%= %>" tags,
Jonathan> it would have to edit in Java mode.
Jonathan> Is this at all possible?
I've thought about that a little bit... Someone else posted about
something like this a while ago also. You'd have to have "extent
local" modes to do that, he thought, with different sets of
extent-local variables for font-locking and suchlike to work inside
those tags. Extents already have their own keymap, so you can bind,
for instance, a different indenter function to TAB, only inside that
extent.
You could then make a mode for your .jsp files that wrapped an extent
around the Java part, giving that it's own set of keybindings. Over
the whole buffer then, you'd need your own set of font-lock-keywords,
that can handle both the HTML part and the Java part. I guess you'd
do best to perhaps write it as an extension over (thus inheriting)
the existing psgml mode.
It would be a lot simpler if you could just map some extents into the
buffer, then put what's inside of them into any arbitrary existing
major mode, complete with {extent,mode,buffer,thread,class,
YTMAWBK}-local variables and font-lock. (May as well throw in
lexical scoping and a module system to boot...)
I don't have the time to spend trying to write a mode, unless it's
for hire; I have to spend the time reading. (tuition money would be
welcome...) XEmacs lisp isn't that hard to learn; it's just got a
large vocabulary. The documentation is excellent, and there's lots
of lisp to look through. Perhaps you have the time to write that
mode for XEmacs.
There is also a thing called an indirect buffer... You can make an
indirect buffer of a buffer, and put that into a different mode. The
two buffers visit the same file and hold the same contents; if you
edit in one, you see it in the other. So you could have on buffer in
Java mode and the other in HTML mode. I don't think font lock would
work right then though.
I need to go eat then do my math.