From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.help Subject: Re: indentation in c++ Date: Sat, 5 Mar 2005 08:41:54 +0000 Organization: muc.de e.V. -- private internet access Message-ID: References: <1109883492.981908.203470@l41g2000cwc.googlegroups.com> NNTP-Posting-Host: main.gmane.org X-Trace: sea.gmane.org 1110062724 944 80.91.229.2 (5 Mar 2005 22:45:24 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Sat, 5 Mar 2005 22:45:24 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sat Mar 05 23:45:23 2005 Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1D7i1K-00050G-WF for geh-help-gnu-emacs@m.gmane.org; Sat, 05 Mar 2005 23:45:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1D7iKm-0006fk-P7 for geh-help-gnu-emacs@m.gmane.org; Sat, 05 Mar 2005 18:05:20 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!news-FFM2.ecrc.net!news-mue1.dfn.de!news-stu1.dfn.de!news.belwue.de!informatik.tu-muenchen.de!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 31 Original-NNTP-Posting-Host: acm.muc.de Original-X-Trace: marvin.muc.de 1110062768 25223 193.149.49.134 (5 Mar 2005 22:46:08 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: 5 Mar 2005 22:46:08 GMT User-Agent: tin/1.4.5-20010409 ("One More Nightmare") (UNIX) (Linux/2.0.35 (i686)) Original-Xref: shelby.stanford.edu gnu.emacs.help:129000 Original-To: help-gnu-emacs@gnu.org 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 X-MailScanner-To: geh-help-gnu-emacs@m.gmane.org Xref: main.gmane.org gmane.emacs.help:24546 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:24546 prab@spectral.com wrote on 3 Mar 2005 12:58:13 -0800: > How do I customize Emacs so that when editing a C++ file the > indentation of for loops, etc., will be 3 spaces instead of the default > of 2 spaces? > We have GNU emacs version 21.2.1 A default of 2 spaces? UURRRRKKKK!!! How horrible! The variable you need to change is c-basic-offset, and it's documented in the CC Mode manual on the page "Customizing Indentation". How you would go about setting it is on the page "Sample .emacs File". First, why not check through your .emacs and find if it's getting set to 2 there? If so, just change it. Otherwise put something like this into your .emacs: (defun prab-c++-hook () (setq c-basic-offset 3)) (add-hook 'c++-mode-hook 'prab-c++-hook) (_Don't_ forget the two quote marks in that last line.) > We have GNU emacs version 21.2.1 -- Alan Mackenzie (Munich, Germany) Email: aacm@muuc.dee; to decode, wherever there is a repeated letter (like "aa"), remove half of them (leaving, say, "a").