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

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

Re: java mode won't play nice


From: Kevin Dziulko
Subject: Re: java mode won't play nice
Date: Fri, 30 May 2003 08:14:29 -0400 (EDT)

Yes, I did do the (add-hook 'java-mode-hook 'my-c-mode-common-hook).  It 
didn't seem to be helping me.  The main problem was the block braces, {, 
were not getting indented properly.  Then I learned that there was some 
syntacic symbol differences between c and java from the class 
declarations.  I added (inline-open . 0) to my-c-mode-common-hook, and now 
I'm pretty much happy with the indentation of the code.  Thanks to all 
who've replied!


On Thu, 29 May 2003, Artur Hefczyc wrote:

> > 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/
> 
> 
> 
> _______________________________________________
> Help-gnu-emacs mailing list
> Help-gnu-emacs@gnu.org
> http://mail.gnu.org/mailman/listinfo/help-gnu-emacs
> 





reply via email to

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