Define own jsp-mode based on html-mode with JSP comment style.
--- a/.emacs-my Fri Nov 02 08:50:48 2012 +0200
+++ b/.emacs-my Fri Nov 02 12:09:02 2012 +0200
@@ -2356,8 +2356,6 @@
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "html")
-(add-to-list 'auto-mode-alist '("\\.jspf?\\'" . html-mode))
-
(defun html-charref-escape-region (start end)
(interactive "r")
(save-excursion
@@ -2453,6 +2451,23 @@
(add-to-list 'html-tag-alist '("style" (\n) ("type" "text/css") ))
)))
+
+;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
+(message "jsp")
+
+(define-derived-mode jsp-mode html-mode "JSP"
+ "JSP editing mode. Redefine HTML comment syntax to JSP."
+ (setq comment-start "<%--")
+ (setq comment-end "--%>")
+ (setq comment-start-skip "<[!%]--[ \t]*")
+ (setq comment-end-skip "[ \t]*--[% \t\n]*>")
+ (setq jsp-font-lock-syntactic-keywords
+ '(("\\(<\\)%--" (1 "< b"))
+ ("--%\\(>\\)" (1 "> b"))))
+ (setcdr (assoc 'font-lock-syntactic-keywords font-lock-defaults) 'jsp-font-lock-syntactic-keywords) )
+
+(add-to-list 'auto-mode-alist '("\\.jspf?\\'" . jsp-mode))
+
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(message "sh, bash")