[Top][All Lists]

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

Re: java mode won't play nice

From: Artur Hefczyc
Subject: Re: java mode won't play nice
Date: Thu, 29 May 2003 22:36:49 +0200

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

Artur Hefczyc                                address@hidden
Open Source Developer

reply via email to

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