Title: Java hilighting extensions - Java doc hilighting Ref: sub28 Author: Jon Green Date: Sat Mar 20 14:18:09 2004 The Java hilighting may be extended to hilight the following:- - JavaDoc comments - Curly braces {} - TODO comments. The following file adds hilighting for all of the above. Comment out the blocks that are not required. Extract the code body to a file called "myjava.emf" and add this to your private "jasspa" directory which is:- ~.jasspa on UNIX. $APPDATA\jasspa on Windows. ==== myjava.emf start ========================================================= ; -!- emf -!- ; This is part of the JASSPA MicroEmacs macro files ; Copyright (C) 1999-2004 JASSPA (www.jasspa.com) ; See the file me.emf for copying and conditions. ; ; Synopsis: Java doc hilighting and extensions. ; Authors: Jon Green ; !if &and &sin "h" .fhook-java.setup &band .hilight.flags 0x02 ; Create a new javadoc hilighting scheme !if ¬ &exi .hilight.javadoc set-variable .hilight.javadoc &pinc .hilight.next 1 !endif ; Add a hook into the normal Java hilighing. We jump into ; javadoc when we see an opening "/**" . hilight .hilight.java 0x80 "/\\*\\*" .hilight.javadoc .scheme.comment ; Javadoc hilighting starts here 0 hilight .hilight.javadoc 2 50 .scheme.comment ;   etc. hilight .hilight.javadoc 0 "&\\w\\w;" .scheme.variable hilight .hilight.javadoc 0 "&\\w\\w\\w;" .scheme.variable hilight .hilight.javadoc 0 "&\\w\\w\\w\\w;" .scheme.variable hilight .hilight.javadoc 0 "&\\w\\w\\w\\w\\w;" .scheme.variable hilight .hilight.javadoc 0 "&\\w\\w\\w\\w\\w;" .scheme.variable hilight .hilight.javadoc 0 "&\\w\\w\\w\\w\\w\\w;" .scheme.variable ; "
 ... 
" hilight .hilight.javadoc 4 "
" "
" "" .scheme.variable ; hilight .hilight.javadoc 4 "" "" .scheme.variable ; {@link URL} hilight .hilight.javadoc 4 "{@link" "}" "" .scheme.link ; "@anyWord" - Use branch token and close when not a word! hilight .hilight.javadoc 4 "@" "\\}\\W" "" .scheme.keyword ; We must return to Java when we see the close of comment "*/" hilight .hilight.javadoc 0x80 "\\*/" .hilight.java .scheme.comment !endif ; Hilight curly braces - add to myjava.emf !if &and &sin "h" .fhook-java.setup &band .hilight.flags 0x02 ; In keyword colour hilight .hilight.java 1 "{" .scheme.keyword hilight .hilight.java 1 "}" .scheme.keyword !endif ; Hilight TODO in a comment - Examples ; i.e. /* TODO I need to do this */ !if &and &sin "h" .fhook-java.setup &band .hilight.flags 0x02 hilight .hilight.java 20 "/\\*\\s +TODO" "*/" "" .scheme.error !endif ==== myjava.emf end ===========================================================