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: (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error? Date: 11 Jan 2012 09:34:57 -0000 Organization: muc.de e.V. Message-ID: <20120111093457.53318.qmail@mail.muc.de> NNTP-Posting-Host: lo.gmane.org X-Trace: dough.gmane.org 1326274522 12965 80.91.229.12 (11 Jan 2012 09:35:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 09:35:22 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 11 10:35:18 2012 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RkuaT-0003WZ-Lb for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 10:35:17 +0100 Original-Received: from localhost ([::1]:54991 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkuaQ-0008Li-2b for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 04:35:14 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:51034) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkuaG-0008He-OL for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 04:35:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RkuaE-0001HP-T0 for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 04:35:04 -0500 Original-Received: from colin.muc.de ([193.149.48.1]:50709 helo=mail.muc.de) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RkuaE-0001EU-Fz for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 04:35:02 -0500 Original-Received: (qmail 53319 invoked by uid 3782); 11 Jan 2012 09:34:57 -0000 User-Agent: tin/1.9.6-20101126 ("Burnside") (UNIX) (FreeBSD/8.2-STABLE (amd64)) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 193.149.48.1 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:83454 Archived-At: -- forwarded message -- Path: news.muc.de!not-for-mail From: Alan Mackenzie Newsgroups: gnu.emacs.help Subject: Re: Trying to use only tabs for indenting c# files - csharp-mode error? Date: Mon, 9 Jan 2012 09:46:45 +0000 (UTC) Organization: muc.de e.V. Lines: 115 Message-ID: References: NNTP-Posting-Host: news.muc.de X-Trace: colin.muc.de 1326102405 28296 193.149.48.2 (9 Jan 2012 09:46:45 GMT) X-Complaints-To: news-admin@muc.de NNTP-Posting-Date: Mon, 9 Jan 2012 09:46:45 +0000 (UTC) User-Agent: tin/1.9.6-20101126 ("Burnside") (UNIX) (FreeBSD/8.2-STABLE (amd64)) Xref: news.muc.de gnu.emacs.help:183926 Guido Van Hoecke wrote: > Hi, > Objective: use only tabs for indenting c# files [ .... ] > Ultimately, I want the tab-width set to 4, but for now I just want to > leave or set it to 8: > M-x set-variable [enter] tab-width [enter] 8 [enter] > I will use following legend when showing file content: > # represents a leading tab > + represents a leading empty space (following a preceding tab) > = represents a leading space character > Here's the source file: > namespace Application > { > #+++++++public class MyClass > #+++++++{ > #+++++++#+++++++public MyClass () > #+++++++#+++++++{ > #+++++++#+++++++} > #+++++++} > } > Deleting the first tab changes it to: > namespace Application > { > =======public class MyClass > #+++++++{ > #+++++++#+++++++public MyClass () > #+++++++#+++++++{ > #+++++++#+++++++} > #+++++++} > } > Hitting tab key while point is the 'public class' line changes it to: > namespace Application > { > ==public class MyClass > #+++++++{ > #+++++++#+++++++public MyClass () > #+++++++#+++++++{ > #+++++++#+++++++} > #+++++++} > } > I can't help but feeling that this is in error! > The tab-width is 8, > indent-tabs-mode is t > and still, it uses spaces to indent, and only two of them. You have told it to use a tab instead of 8 spaces. You haven't told it how far to indent, though. [ .... ] > And finally" > M-< > C-SPC > M-> > > produces following result: > namespace Application > { > ==public class MyClass > =={ > ====public string MyString; > ====public MyClass () > ===={ > ====} > ==} > } > So obviously neither tab-width nor indent-tabs-mode are obeyed nor > respected! > Please advise, C# mode is derived from CC Mode, so read the CC Mode manual. :-) However, for your specific problem, the variable c-basic-offset needs to be set to 8. Currently, it looks like it is 2. > ;;; csharp-mode.el --- C# mode derived mode > > ;; Author : Dylan R. E. Moonfire (original) > ;; Maintainer : Dino Chiesa > ;; Created : Feburary 2005 > ;; Modified : May 2011 > ;; Version : 0.8.6 > ;; Keywords : c# languages oop mode > ;; X-URL : http://code.google.com/p/csharpmode/ > ;; Last-saved : <2011-May-21 20:28:30> Perhaps you could contact Dino Chiesa and ask him to include "CC Mode" (with that capitalisation, please) somewhere in that information. > TIA, > Guido -- Alan Mackenzie (Nuremberg, Germany). -- end of forwarded message --