From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jai Dayal Newsgroups: gmane.emacs.help Subject: Re: how to set c-set-style at startup? Date: Tue, 19 Jul 2011 20:34:05 -0600 Message-ID: References: <8762myyi93.fsf@micropit.couberia.bzh> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=000e0ce0d15c1ac2a004a87712e8 X-Trace: dough.gmane.org 1311129358 20235 80.91.229.12 (20 Jul 2011 02:35:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 20 Jul 2011 02:35:58 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: =?ISO-8859-1?Q?Peter_M=FCnster?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jul 20 04:35:54 2011 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1QjMdd-0001lg-Op for geh-help-gnu-emacs@m.gmane.org; Wed, 20 Jul 2011 04:35:53 +0200 Original-Received: from localhost ([::1]:33360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjMdc-00052o-Ap for geh-help-gnu-emacs@m.gmane.org; Tue, 19 Jul 2011 22:35:52 -0400 Original-Received: from eggs.gnu.org ([140.186.70.92]:51470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjMcH-00052i-Oh for help-gnu-emacs@gnu.org; Tue, 19 Jul 2011 22:34:30 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjMcF-0004Dk-0z for help-gnu-emacs@gnu.org; Tue, 19 Jul 2011 22:34:29 -0400 Original-Received: from mail-wy0-f169.google.com ([74.125.82.169]:37390) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjMcE-0004DW-RA for help-gnu-emacs@gnu.org; Tue, 19 Jul 2011 22:34:26 -0400 Original-Received: by wyg36 with SMTP id 36so3724352wyg.0 for ; Tue, 19 Jul 2011 19:34:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=j4to+lAcQ6DbEs1bOfwNqz0V5ESaGFX8OsyR0FHpMFU=; b=mJQI617GepPXlkC0mRbvXmRL2YuxMX3SQDUXZ8uvGuTOelKzfCbD4Tc9w03ACSwRvJ kc3xUwP6AK7l1swK5z6eg8jivlHx0k7xC7GfsenS+4VTQXu4xPEhOABysIn58O4CpxMW cEi88m/cETy1swj0jptB4zu1xeuhVM4QrUKuM= Original-Received: by 10.216.68.200 with SMTP id l50mr4670275wed.106.1311129265160; Tue, 19 Jul 2011 19:34:25 -0700 (PDT) Original-Received: by 10.216.88.84 with HTTP; Tue, 19 Jul 2011 19:34:05 -0700 (PDT) In-Reply-To: <8762myyi93.fsf@micropit.couberia.bzh> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 74.125.82.169 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:81685 Archived-At: --000e0ce0d15c1ac2a004a87712e8 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried this, but it doesn't seem to be working. For example, I change the style to the style I have in the code below, and the indentation will be different. I can also put in garbage instead of "linux" and no errors occur. Maybe I'm missing something? On Mon, Jul 18, 2011 at 11:03 PM, Peter M=FCnster wrote: > On Tue, Jul 19 2011, Jai Dayal wrote: > > > It seems right now, I have to do c-set-style for each file/buffer I > open. > > Is there a way I can set this in my .emacs file so that all files will > have > > the same c style indentation? > > Without customize: > > --8<---------------cut here---------------start------------->8--- > (add-hook 'c-mode-hook > '(lambda () > (c-set-style "linux") > ... ; other settings > )) > --8<---------------cut here---------------end--------------->8--- > > -- > Peter > > > --000e0ce0d15c1ac2a004a87712e8 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable I tried this, but it doesn't seem to be working.=A0 For example, I chan= ge the style to the style I have in the code below, and the indentation wil= l be different.=A0 I can also put in garbage instead of "linux" a= nd no errors occur.=A0

Maybe I'm missing something?

On M= on, Jul 18, 2011 at 11:03 PM, Peter M=FCnster <pmlists@free.fr> wrote:
On Tue, Jul 19 2011, Jai Dayal wrote:

> =A0 It seems right now, I have to do c-set-style for each file/buffer = I open.=A0
> Is there a way I can set this in my .emacs file so that all files will= have
> the same c style indentation?

Without customize:

--8<---------------cut here---------------start------------->8---
(add-hook 'c-mode-hook
=A0 =A0 =A0 =A0 =A0'(lambda ()
=A0 =A0 =A0 =A0 =A0 =A0 (c-set-style "linux")
=A0 =A0 =A0 =A0 =A0 =A0 ... ; other settings
=A0 =A0 =A0 =A0 =A0 =A0 ))
--8<---------------cut here---------------end--------------->8---

--
=A0 =A0 =A0 =A0 =A0 Peter



--000e0ce0d15c1ac2a004a87712e8--