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: having problems with indentation in c++-mode Date: Sun, 8 Feb 2009 09:07:49 +0000 (UTC) Organization: muc.de e.V. Message-ID: References: <46eb1c48-8ab2-4e62-86f4-242b8e417dcd@p37g2000yqd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org X-Trace: ger.gmane.org 1234086088 17414 80.91.229.12 (8 Feb 2009 09:41:28 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2009 09:41:28 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Feb 08 10:42:43 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 1LW6BV-0003AJ-QS for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2009 10:42:42 +0100 Original-Received: from localhost ([127.0.0.1]:56385 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LW6AC-0005UE-Gf for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2009 04:41:20 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!feeder.erje.net!news.germany.com!news.space.net!news.muc.de!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: marvin.muc.de Original-X-Trace: colin2.muc.de 1234084069 82074 2001:608:1000::2 (8 Feb 2009 09:07:49 GMT) Original-X-Complaints-To: news-admin@muc.de Original-NNTP-Posting-Date: Sun, 8 Feb 2009 09:07:49 +0000 (UTC) User-Agent: tin/1.6.2-20030910 ("Pabbay") (UNIX) (FreeBSD/4.11-RELEASE (i386)) Original-Xref: news.stanford.edu gnu.emacs.help:166685 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:61994 Archived-At: luca.pamparana@gmail.com wrote: > Hello everyone, > I would like to set the indentation level to 4 characters and I am > having trouble achieving this in the c++-mode. I have looked on the > web and used the most common template that is found but the smart > indentation always indents at 2 spaces...no matter what I set the tab- > width or the indent level. [ .... ] > I can set the tab-width or the indent-level to whatever number but it > does not help. It always indents at 2 spaces. > > I am an emacs newbie, so I am sure I have missed something basic. I > would be grateful for any help you might give me. The magic document is the CC Mode manual, chapter "Getting Started". The variable you need to set is `c-basic-offset'. Here's what this fine manual says: c-basic-offset This Lisp variable holds an integer, the number of columns CC Mode indents nested code. To set this value to 6, customize `c-basic-offset' or put this into your `.emacs': (setq c-basic-offset 6) If you can't get this working, come back again. Best of luck! > Cheers, > Luca -- Alan Mackenzie (Nuremberg, Germany).