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 21:04:39 +0100 Message-ID: References: <20120111093457.53318.qmail@mail.muc.de> <87pqeqmi2s.fsf@wanadoo.es> <87lipem8zc.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 1326312322 4769 80.91.229.12 (11 Jan 2012 20:05:22 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Wed, 11 Jan 2012 20:05:22 +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 21:05:17 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 1Rl4Q8-0003Nt-Hy for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 21:05:16 +0100 Original-Received: from localhost ([::1]:58877 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4Q7-0004Tr-Rm for geh-help-gnu-emacs@m.gmane.org; Wed, 11 Jan 2012 15:05:15 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:57729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4Pz-0004RS-97 for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:05:09 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Rl4Ps-00029P-U5 for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:05:07 -0500 Original-Received: from mail-yw0-f41.google.com ([209.85.213.41]:42092) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Rl4Ps-00029J-OU for help-gnu-emacs@gnu.org; Wed, 11 Jan 2012 15:05:00 -0500 Original-Received: by yhoo21 with SMTP id o21so597640yho.0 for ; Wed, 11 Jan 2012 12:05:00 -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=aYM+dnXwI2o6sdmZ9yuR98gCxfsFIH533zFjlLDz4CU=; b=BLKyH45vjGLl9Iga55QCGc8sGikAiLQ+V0Atj9xhJR4yipX3/CBy0aeqgvI6IhQIeh oTkH2fH+KYkpPMGKoxrhY9P7+8PE74/RQ7JIl5h9YrBkEoQtjXnf8bo9feD6J5cGQpPH k/LspWXjrV3p8wfNPawzGo7J8GqM/6jdinIn4= Original-Received: by 10.236.124.206 with SMTP id x54mr385907yhh.112.1326312300181; Wed, 11 Jan 2012 12:05:00 -0800 (PST) Original-Received: by 10.147.182.7 with HTTP; Wed, 11 Jan 2012 12:04:39 -0800 (PST) In-Reply-To: <87lipem8zc.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:83468 Archived-At: Hi On Wed, Jan 11, 2012 at 18:42, =C3=93scar Fuentes wrote: > 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. Not really, the technical lead wants only indentation by means of tabs, and they set the display width to 4. My understanding is that tab-width 4 would lead to using spaces for the trailing 'odd' tab (e.g. create 3 indentations with one tab and 4 spaces). > >> 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# s= tyle > at line 5219: > > (c-add-style "C#" =C2=A0... Same version here, still that's the error message. Kind Regards, Guido -- Put a pot of chili on the stove to simmer. Let it simmer. Meanwhile, broil a good steak. Eat the steak. Let the chili simmer. Ignore it. -- Recipe for chili from Allan Shrivers, former governor of Texas. http://vanhoecke.org ... and go2 places!