unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* java mode indentation
@ 2005-06-07 19:27 John I. Seltzer
  0 siblings, 0 replies; only message in thread
From: John I. Seltzer @ 2005-06-07 19:27 UTC (permalink / raw)


Hi all,

I'm trying to get the following indenting style to work with emacs (NT 
Emacs to be specific):

public class blah
{

    public blah()
    {
        if (foo)
        {
                doSomething();
        }
    }
}

But instead, the braces after any block internal to the method start 
block are indented:
public class blah
{

    public blah()
    {
        if (foo)
            {
                doSomething();
            }
    }
}

I cannot figure out how to get the braces on the next line after if(foo) 
to NOT be indented.

Does anyone know which variable needs setting.
I've tried searching for this in the archives, but can't find the root 
of this problem.

Here are my settings in .emacs:
(defun a-java-mode-hook ()
  (setq tab-width 2)
  (setq indent-tabs-mode nil)
  (setq-default c-basic-offset 4)
)

(setq c-tab-always-indent t)
(setq c-indent-level 4)
(setq c-continued-brace-offset 4)
(setq c-brace-offset -4)
(setq c-brace-imaginary-offset 0)
(setq c-argdecl-indent 4)

However, I note that even if I run emacs with no .emacs, I get the same 
unwanted indentation of the internal block brace.

I've tried setting to k&r style, with no luck.

Thanks

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

only message in thread, other threads:[~2005-06-07 19:27 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-06-07 19:27 java mode indentation John I. Seltzer

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