From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: "Artur Hefczyc" Newsgroups: gmane.emacs.help Subject: Re: java mode won't play nice Date: Thu, 29 May 2003 22:36:49 +0200 Organization: Aster City Net Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: References: NNTP-Posting-Host: main.gmane.org X-Trace: main.gmane.org 1054239874 15293 80.91.224.249 (29 May 2003 20:24:34 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Thu, 29 May 2003 20:24:34 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Thu May 29 22:24:32 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 19LTw2-0003uJ-00 for ; Thu, 29 May 2003 22:23:38 +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 19LTxs-0007dN-8F for gnu-help-gnu-emacs@m.gmane.org; Thu, 29 May 2003 16:25:32 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.tpinternet.pl!newsfeed.gazeta.pl!news.astercity.net!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 42 Original-NNTP-Posting-Host: 212.76.54.141 Original-X-Trace: foka1.acn.pl 1054239718 60673 212.76.54.141 (29 May 2003 20:21:58 GMT) Original-X-Complaints-To: abuse@astercity.net Original-NNTP-Posting-Date: Thu, 29 May 2003 20:21:58 +0000 (UTC) X-Tech-Contact: usenet@astercity.net X-Server-Info: http://www.astercity.net/news/ X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MSMail-Priority: Normal X-Priority: 3 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 Original-Xref: shelby.stanford.edu gnu.emacs.help:113865 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:10359 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:10359 > I am trying to get java mode to indent and behave just like how I have > c-mode set up. I have not been able to find anything helpful on the web. > I did read that "`java-mode' sets the style ... of the buffer to `java' *before* > running the `c-mode-common-hook' or `java-mode-hook'". Any suggestions? > Below is my c-mode stuff from my .emacs file. > (add-hook 'c-mode-common-hook 'my-c-mode-common-hook) Hm, did you try to ad your hook to java-mode-hook? (add-hook 'java-mode-hook 'my-c-mode-common-hook) I didn't checked this, because I use JDEE for java programming under emacs and I do similar thing with jdee hook, which also uses java style indentation which is not very useful. To correct this indentation I do only something like this: ;;; Some more customization for JDEE (defun my-jde-mode-hook () (c-set-offset 'substatement-open 0) (c-set-offset 'statement-case-open 0) (c-set-offset 'case-label '+) (c-set-offset 'arglist-intro '+) (c-set-offset 'arglist-cont-nonempty '+) (setq c-comment-continuation-stars "* " c-basic-offset 4) ) (add-hook 'jde-mode-hook 'my-jde-mode-hook) And it works. By the way I really recommend to use JDEE for java under emacs. I started to write emacs+jdee guide, check it maybe you will find something interesting: http://wttools.sourceforge.net/emacs-stuff/emacsandjdee.html gl Artur -- Artur Hefczyc artur.hefczyc@plusnet.pl Open Source Developer http://geotools.sourceforge.net/ http://wttools.sourceforge.net/