From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: Setting auto-indentation of braces Date: Tue, 10 Feb 2009 16:46:07 +0000 Message-ID: <20090210164606.GA3035@muc.de> References: <4991527f$0$14913$9b536df3@news.fv.fi> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1234283176 5593 80.91.229.12 (10 Feb 2009 16:26:16 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Tue, 10 Feb 2009 16:26:16 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Juha Nieminen Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Feb 10 17:27:31 2009 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LWvSK-0007fb-ER for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Feb 2009 17:27:28 +0100 Original-Received: from localhost ([127.0.0.1]:43367 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWvR0-0000TM-Ml for geh-help-gnu-emacs@m.gmane.org; Tue, 10 Feb 2009 11:26:06 -0500 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LWvQh-0000TH-HO for help-gnu-emacs@gnu.org; Tue, 10 Feb 2009 11:25:47 -0500 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LWvQe-0000Ss-UN for help-gnu-emacs@gnu.org; Tue, 10 Feb 2009 11:25:47 -0500 Original-Received: from [199.232.76.173] (port=32943 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LWvQe-0000Sp-RH for help-gnu-emacs@gnu.org; Tue, 10 Feb 2009 11:25:44 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:3912 helo=mail.muc.de) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LWvQe-0006IC-Ct for help-gnu-emacs@gnu.org; Tue, 10 Feb 2009 11:25:44 -0500 Original-Received: (qmail 46289 invoked by uid 3782); 10 Feb 2009 16:25:39 -0000 Original-Received: from acm.muc.de (pD9E51F59.dip.t-dialin.net [217.229.31.89]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Tue, 10 Feb 2009 17:25:38 +0100 Original-Received: (qmail 8543 invoked by uid 1000); 10 Feb 2009 16:46:07 -0000 Content-Disposition: inline In-Reply-To: <4991527f$0$14913$9b536df3@news.fv.fi> User-Agent: Mutt/1.5.9i X-Delivery-Agent: TMDA/1.1.5 (Fettercairn) X-Primary-Address: acm@muc.de X-detected-operating-system: by monty-python.gnu.org: FreeBSD 4.6-4.9 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:62036 Archived-At: 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).