all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [JDEE + MMM-Mode + JSP] Java indentation in JSP files
@ 2003-09-04 10:08 Kai Grossjohann
  0 siblings, 0 replies; only message in thread
From: Kai Grossjohann @ 2003-09-04 10:08 UTC (permalink / raw)


Hitting TAB on lines 2 through 4 in the following example gives me no
indentation for any line.  (Each line stays flush left.)

<%
if (true) {
System.out.println("foo");
}
%>

I snarfed the following setup from the Web for using mmm-mode with
JDEE to edit *.jsp files:

(require 'mmm-mode)
(require 'mmm-sample)
(add-to-list 'auto-mode-alist '("\\.jsp\\'" . html-mode))
(setq mmm-global-mode 'maybe)
(mmm-add-group 'jsp
               '((jsp-code
                  :submode jde-mode
                  :match-face (("<%!" . mmm-declaration-submode-face)
                               ("<%=" . mmm-output-submode-face)
                               ("<%"  . mmm-code-submode-face))
                  :front "<%[!=]?"
                  :back "%>"
                  :insert ((?% jsp-code nil @ "<%" @ " " _ " " @ "%>"
@)
                           (?! jsp-declaration nil @ "<%!" @ " " _ " "
@ "%>" @)
                           (?= jsp-expression nil @ "<%=" @ " " _ " "
@ "%>" @))
                  )
                 (jsp-directive
                  :submode text-mode
                  :face mmm-special-submode-face
                  :front "<%@"
                  :back "%>"
                  :insert ((?@ jsp-directive nil @ "<%@" @ " " _ " " @
"%>" @))
                  )))
(add-to-list 'mmm-mode-ext-classes-alist '(nil "\\.jsp\\'" jsp-code))

The above works well for syntax highlighting.  Maybe it is too
simple-minded?  Can it be improved such that indentation works?

(C-h c TAB tells me that TAB indeed invokes c-indent-command when I
hit it on one of the Java lines in the *.jsp file.  This is the same
binding as in a *.java file.)

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2003-09-04 10:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2003-09-04 10:08 [JDEE + MMM-Mode + JSP] Java indentation in JSP files Kai Grossjohann

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.