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: Indentation settings problems Date: Wed, 23 Sep 2009 11:15:17 +0000 Message-ID: <20090923111517.GB2372@muc.de> References: <25520490.post@talk.nabble.com> <4AB58B81.7060806@pobox.com> <25531038.post@talk.nabble.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1253706130 4473 80.91.229.12 (23 Sep 2009 11:42:10 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 23 Sep 2009 11:42:10 +0000 (UTC) Cc: Help-gnu-emacs@gnu.org To: TriKri Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Sep 23 13:42:03 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 1MqQDE-0001BT-7K for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 13:40:45 +0200 Original-Received: from localhost ([127.0.0.1]:47406 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqQDD-0001zl-NA for geh-help-gnu-emacs@m.gmane.org; Wed, 23 Sep 2009 07:40:43 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1MqPlA-00009E-G6 for help-gnu-emacs@gnu.org; Wed, 23 Sep 2009 07:11:44 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1MqPl4-00007w-Nt for Help-gnu-emacs@gnu.org; Wed, 23 Sep 2009 07:11:43 -0400 Original-Received: from [199.232.76.173] (port=46040 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1MqPl4-00007j-Eg for Help-gnu-emacs@gnu.org; Wed, 23 Sep 2009 07:11:38 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:4808 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 1MqPl3-0008FI-RK for Help-gnu-emacs@gnu.org; Wed, 23 Sep 2009 07:11:38 -0400 Original-Received: (qmail 42867 invoked by uid 3782); 23 Sep 2009 11:11:35 -0000 Original-Received: from acm.muc.de (pD9E50D49.dip.t-dialin.net [217.229.13.73]) by colin2.muc.de (tmda-ofmipd) with ESMTP; Wed, 23 Sep 2009 13:11:34 +0200 Original-Received: (qmail 4448 invoked by uid 1000); 23 Sep 2009 11:15:17 -0000 Content-Disposition: inline In-Reply-To: <25531038.post@talk.nabble.com> 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:68417 Archived-At: Hi, TriKri, On Wed, Sep 23, 2009 at 01:38:35AM -0700, TriKri wrote: > I added the code (setq-default tab-width 4 indent-tabs-mode t) to the file > (\AppData\Roaming\.emacs in my user folder in windows) as you said, but it > doesn't work. If the indentation is made two times (2 times*2 spaces) it > will insert a tab instead, so that works, and the tab width is set to 4. > What confuses me is that the variable standard-indent is set to 4 (and C > Basic Offset is set to Use style settings), but it still indents with two > spaces! Isn't standard-indent the right variable to change? CC Mode doesn't use standard-indent at all. Sadly. The great thing about standards is that there're so many to chose from. ;-) > I really have no idea of what more could be wrong. The standard-indent > is said to be 4 by default, but it indented with 2 spaces right from > the beginning when I had installed Emacs. The variables you need set are: c-basic-offset ; The size of an indentation - set to 4 indent-tabs-mode ; Tells Emacs to use tabs rather than spaces - ; set to t ("t" is Lisp's symbol for "true"). tab-width ; How much space a tab character takes up on the ; screen Unfortunately, setting up CC Mode's "style variables" is too complicated. If you don't manage to get this sorted now, it would be best if you could supply "all the evidence" so that we can get it sorted out. Believe me, it WILL work. So, next time round, please (i) Post your .emacs file. (ii) Post a (short) C++ source file which illustrates the problems. Say exactly what is wrong with its indentation, and what you want it to look like. (iii) Tell us EXACTLY what you do, after starting Emacs, to show the problem. (iv) Post your CC Mode configuration here. To get this, do C-c C-b (that's "control-c followed by control-b") in your C++ buffer, and cut and paste the information into your post. > -Kristofer -- Alan Mackenzie (Nuremberg, Germany).