unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Greg Rowe <usenet@therowes.net>
Subject: Re: how to change default indent style of java source files
Date: Fri, 22 Apr 2005 12:36:34 -0400	[thread overview]
Message-ID: <4269285c$0$3712$39cecf19@news.twtelecom.net> (raw)
In-Reply-To: <mailman.2548.1114155862.2895.help-gnu-emacs@gnu.org>

litchi wrote:

> a question is the indent style of emacs default is just like
> public void helloWorld()
> {
>   if(today.weather == find)
>     {
>       System.out.println("oh~ a fine day~");
>     }
> }
> but actually the style I expect is 
> public void helloWorld()
> {
>   if(today.weather == find)
>   {
>     System.out.println("oh~ a fine day~");
>   }
> }

That's odd.  The default coding style when I'm in java mode in emacs is 
the 'java' coding style which matches the style you are looking for.

Anyhow, to change your coding style you can execute "C-c ." while emacs 
is running.  Hit TAB to view a list of styles.  When you find the one 
you want put the following in your .emacs:

(add-hook 'java-mode (lambda ()
	(c-set-style "java"))

Of course, replace "java" with the style you like best.

But, if you are in java mode then your default style ought to be what 
you desire anyhow.  Are you sure you don't have a mismatched paren or 
brace that might trip up the indentation scheme?

Greg

-- 
Home is where the .bashrc is.

       reply	other threads:[~2005-04-22 16:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.2548.1114155862.2895.help-gnu-emacs@gnu.org>
2005-04-22 16:36 ` Greg Rowe [this message]
2005-04-23  1:24   ` how to change default indent style of java source files litchi
2005-04-25 15:37     ` Kevin Rodgers
2005-04-26  1:18       ` litchi
     [not found]       ` <mailman.2987.1114478437.2895.help-gnu-emacs@gnu.org>
2005-04-26 12:02         ` Greg Rowe
2005-04-27  1:31           ` litchi

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='4269285c$0$3712$39cecf19@news.twtelecom.net' \
    --to=usenet@therowes.net \
    /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).