[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
Guido Van Hoecke
Re: (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error?
Wed, 11 Jan 2012 16:22:52 +0100
On Wed, Jan 11, 2012 at 15:26, Óscar Fuentes <email@example.com> wrote:
> Guido Van Hoecke <firstname.lastname@example.org> 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
>>>> 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.
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# mode.
"And what will you do when you grow up to be as big as me?"
asked the father of his little son.
http://vanhoecke.org ... and go2 places!