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

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

Re: Java mode indention


From: Alan Mackenzie
Subject: Re: Java mode indention
Date: Fri, 1 Aug 2003 21:24:18 +0000
User-agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686))

J Richardson <address@hidden> wrote on 31 Jul 2003 15:43:20 -0400:
> address@hidden (Kai Gro├čjohann) writes:

>> J Richardson <address@hidden> writes:

[ .... ]

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

Are you being absolutely accurate here?  "bar" seems to be indented _5_
columns from the "(" and _13_ columns from beginning-of-line.  Could you
do a C-c C-s (i.e. `c-show-syntactic-information') on this line, please?

Also, which version of CC Mode are you using?  (Do M-x c-version).

> when I'd prefer this:

>   a_method(another_method(foo,
>       bar));

>   ^ I want it to add it from here

In the most recent CC Mode (5.30) it looks like the "bar" would get
indented 8 columns from begining-of-line (4 columns (c-basic-offset) for
each level of parentheses).  This isn't very good either.  It may well be
that the best quick fix would be to write you a special indentation
function (see the page "Indentation Functions" in the CC Mode manual).

The most helpful place to report this sort of problem is on the CC Mode
mailing list at address@hidden

> 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

-- 
Alan Mackenzie (Munich, Germany)
Email: address@hidden; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").



reply via email to

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