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: (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error? Date: Wed, 11 Jan 2012 15:26:03 +0100 Message-ID: <87pqeqmi2s.fsf@wanadoo.es> References: <20120111093457.53318.qmail@mail.muc.de> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1326292017 11228 80.91.229.12 (11 Jan 2012 14:26:57 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 14:26:57 +0000 (UTC) Cc: Alan Mackenzie , 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 Wed Jan 11 15:26:52 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 1Rkz8e-0002BX-36 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 15:26:52 +0100 Original-Received: from localhost ([::1]:40137 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkz8d-0003Ht-Kg for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 09:26:51 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:43276) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkz8Q-00039R-CJ for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 09:26:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rkz8K-0007TE-Bg for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 09:26:38 -0500 Original-Received: from impaqm3.telefonica.net ([213.4.138.19]:7234 helo=telefonica.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rkz8K-0007T0-0S for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 09:26:32 -0500 Original-Received: from IMPmailhost2.adm.correo ([10.20.102.39]) by IMPaqm3.telefonica.net with bizsmtp id L9221i00q0r0BT63PES5Cw; Wed, 11 Jan 2012 15:26:05 +0100 Original-Received: from qcore ([88.11.106.32]) by IMPmailhost2.adm.correo with BIZ IMP id LES31i0150hxhHC1iES4Ep; Wed, 11 Jan 2012 15:26:05 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: 981711563@telefonica.net In-Reply-To: (Guido Van Hoecke's message of "Wed, 11 Jan 2012 13:38:39 +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:83459 Archived-At: Guido Van Hoecke writes: >>> The tab-width is 8, >>> indent-tabs-mode is t >>> and still, it uses spaces to indent, and only two of them. >>> 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. :-) Alan: there are mentions to cc-mode all around csharp-mode.el. Your name is prominently mentioned on the Acknowledgements section too. It would be even nicer if CC Mode were capitalized correctly, though. :-) >> However, for your specific problem, the variable c-basic-offset needs >> to be set to 8. Currently, it looks like it is 2. > > That was the missing piece of information! > > With c-basic-offset set to 8, the requested behaviour is obtained. The function hook I recommended you to try on a previous message activated the "C#" style, which is defined into csharp-mode: (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) It sets c-basic-offset to 4. So with that setup you should see tabs instead of spaces too. I wonder why you didn't.