From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Java mode indention Date: Fri, 1 Aug 2003 21:24:18 +0000 Organization: muc.de e.V. -- private internet access Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <2qlegb.5f.ln@acm.acm> References: <84brvaiq2i.fsf@slowfox.is.informatik.uni-duisburg.de> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-Trace: main.gmane.org 1059775926 14295 80.91.224.249 (1 Aug 2003 22:12:06 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Fri, 1 Aug 2003 22:12:06 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Aug 02 00:12:01 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 19ii81-0003ho-00 for ; Sat, 02 Aug 2003 00:12:01 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.20) id 19ihYn-0001Ur-Ie for geh-help-gnu-emacs@m.gmane.org; Fri, 01 Aug 2003 17:35:37 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!cyclone.bc.net!newsfeed.media.kyoto-u.ac.jp!newsfeed.icl.net!newsfeed.fjserv.net!newsfeed.freenet.de!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 66 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1059772928 76341 193.149.49.134 (1 Aug 2003 21:22:08 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 1 Aug 2003 21:22:08 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:115627 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:11539 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:11539 J Richardson wrote on 31 Jul 2003 15:43:20 -0400: > kai.grossjohann@gmx.net (Kai Großjohann) writes: >> J Richardson 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").