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: Wed, 27 Apr 2005 09:31:50 +0800 Message-ID: <20050427013150.GA3533@mail.lvying.org> References: <4269285c$0$3712$39cecf19@news.twtelecom.net> <20050423012456.GA3070@mail.lvying.org> <426e2e28$0$3711$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 1114565831 10143 80.91.229.2 (27 Apr 2005 01:37:11 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 27 Apr 2005 01:37:11 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 27 03:37:07 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1DQbTl-0004PV-8l for geh-help-gnu-emacs@m.gmane.org; Wed, 27 Apr 2005 03:36:41 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQbZa-0002cM-PA for geh-help-gnu-emacs@m.gmane.org; Tue, 26 Apr 2005 21:42:42 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1DQbZI-0002bh-7d for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 21:42:24 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1DQbZE-0002aI-5Y for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 21:42:23 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1DQbZD-0002PQ-W8 for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 21:42:20 -0400 Original-Received: from [64.233.184.204] (helo=wproxy.gmail.com) by monty-python.gnu.org with esmtp (Exim 4.34) id 1DQbTI-0000mP-Aj for help-gnu-emacs@gnu.org; Tue, 26 Apr 2005 21:36:12 -0400 Original-Received: by wproxy.gmail.com with SMTP id 50so166562wri for ; Tue, 26 Apr 2005 18:32:27 -0700 (PDT) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:date:to:cc:subject:message-id:reply-to:mail-followup-to:references:mime-version:content-type:content-disposition:in-reply-to:user-agent:from; b=KCXBF/UGPlvt+v/katq75immKgxaOO9LglpsdTPZSf4rcdV4Dmo9EnXWQPNq+r8I9mO9Aj4N/TTgwJZmUGNiPRcX3BxF8Q2/2TupPw0r2bm8PquUf4OsnyYGFfXyHe1aQlRtiLn66bdW5G25NgyYJN4jYFe6M5Uyouoyg5OLYjs= Original-Received: by 10.54.120.13 with SMTP id s13mr217431wrc; Tue, 26 Apr 2005 18:32:27 -0700 (PDT) Original-Received: from localhost ([218.9.120.97]) by mx.gmail.com with ESMTP id 26sm363492wrl.2005.04.26.18.32.22; Tue, 26 Apr 2005 18:32:27 -0700 (PDT) Original-To: help-gnu-emacs@gnu.org Mail-Followup-To: help-gnu-emacs@gnu.org, smartLitchi@gmail.com Content-Disposition: inline In-Reply-To: <426e2e28$0$3711$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:26078 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:26078 On Tue, Apr 26, 2005 at 08:02:23AM -0400, Greg Rowe wrote: > litchi wrote: > > > >(defun my-java-mode-hook () > > (c-set-style "k&r") > > (setq c-basic-offset 2)) > > > > (add-hook 'java-mode-hook 'my-java-mode-hook) > >but I dont know the meaning of those statements > >I am totally a newer to lisp and emacs > > You defined function called 'my-java-mode-hook'. In that function you > made a couple calls to customize the current buffer. When you call > add-hook you are adding your customization function to a list of > functions that will be called any time that java-mode is started. I have read the part in Emacs manual of indent and customization the style,knon something aboule customization the style, but now I have another question, suppose a block,default indent style is just as follow, how can I make The indent of all level statements and methods the same,but not let the first level twice the indent of others. public class A { ~~~~4 backspace ---> how to change this 4 space to 2 space also? (suppose 2 space is the default offset) public A() { ~~2 backspace if(a) { ~~2 backspace also then; } } } > > Greg > > -- > Home is where the .bashrc is. > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://lists.gnu.org/mailman/listinfo/help-gnu-emacs 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