* Indentation setting for C-Sharp files.
@ 2012-01-07 13:58 Guido Van Hoecke
2012-01-07 18:17 ` Óscar Fuentes
0 siblings, 1 reply; 5+ messages in thread
From: Guido Van Hoecke @ 2012-01-07 13:58 UTC (permalink / raw
To: help-gnu-emacs
Hi,
I am collaborating with some C# projects being developed partly on the
iMac with MonoDevelop and on Windows with Visual Studio. The Mono
environment is technical lead, so the other tools better follow its
indentation and space/tab rules.
The 'standard' in this MonoDevelop environment is to use tabs to do the
indentation, not spaces, and the 'display width' of the tab is set to 4.
The 'display width' is less important, but I'd like to tell emacs to use
only tabs to do the indentation. I've surfed the net and found lots of
places telling me how to achieve the opposite, i.e. using only spaces.
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)?
TIA,
Guido
--
If you put it off long enough, it might go away.
http://vanhoecke.org ... and go2 places!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Indentation setting for C-Sharp files.
2012-01-07 13:58 Indentation setting for C-Sharp files Guido Van Hoecke
@ 2012-01-07 18:17 ` Óscar Fuentes
2012-01-07 19:04 ` Guido Van Hoecke
0 siblings, 1 reply; 5+ messages in thread
From: Óscar Fuentes @ 2012-01-07 18:17 UTC (permalink / raw
To: Guido Van Hoecke; +Cc: help-gnu-emacs
Guido Van Hoecke <guivho@gmail.com> writes:
[snip]
> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Indentation setting for C-Sharp files.
2012-01-07 18:17 ` Óscar Fuentes
@ 2012-01-07 19:04 ` Guido Van Hoecke
2012-01-07 20:03 ` Óscar Fuentes
0 siblings, 1 reply; 5+ messages in thread
From: Guido Van Hoecke @ 2012-01-07 19:04 UTC (permalink / raw
To: Óscar Fuentes; +Cc: help-gnu-emacs
Hi Oscar
On Sat, Jan 7, 2012 at 19:17, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Guido Van Hoecke <guivho@gmail.com> writes:
>
> [snip]
>
>> 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.
Kind Regards,
Guido
--
All of the true things I am about to tell you are shameless lies.
-- The Book of Bokonon / Kurt Vonnegut Jr.
http://vanhoecke.org ... and go2 places!
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Indentation setting for C-Sharp files.
2012-01-07 19:04 ` Guido Van Hoecke
@ 2012-01-07 20:03 ` Óscar Fuentes
2012-01-08 7:41 ` Guido Van Hoecke
0 siblings, 1 reply; 5+ messages in thread
From: Óscar Fuentes @ 2012-01-07 20:03 UTC (permalink / raw
To: Guido Van Hoecke; +Cc: help-gnu-emacs
Guido Van Hoecke <guivho@gmail.com> 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.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: Indentation setting for C-Sharp files.
2012-01-07 20:03 ` Óscar Fuentes
@ 2012-01-08 7:41 ` Guido Van Hoecke
0 siblings, 0 replies; 5+ messages in thread
From: Guido Van Hoecke @ 2012-01-08 7:41 UTC (permalink / raw
To: Óscar Fuentes; +Cc: help-gnu-emacs
Hi Óscar,
On Sat, Jan 7, 2012 at 21:03, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Guido Van Hoecke <guivho@gmail.com> 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.
>
This works in an 'emacs -q' session. So now I've seen that it can work,
I'll have to selectively disable parts of my setup until I find the
culprit.
Thanx for reminding me of the basics :)
Kind regards,
Guido
--
I've always felt sorry for people that don't drink -- remember,
when they wake up, that's as good as they're gonna feel all day!
http://vanhoecke.org ... and go2 places!
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2012-01-08 7:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-07 13:58 Indentation setting for C-Sharp files Guido Van Hoecke
2012-01-07 18:17 ` Óscar Fuentes
2012-01-07 19:04 ` Guido Van Hoecke
2012-01-07 20:03 ` Óscar Fuentes
2012-01-08 7:41 ` Guido Van Hoecke
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.