tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ted Guild <...@guilds.net>
Subject Emacs JSP mode
Date Fri, 15 Oct 1999 01:50:48 GMT
Anil,

>   2. Emacs mode for JSP. (Beer's on me, if you're
> interested!)

Here's a quick and dirty way to get a jsp mode.  Not much work
involved, hardly worth a pint to toast emacs with.

Basically it switches back and forth between the modes you choose to
handle html and java appropriately as you traverse your page.  The
re-parsing for font-lock coloring as it switches modes can take a
bit for real lengthy jsp pages (not good practice anyway as you should
abstract the logic into objects), but otherwise is rather nice.

Obtain multimode.el from one of the lisp archives and add it to your
load path.

ftp://archive.cis.ohio-state.edu/pub/emacs-lisp/misc/

and add this to your .emacs

;;multi-mode
	   (autoload 'multi-mode
		     "multi-mode"
		     "Allowing multiple major modes in a buffer."
		     t)

	   (defun jsp-mode () (interactive)
	     (multi-mode 1
			 'html-mode
			 ;;your choice of modes for java and html
			 ;;'("<%" java-mode)
			 '("<%" jde-mode)
			 '("%>" html-mode)))

	   (setq auto-mode-alist
		 (cons '("\\.jsp$" . jsp-mode)
		 auto-mode-alist))


-- 
Ted Guild
Software Developer
http://www.guilds.net
ted@guilds.net





Mime
View raw message