unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Alan Mackenzie<none@example.invalid>
Subject: Re: Java mode indention
Date: Fri, 1 Aug 2003 21:24:18 +0000	[thread overview]
Message-ID: <2qlegb.5f.ln@acm.acm> (raw)
In-Reply-To: mailman.806.1059680707.8231.help-gnu-emacs@gnu.org

J Richardson <jrivers77@yahoo.com> wrote on 31 Jul 2003 15:43:20 -0400:
> kai.grossjohann@gmx.net (Kai Großjohann) writes:

>> J Richardson <jrivers77@yahoo.com> 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 bug-cc-mode@gnu.org.

> 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: aacm@muuc.dee; to decode, wherever there is a repeated letter
(like "aa"), remove half of them (leaving, say, "a").

  parent reply	other threads:[~2003-08-01 21:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.789.1059668280.8231.help-gnu-emacs@gnu.org>
2003-07-31 17:06 ` Java mode indention Kai Großjohann
2003-07-31 19:43   ` J Richardson
     [not found]   ` <mailman.806.1059680707.8231.help-gnu-emacs@gnu.org>
2003-08-01 20:38     ` Kai Großjohann
2003-08-01 21:24     ` Alan Mackenzie [this message]
2003-08-06 18:21       ` J Richardson
2003-08-06 20:05         ` J Richardson
2003-08-10 17:35 ` Stefan Monnier
2003-08-12 17:03   ` J Richardson
2003-07-31 16:02 J Richardson

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=2qlegb.5f.ln@acm.acm \
    --to=none@example.invalid \
    /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).