help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Setting auto-indentation of braces


From: Alan Mackenzie
Subject: Re: Setting auto-indentation of braces
Date: Tue, 10 Feb 2009 16:46:07 +0000
User-agent: Mutt/1.5.9i

Hi, Juha!

On Tue, Feb 10, 2009 at 12:10:07PM +0200, Juha Nieminen wrote:
>   In the linux version of emacs, when I'm writing a C/C++/other 
> {}-based language, when I write a { to start a new block, emacs 
> automatically indents it.

>   In the macosx version this autoindentation is off, and I can't figure 
> out where to turn it on. I'm so accustomed to it, that it's annoying 
> that it doesn't work...

How dare they!  ;-)  What's the betting they forgot to amend the manual
to match?

>   Which magic .emacs line turns this feature on?

Try C-c C-l `c-toggle-electric-state' to begin with.  If this works,
then all you need to do is switch this on in a hook function, something
like:

    (defun jn-electric-on ()
      (c-toggle-electric-state 1))
    (add-hook 'c-mode-common-hook 'jn-electric-on)

If this doesn't work, please send a dump of your CC Mode configuration,
created by C-c C-b.  Either send it off to bug-cc-mode@gnu.org, or
change the To: address, or put and caste it to a different mail client,
or whatever.

The documentation for this is the CC Mode manual, which should have been
distributed together with your Emacs.

-- 
Alan Mackenzie (Nuremberg, Germany).




reply via email to

[Prev in Thread] Current Thread [Next in Thread]