tomcat-dev mailing list archives

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

>   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.

and add this to your .emacs

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

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

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

Ted Guild
Software Developer

View raw message