From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: =?utf-8?Q?=C3=93scar_Fuentes?= Newsgroups: gmane.emacs.help Subject: Re: Trying to use only tabs for indenting c# files - csharp-mode error? Date: Sun, 08 Jan 2012 20:06:42 +0100 Message-ID: <87ehvanhdp.fsf@wanadoo.es> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326049621 26474 80.91.229.12 (8 Jan 2012 19:07:01 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sun, 8 Jan 2012 19:07:01 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Guido Van Hoecke Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Jan 08 20:06:56 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 1Rjy50-0005Vq-7r for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Jan 2012 20:06:54 +0100 Original-Received: from localhost ([::1]:45494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjy4z-0002rT-D1 for geh-help-gnu-emacs@m.gmane.org; Sun, 08 Jan 2012 14:06:53 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57642) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjy4u-0002rB-LZ for help-gnu-emacs@gnu.org; Sun, 08 Jan 2012 14:06:49 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rjy4t-0006ow-7y for help-gnu-emacs@gnu.org; Sun, 08 Jan 2012 14:06:48 -0500 Original-Received: from impaqm3.telefonica.net ([213.4.138.19]:60420 helo=telefonica.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rjy4s-0006om-SD for help-gnu-emacs@gnu.org; Sun, 08 Jan 2012 14:06:47 -0500 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm3.telefonica.net with bizsmtp id K5K41i00B0r0BT63P76kp1; Sun, 08 Jan 2012 20:06:44 +0100 Original-Received: from qcore ([88.11.106.32]) by IMPmailhost2.adm.correo with BIZ IMP id K76j1i0040hxhHC1i76kQP; Sun, 08 Jan 2012 20:06:44 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: 981711563@telefonica.net In-Reply-To: (Guido Van Hoecke's message of "Sun, 8 Jan 2012 14:01:38 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 213.4.138.19 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:83418 Archived-At: Guido Van Hoecke writes: [snip] > namespace Application > { > ==public class MyClass > =={ > ====public string MyString; > ====public MyClass () > ===={ > ====} > ==} > } > > So obviously neither tab-width nor indent-tabs-mode are obeyed nor > respected! All your examples here makes me think that csharp-mode is indenting by two spaces per level. As PJ says, tabs will not be used unless the line is preceded by `tab-width' spaces (8 in your case). If you set tab-width to 4, I expect to see tabs used for the most deeply indented lines on the example quoted above. Put this in your .emacs and see if it makes a difference: (defun my-csharp-mode-fn () (c-set-style "C#") (setq tab-width 4) (setq indent-tabs-mode t)) (add-hook 'csharp-mode-hook 'my-csharp-mode-fn)