[Top][All Lists]

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

Re: Indentation setting for C-Sharp files.

From: Óscar Fuentes
Subject: Re: Indentation setting for C-Sharp files.
Date: Sat, 07 Jan 2012 21:03:31 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.91 (gnu/linux)

Guido Van Hoecke <> writes:

>>> Is there a way to force emacs to only use tabs for indentation? And such
>>> a setting exists, could it also define the tab width to 4, but still use
>>> tabs (so three tabs at the start of the line would be displayed as 12
>>> whitespace columns)?
>> See the variables tab-width and indent-tabs-mode.
> My tab-width is 8 and indent-tabs-mode is t, also in my C# buffers, but
> that does not cause the expected behaviour.

It does for me. After visiting a .cs file (this activates csharp-mode on
my setup):

M-x set-variable [enter] tab-width [enter] 4 [enter]
M-x set-variable [enter] indent-tabs-mode [enter] t [enter]

now the lines I insert use 4 column wide tabs for indenting.

Please note that you must set those variables *after* visiting the file
you want to edit, because they become buffer-local (associated with the
current buffer) as soon as you change their value. Usually that's done
with a mode hook, but for experimenting the manual method described
above should work.

reply via email to

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