all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Rusi <rustompmody@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: C indentation customization
Date: Sat, 25 Jul 2015 09:55:15 -0700 (PDT)	[thread overview]
Message-ID: <02b7a116-443c-4572-8e7d-847a151d7ca1@googlegroups.com> (raw)
In-Reply-To: <mailman.7372.1437809994.904.help-gnu-emacs@gnu.org>

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.
-------


      parent reply	other threads:[~2015-07-25 16:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-24 14:24 C indentation customization Rusi
2015-07-24 14:53 ` Rusi
2015-07-25  5:25   ` Rusi
2015-07-25  7:38     ` Eli Zaretskii
     [not found]     ` <mailman.7372.1437809994.904.help-gnu-emacs@gnu.org>
2015-07-25 16:55       ` Rusi [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=02b7a116-443c-4572-8e7d-847a151d7ca1@googlegroups.com \
    --to=rustompmody@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.