all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* How to change the defualt indent style of java source file
@ 2005-04-22  4:41 Xiangqian Liu
  0 siblings, 0 replies; 2+ messages in thread
From: Xiangqian Liu @ 2005-04-22  4:41 UTC (permalink / raw)



[-- Attachment #1.1: Type: text/plain, Size: 718 bytes --]

I am turning from vim to emacs ,and the first step seems a little
difficult~~

a problem 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~");
  }
}
you may notice that the position of { } of the if loop has been changed
to be accord with that if statement, seems this is the recommand code 
style of Sun's documentation
but I can't find how to change emacs's default indent style to this

Best regards
Litchi



-- 
不管如何伟大的恋情,有结局,何况是我这微不足道的痴恋

[-- Attachment #1.2: Type: text/html, Size: 839 bytes --]

[-- Attachment #2: Type: text/plain, Size: 152 bytes --]

_______________________________________________
Help-gnu-emacs mailing list
Help-gnu-emacs@gnu.org
http://lists.gnu.org/mailman/listinfo/help-gnu-emacs

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: How to change the defualt indent style of java source file
       [not found] <mailman.2524.1114145377.2895.help-gnu-emacs@gnu.org>
@ 2005-04-22 10:23 ` David Hansen
  0 siblings, 0 replies; 2+ messages in thread
From: David Hansen @ 2005-04-22 10:23 UTC (permalink / raw)


On Fri, 22 Apr 2005 12:41:32 +0800 Xiangqian Liu wrote:

> actually the style I expect is 
> public void helloWorld()
> {
>   if(today.weather == find)
>   {
>     System.out.println("oh~ a fine day~");
>
>   }
> }

Does this help?

(defun my-java-mode-hook ()
  (c-set-style "k&r")
  (setq c-basic-offset 2))

(add-hook 'java-mode-hook 'my-java-mode-hook)

David

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2005-04-22 10:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-04-22  4:41 How to change the defualt indent style of java source file Xiangqian Liu
     [not found] <mailman.2524.1114145377.2895.help-gnu-emacs@gnu.org>
2005-04-22 10:23 ` David Hansen

Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.