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

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

Re: Trying to use only tabs for indenting c# files - csharp-mode error?


From: Óscar Fuentes
Subject: Re: Trying to use only tabs for indenting c# files - csharp-mode error?
Date: Sun, 08 Jan 2012 20:06:42 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

Guido Van Hoecke <guivho@gmail.com> writes:

[snip]

> namespace Application
> {
> ==public class MyClass
> =={
> ====public string MyString;
> ====public MyClass ()
> ===={
> ====}
> ==}
> }
>
> So obviously neither tab-width nor indent-tabs-mode are obeyed nor
> respected!

All your examples here makes me think that csharp-mode is indenting by
two spaces per level. As PJ says, tabs will not be used unless the line
is preceded by `tab-width' spaces (8 in your case). If you set tab-width
to 4, I expect to see tabs used for the most deeply indented lines on
the example quoted above.

Put this in your .emacs and see if it makes a difference:

(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)



reply via email to

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