[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 15:26:03 +0100 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux) |
Guido Van Hoecke <guivho@gmail.com> 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.