From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Rusi Newsgroups: gmane.emacs.help Subject: Re: C indentation customization Date: Sat, 25 Jul 2015 09:55:15 -0700 (PDT) Message-ID: <02b7a116-443c-4572-8e7d-847a151d7ca1@googlegroups.com> References: <9975de97-78b1-4f7f-939e-f3cecd5128f7@googlegroups.com> <3e7addc2-8703-4eff-a647-010b9040bcef@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Trace: ger.gmane.org 1437843625 9798 80.91.229.3 (25 Jul 2015 17:00:25 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sat, 25 Jul 2015 17:00:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Jul 25 19:00:19 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ZJ2o5-00066I-EX for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Jul 2015 19:00:17 +0200 Original-Received: from localhost ([::1]:48617 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZJ2o4-0004bD-W3 for geh-help-gnu-emacs@m.gmane.org; Sat, 25 Jul 2015 13:00:16 -0400 X-Received: by 10.50.112.132 with SMTP id iq4mr4479069igb.6.1437843315884; Sat, 25 Jul 2015 09:55:15 -0700 (PDT) X-Received: by 10.50.126.35 with SMTP id mv3mr83658igb.17.1437843315868; Sat, 25 Jul 2015 09:55:15 -0700 (PDT) Original-Path: usenet.stanford.edu!f3no2763535igg.0!news-out.google.com!a16ni28323ign.0!nntp.google.com!f3no2763529igg.0!postnews.google.com!glegroupsg2000goo.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=59.94.119.239; posting-account=mBpa7woAAAAGLEWUUKpmbxm-Quu5D8ui Original-NNTP-Posting-Host: 59.94.119.239 User-Agent: G2/1.0 Injection-Date: Sat, 25 Jul 2015 16:55:15 +0000 Original-Xref: usenet.stanford.edu gnu.emacs.help:213707 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:105993 Archived-At: On Saturday, July 25, 2015 at 1:09:58 PM UTC+5:30, Eli Zaretskii wrote: > > Date: Fri, 24 Jul 2015 22:25:27 -0700 (PDT) > > From: Rusi > > > > On Friday, July 24, 2015 at 8:23:11 PM UTC+5:30, Rusi wrote: > > > On Friday, July 24, 2015 at 7:54:41 PM UTC+5:30, Rusi wrote: > > > > http://emacswiki.org/emacs/IndentingC > > > > seems to say that doing > > > > > > > > (setq c-default-style "linux" > > > > c-basic-offset 4) > > > > > > > > will indent like this: > > > > > > > > if(foo) > > > > { > > > > bar++; > > > > } > > > > > > > > ie '{' is not indented, contents is 4 space indented. > > > > > > > > Likewise setting to bsd > > > > as described https://en.wikipedia.org/wiki/Indent_style#Allman_style > > > > seems to say that the '{' wont be indented > > > > > > > > None of these work; ie the '{' is always indented. > > > > > > Evidently restarting emacs makes it work > > > [ie these bindings need to be in effect before CC-mode is loaded(?)] > > > > Should not the early-binding of these deserve a place somewhere (prominent) > > in the docs? > > Something like: > > - For permanent settings do ... > > - For temporary trying out do ... > > Did you read the node "Config Basics" in the CC Mode manual? It seems > to discuss precisely these issues. I did. If you know what you are looking for, you can look for it :-) Also its not there in the describe-variable for c-default-style except in a backhanded sort of way: ------- The default style gets installed before your mode hooks run, so you can always override the use of `c-default-style' by making calls to `c-set-style' in the appropriate mode hook. -------