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 18:42:31 +0100 Message-ID: <87lipem8zc.fsf@wanadoo.es> References: <20120111093457.53318.qmail@mail.muc.de> <87pqeqmi2s.fsf@wanadoo.es> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1326304693 11825 80.91.229.12 (11 Jan 2012 17:58:13 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 17:58:13 +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 18:58:08 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 1Rl2R5-0007gY-4N for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 18:58:07 +0100 Original-Received: from localhost ([::1]:50760 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl2Ds-0001LM-23 for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 12:44:28 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:42682) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl2Di-0001Hg-D5 for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 12:44:24 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl2Dc-0001vt-QK for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 12:44:18 -0500 Original-Received: from impaqm2.telefonica.net ([213.4.138.18]:61436 helo=telefonica.net) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl2Db-0001v7-H5 for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 12:44:12 -0500 Original-Received: from IMPmailhost4.adm.correo ([10.20.102.125]) by IMPaqm2.telefonica.net with bizsmtp id LHKc1i00G2iL0W23MHiaj3; Wed, 11 Jan 2012 18:42:34 +0100 Original-Received: from qcore ([88.11.106.32]) by IMPmailhost4.adm.correo with BIZ IMP id LHiY1i00Y0hxhHC1kHiZ3d; Wed, 11 Jan 2012 18:42:34 +0100 X-Brightmail-Tracker: AAAAAA== X-original-sender: 981711563@telefonica.net In-Reply-To: (Guido Van Hoecke's message of "Wed, 11 Jan 2012 16:22:52 +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.18 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:83463 Archived-At: Guido Van Hoecke writes: >>>> 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 () >> =C2=A0(c-set-style "C#") >> =C2=A0(setq tab-width 4) >> =C2=A0(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. > > Well, on the one hand, c-basic-offset should be 8 for this case, No. The hook sets tab-width to 4 and the C# style indents by 4 columns, which was precisely what you wanted, IIRC. > but on the other hand, emacs complains with "Undefined style: C#" when > entering c# mode. My version of csharp-mode.el is 0.8.6, from May 2011. It defines the C# style at line 5219: (c-add-style "C#" ...