RE: [jasspa] JSP highlighting?
The starting point for this is the existing html file hook (hkhtml.emf) which supports both Visual Basic and Java script hilighting. In the file hook you will find the following:
!force exec-file "hkvb"
hilight .hilight.html 0x80 "<%" .hilight.vb .scheme.prepro
hilight .hilight.htmlT 0x80 "<%" .hilight.vb .scheme.prepro
hilight .hilight.vb 0x80 "%>" .hilight.html .scheme.prepro
hilight .hilight.html 0x80 "<script\\s +language=VBScript[^>]*>" .hilight.vb .scheme.prepro
hilight .hilight.vb 0x80 "</script>" 0 .scheme.prepro
; indent .hilight.vb b "<" ">"
!force exec-file "hkjava"
hilight .hilight.java 0x80 "</script>" 0 .scheme.prepro
hilight .hilight.java 0x80 "</SCRIPT>" 0 .scheme.prepro
While this looks scary its simply swapping hilighting schemes when certain tags are met, currently when <% is encountered it swaps to Visual Basic rather than java and a simple <script> is not handled as in html the language must be given.
Do jsp files have a '.jsp' extension?
From my understanding I would copy hkhtml.emf to hkjsp.emf and replace html with jsp, rip out any references to vb and modify the above tokens to swap to java on the <% and <script> tags.
You then need to add a hook into me.emf to use your new fhook-jsp when a jsp file is loaded (look for fhook-html - strictly speaking you should add this to your user Setup File in user-setup).
Lastly it would be good if you could submit your changes back to me so I can wrap it into the next release of ME! It would help me if you could include a suitable JSP example so I can check the file hook etc.
If you get stuff drop me an email (with a JSP example!)
> -----Original Message-----http://docs.yahoo.com/info/terms/
> From: prelude_2_murder [mailto:prelude_2_murder@...]
> Sent: 26 March 2003 11:58
> To: email@example.com
> Subject: [jasspa] JSP highlighting?
> Hi everyone. I am new to this list (and to me).
> I have just recently started using me for most things (I love emacs
> but the size and slowness is just too much), but I can't get it to
> highlight jsp syntax (html + java within <% %> tags). This is the
> main thing keeping me away from using microemacs for everything.
> and, when testing on a page, I was glad to find that the latest
> but not when using just <script>. Any hints on how to extend the
> highlighting to use that too.
> I am completely new to lisp and such languages, so please be patient
> with me.
> ------------------------ Yahoo! Groups Sponsor
> Get 128 Bit SSL Encryption!
> This is an unmoderated list. JASSPA is not responsible for
> the content of
> any material posted to this list.
> To unsubscribe, send a mail message to
> or visit http://groups.yahoo.com/group/jasspa and
> modify your account settings manually.
> Your use of Yahoo! Groups is subject to
- Thanks for your answer. By now I have (mostly) got it right myself. I
am not afraid of changing things around, I just don't understand even a
little about Lisp.
Your solution is better, but what I did was:
What I did was in me.emf added .jsp to the extensions for the html
mode, as jsp pages are just html pages with embedded java.
Added "<script>" "<%" to the "openers" of the java section (if that is
end ("</script>" is already there) in hkhtml.emf.
Now, the only problem I have is that autoindenting doesn't seem to work
there, so any help would be welcome.
Should I post a copy of this to the list?
Thanks very much for your help, I will email you the changes when I
have done them (I have two deadlines tomorrow, so I am far too busy to
sit down and write something clean, I'll have to live with my hack for
Do You Yahoo!?
Everything you'll ever need on one web page
from News and Sport to Email and Music Charts