From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Guido Van Hoecke 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 16:22:52 +0100 Message-ID: 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 1326295595 6975 80.91.229.12 (11 Jan 2012 15:26:35 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 15:26:35 +0000 (UTC) Cc: Alan Mackenzie , help-gnu-emacs@gnu.org To: =?UTF-8?Q?=C3=93scar_Fuentes?= Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 11 16:26:30 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 1Rl04G-0000ih-4D for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 16:26:24 +0100 Original-Received: from localhost ([::1]:35045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl01M-0006aN-JA for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 10:23:24 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:56893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl01D-0006Zt-1p for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 10:23:20 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl01B-0001P5-Pz for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 10:23:14 -0500 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:57736) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl01B-0001P0-Lo for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 10:23:13 -0500 Original-Received: by yhoo21 with SMTP id o21so389519yho.0 for ; Wed, 11 Jan 2012 07:23:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type:content-transfer-encoding; bh=BSXS+fl9oxVQ9d1x/dbfx1WkbkaS26Gf2m91qccju8c=; b=qcVxbf3eY5dynQPP4039qsc2esfAfzVD5NLFtqEb3i/AunM9DRodiKpVcPSbZ3KQmD zNWWmnAe+scjwd9fcOxzO/OfnpHW8R/rlCyBYDe/XVhJYZJA1L3/hHqFsHCRbpicoV3s aDIWkrAr3goNQXmXlFVNu3FuwwVl3ea780coc= Original-Received: by 10.236.124.206 with SMTP id x54mr23354738yhh.112.1326295393181; Wed, 11 Jan 2012 07:23:13 -0800 (PST) Original-Received: by 10.147.182.7 with HTTP; Wed, 11 Jan 2012 07:22:52 -0800 (PST) In-Reply-To: <87pqeqmi2s.fsf@wanadoo.es> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.213.41 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:83461 Archived-At: Hi =C3=93scar, On Wed, Jan 11, 2012 at 15:26, =C3=93scar Fuentes wrote: > 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 () > =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, but on the other hand, emacs complains with "Undefined style: C#" when entering c# mod= e. Kind regards, Guido -- "And what will you do when you grow up to be as big as me?" asked the father of his little son. "Diet." http://vanhoecke.org ... and go2 places!