unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kai.Grossjohann@gmx.net (Kai Grossjohann)
Subject: [JDEE + MMM-Mode + JSP] Java indentation in JSP files
Date: 4 Sep 2003 03:08:12 -0700	[thread overview]
Message-ID: <e808b168.0309040208.16e8468c@posting.google.com> (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.)

                 reply	other threads:[~2003-09-04 10:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=e808b168.0309040208.16e8468c@posting.google.com \
    --to=kai.grossjohann@gmx.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).