unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: "Artur Hefczyc" <wislaj23@wp.pl>
Subject: Re: java mode won't play nice
Date: Thu, 29 May 2003 22:36:49 +0200	[thread overview]
Message-ID: <bb5q56$1r81$1@foka1.acn.pl> (raw)
In-Reply-To: mailman.6908.1054124887.21513.help-gnu-emacs@gnu.org

> 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/

       reply	other threads:[~2003-05-29 20:36 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 ` Artur Hefczyc [this message]
2003-05-30 12:14   ` java mode won't play nice Kevin Dziulko
     [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='bb5q56$1r81$1@foka1.acn.pl' \
    --to=wislaj23@wp.pl \
    /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).