From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: litchi Newsgroups: gmane.emacs.help Subject: Re: how to change default indent style of java source files Date: Sat, 23 Apr 2005 09:24:56 +0800 Message-ID: <20050423012456.GA3070@mail.lvying.org> References: <4269285c$0$3712$39cecf19@news.twtelecom.net> Reply-To: smartLitchi@gmail.com NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1114219442 29112 80.91.229.2 (23 Apr 2005 01:24:02 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 23 Apr 2005 01:24:02 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Apr 23 03:23:58 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DP9NB-0006XI-Cc for geh-help-gnu-emacs@m.gmane.org; Sat, 23 Apr 2005 03:23:53 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DP9SC-0004z0-8e for geh-help-gnu-emacs@m.gmane.org; Fri, 22 Apr 2005 21:29:04 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DP9Rp-0004y5-Gt for help-gnu-emacs@gnu.org; Fri, 22 Apr 2005 21:28:41 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DP9Rn-0004xG-3O for help-gnu-emacs@gnu.org; Fri, 22 Apr 2005 21:28:41 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DP9Rm-0004r5-Uu for help-gnu-emacs@gnu.org; Fri, 22 Apr 2005 21:28:39 -0400 Original-Received: from [64.233.184.200] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DP9S8-00078I-Ck for help-gnu-emacs@gnu.org; Fri, 22 Apr 2005 21:29:00 -0400 Original-Received: by wproxy.gmail.com with SMTP id 49so454584wri for ; Fri, 22 Apr 2005 18:26:07 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:to:subject:message-id:reply-to:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=Dkw7CJgK9kZOBeOV4jcQ3sgmt3A5e2w5UEQXmAP/pCiVZx7t3Ycbf4n+xWu2xlN2yGhYODIIgcRCowm3/6/0OWdS8Eea+SwSg2Rb55UsY3BfRTZ/Dkkesj8qQnUshf7T6HCtSsCAoa3TysjPScakoti1ROv5CaOQJLokZza78cA= Original-Received: by 10.54.17.43 with SMTP id 43mr223551wrq; Fri, 22 Apr 2005 18:26:07 -0700 (PDT) Original-Received: from localhost ([218.9.124.152]) by mx.gmail.com with ESMTP id 67sm258104wra.2005.04.22.18.25.52; Fri, 22 Apr 2005 18:26:07 -0700 (PDT) Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <4269285c$0$3712$39cecf19@news.twtelecom.net> User-Agent: Mutt/1.5.6+20040907i X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:25977 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:25977 On Fri, Apr 22, 2005 at 12:36:34PM -0400, Greg Rowe wrote: > 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 But it seems doesn't work on my system when I press C-c following by . emacs says C-c . is undefined I guess C-c is a personal function prefix so maybe you bonding your own function to C-c . Best regards Litchi from China~~~ -- It takes a strong man to save himself, and a great man to save another. IBM ThinkPad T23 hiweed0.6 fetchmail+procmail+mutt+msmtp vim7+emacs22+mule