From: Guido Van Hoecke <guivho@gmail.com>
To: "Óscar Fuentes" <ofv@wanadoo.es>
Cc: Alan Mackenzie <acm@muc.de>, help-gnu-emacs@gnu.org
Subject: Re: (fwd) Re: Trying to use only tabs for indenting c# files - csharp-mode error?
Date: Wed, 11 Jan 2012 21:04:39 +0100 [thread overview]
Message-ID: <CAEySM9G3f9FZix7LBhnirDK-X5p-M+2dpPcB_qJUpc6Jr-kONQ@mail.gmail.com> (raw)
In-Reply-To: <87lipem8zc.fsf@wanadoo.es>
Hi
On Wed, Jan 11, 2012 at 18:42, Óscar Fuentes <ofv@wanadoo.es> wrote:
> Guido Van Hoecke <guivho@gmail.com> writes:
>
>>>>> 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,
>
> No. The hook sets tab-width to 4 and the C# style indents by 4 columns,
> which was precisely what you wanted, IIRC.
Not really, the technical lead wants only indentation by means of tabs, and
they set the display width to 4. My understanding is that tab-width 4 would
lead to using spaces for the trailing 'odd' tab (e.g. create 3 indentations
with one tab and 4 spaces).
>
>> but on the other hand, emacs complains with "Undefined style: C#" when
>> entering c# mode.
>
> My version of csharp-mode.el is 0.8.6, from May 2011. It defines the C# style
> at line 5219:
>
> (c-add-style "C#" ...
Same version here, still that's the error message.
Kind Regards,
Guido
--
Put a pot of chili on the stove to simmer.
Let it simmer. Meanwhile, broil a good steak.
Eat the steak. Let the chili simmer. Ignore it.
-- Recipe for chili from Allan Shrivers, former governor
of Texas.
http://vanhoecke.org ... and go2 places!
prev parent reply other threads:[~2012-01-11 20:04 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=CAEySM9G3f9FZix7LBhnirDK-X5p-M+2dpPcB_qJUpc6Jr-kONQ@mail.gmail.com \
--to=guivho@gmail.com \
--cc=acm@muc.de \
--cc=help-gnu-emacs@gnu.org \
--cc=ofv@wanadoo.es \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.