all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error?
@ 2012-01-11  9:34 Alan Mackenzie
  2012-01-11 12:38 ` Guido Van Hoecke
  0 siblings, 1 reply; 6+ messages in thread
From: Alan Mackenzie @ 2012-01-11  9:34 UTC (permalink / raw)
  To: help-gnu-emacs

-- forwarded message --
Path: news.muc.de!not-for-mail
From: Alan Mackenzie <acm@muc.de>
Newsgroups: gnu.emacs.help
Subject: Re: Trying to use only tabs for indenting c# files - csharp-mode error?
Date: Mon, 9 Jan 2012 09:46:45 +0000 (UTC)
Organization: muc.de e.V.
Lines: 115
Message-ID: <jeed25$rk8$1@colin.muc.de>
References: <mailman.1451.1326027725.15002.help-gnu-emacs@gnu.org>
NNTP-Posting-Host: news.muc.de
X-Trace: colin.muc.de 1326102405 28296 193.149.48.2 (9 Jan 2012 09:46:45 GMT)
X-Complaints-To: news-admin@muc.de
NNTP-Posting-Date: Mon, 9 Jan 2012 09:46:45 +0000 (UTC)
User-Agent: tin/1.9.6-20101126 ("Burnside") (UNIX) (FreeBSD/8.2-STABLE (amd64))
Xref: news.muc.de gnu.emacs.help:183926

Guido Van Hoecke <guivho@gmail.com> wrote:
> Hi,

> Objective: use only tabs for indenting c# files

[ .... ]

> Ultimately, I want the tab-width set to 4, but for now I just want to
> leave or set it to 8:

>        M-x set-variable [enter] tab-width [enter] 8 [enter]

> I will use following legend when showing file content:
> # represents a leading tab
> + represents a leading empty space (following a preceding tab)
> = represents a leading space character

> Here's the source file:

> namespace Application
> {
> #+++++++public class MyClass
> #+++++++{
> #+++++++#+++++++public MyClass ()
> #+++++++#+++++++{
> #+++++++#+++++++}
> #+++++++}
> }

> Deleting the first tab changes it to:

> namespace Application
> {
> =======public class MyClass
> #+++++++{
> #+++++++#+++++++public MyClass ()
> #+++++++#+++++++{
> #+++++++#+++++++}
> #+++++++}
> }

> Hitting tab key while point is the 'public class' line changes it to:

> namespace Application
> {
> ==public class MyClass
> #+++++++{
> #+++++++#+++++++public MyClass ()
> #+++++++#+++++++{
> #+++++++#+++++++}
> #+++++++}
> }

> I can't help but feeling that this is in error!

> The tab-width is 8,
> indent-tabs-mode is t
> and still, it uses spaces to indent, and only two of them.

You have told it to use a tab instead of 8 spaces.  You haven't told
it how far to indent, though.

[ .... ]

> And finally"

>        M-<
>        C-SPC
>        M->
>        <tab>

> produces following result:


> namespace Application
> {
> ==public class MyClass
> =={
> ====public string MyString;
> ====public MyClass ()
> ===={
> ====}
> ==}
> }

> 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.  :-)
However, for your specific problem, the variable c-basic-offset needs
to be set to 8.  Currently, it looks like it is 2.

> ;;; csharp-mode.el --- C# mode derived mode
> 
> ;; Author     : Dylan R. E. Moonfire (original)
> ;; Maintainer : Dino Chiesa <dpchiesa@hotmail.com>
> ;; Created    : Feburary 2005
> ;; Modified   : May 2011
> ;; Version    : 0.8.6
> ;; Keywords   : c# languages oop mode
> ;; X-URL      : http://code.google.com/p/csharpmode/
> ;; Last-saved : <2011-May-21 20:28:30>

Perhaps you could contact Dino Chiesa and ask him to include "CC Mode"
(with that capitalisation, please) somewhere in that information.

> TIA,


> Guido

-- 
Alan Mackenzie (Nuremberg, Germany).
-- end of forwarded message --



^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2012-01-11 20:04 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-11  9:34 (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error? Alan Mackenzie
2012-01-11 12:38 ` Guido Van Hoecke
2012-01-11 14:26   ` Óscar Fuentes
2012-01-11 15:22     ` Guido Van Hoecke
2012-01-11 17:42       ` Óscar Fuentes
2012-01-11 20:04         ` 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.