From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: luca.pamparana@gmail.com Newsgroups: gmane.emacs.help Subject: Re: having problems with indentation in c++-mode Date: Sun, 8 Feb 2009 03:06:49 -0800 (PST) Organization: http://groups.google.com Message-ID: <642d6c84-e50a-47cd-8341-7fb02f6ebce1@x38g2000yqj.googlegroups.com> References: <46eb1c48-8ab2-4e62-86f4-242b8e417dcd@p37g2000yqd.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1234093339 2303 80.91.229.12 (8 Feb 2009 11:42:19 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 8 Feb 2009 11:42:19 +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 12:43:33 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 1LW84L-0000Aw-8q for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2009 12:43:25 +0100 Original-Received: from localhost ([127.0.0.1]:37114 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LW831-0003OS-In for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Feb 2009 06:42:03 -0500 Original-Path: news.stanford.edu!newsfeed.stanford.edu!postnews.google.com!x38g2000yqj.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 45 Original-NNTP-Posting-Host: 82.113.106.1 Original-X-Trace: posting.google.com 1234091209 20104 127.0.0.1 (8 Feb 2009 11:06:49 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Sun, 8 Feb 2009 11:06:49 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: x38g2000yqj.googlegroups.com; posting-host=82.113.106.1; posting-account=D3FzDwoAAABdMDXitkUrPM9nBOvcbWaj User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.0.5) Gecko/2008121622 Ubuntu/8.10 (intrepid) Firefox/3.0.5, gzip(gfe), gzip(gfe) Original-Xref: news.stanford.edu gnu.emacs.help:166689 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:61999 Archived-At: On Feb 8, 10:07=A0am, Alan Mackenzie wrote: > luca.pampar...@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'. =A0Here's what this fin= e > manual says: > > c-basic-offset > =A0 =A0 =A0This Lisp variable holds an integer, the number of columns CC = Mode > =A0 =A0 =A0indents nested code. =A0To set this value to 6, customize > =A0 =A0 =A0`c-basic-offset' or put this into your `.emacs': > > =A0 =A0 =A0 =A0 =A0 (setq c-basic-offset 6) > > If you can't get this working, come back again. > > Best of luck! > > > Cheers, > > Luca > > -- > Alan Mackenzie (Nuremberg, Germany). That works. You are awesome! Thanks, Luca