# HG changeset patch # User Oleksandr Gavenko # Date 1351850942 -7200 # Node ID ad3c49e558486fa01883b2b56960b0433ffb58cd # Parent 3dea749e5fe23ed3e5a092f7449d818c50c79c92 Define own jsp-mode based on html-mode with JSP comment style. diff -r 3dea749e5fe2 -r ad3c49e55848 .emacs-my --- 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")