unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Kevin Dziulko <dziulko@klaatu.canisius.edu>
Subject: Re: java mode won't play nice
Date: Fri, 30 May 2003 08:14:29 -0400 (EDT)	[thread overview]
Message-ID: <Pine.LNX.4.44.0305300808430.21753-100000@klaatu.canisius.edu> (raw)
In-Reply-To: <bb5q56$1r81$1@foka1.acn.pl>

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	other threads:[~2003-05-30 12:14 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.6908.1054124887.21513.help-gnu-emacs@gnu.org>
2003-05-29 20:36 ` java mode won't play nice Artur Hefczyc
2003-05-30 12:14   ` Kevin Dziulko [this message]
     [not found] <ubrxndqmg.fsf@softechnics.com>
2003-05-28 17:58 ` Kevin Dziulko
2003-05-28 12:27 Kevin Dziulko

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=Pine.LNX.4.44.0305300808430.21753-100000@klaatu.canisius.edu \
    --to=dziulko@klaatu.canisius.edu \
    /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).