help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mo


From: Óscar Fuentes
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
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

Guido Van Hoecke <guivho@gmail.com> 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 ()
>>  (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.
>
> 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#"
  ...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]