help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Java mode indention


From: J Richardson
Subject: Re: Java mode indention
Date: 31 Jul 2003 15:43:20 -0400
User-agent: Gnus/5.0808 (Gnus v5.8.8) Emacs/21.2

kai.grossjohann@gmx.net (Kai Großjohann) writes:

> J Richardson <jrivers77@yahoo.com> writes:
> 
> > I'd like it to use the base offset of the beginning of the statement
> > instead.
> 
> I've done this for the case where the open paren is the last thing on
> the line.  This way, I get the following:
> 
> f(a,
>   b);
> f(
>     a,
>     b);
> 
> I did it my running (c-set-offset 'arglist-intro '+) from
> java-mode-hook:
> 
> (defun my-java-indent ()
>   (c-set-offset ...))
> (add-hook 'java-mode-hook 'my-java-indent)

I have that... it only works for one set of parentheses though. I
don't like what it does if you add another one. I'm not sure what
terminology to use. It goes from the start of the method call instead
of the start of the whole statement.

My offset is set to 4, and I have (c-set-offset 'arglist-intro '+), so:

  a_method(another_method(foo,
               bar));

          ^ it adds the extra offset of 4 from here

when I'd prefer this:

  a_method(another_method(foo,
      bar));

  ^ I want it to add it from here

If there is only one parenthesis then the two cases are the same.
I've been living with it for a while, and your recent question about
indentation reminded me about it :-)

At one point it did what I wanted, but that was at my old job and I
don't remember which version of Emacs it was. Either the default
behavior changed or there was something in my .emacs there that I
forgot to bring forward sometime. I've taken out my customizations to
make sure it isn't something I've added that did it.

Thanks,
Jen






reply via email to

[Prev in Thread] Current Thread [Next in Thread]