* Emacs BSD/Allman Style with 4 Space Tabs?
@ 2012-11-01 2:15 hany
2012-11-02 0:21 ` Will Parsons
0 siblings, 1 reply; 2+ messages in thread
From: hany @ 2012-11-01 2:15 UTC (permalink / raw)
To: help-gnu-emacs
Using this emacs lisp setting one ends up with BSD/Allman style braces but introduces tabs with 8 spaces.
(add-hook 'c-mode-hook
(lambda ()
(c-set-style "linux")))
How do I keep the Allman style braces but keep the tab spaces at 4?
Thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: Emacs BSD/Allman Style with 4 Space Tabs?
2012-11-01 2:15 Emacs BSD/Allman Style with 4 Space Tabs? hany
@ 2012-11-02 0:21 ` Will Parsons
0 siblings, 0 replies; 2+ messages in thread
From: Will Parsons @ 2012-11-02 0:21 UTC (permalink / raw)
To: help-gnu-emacs
hany wrote:
> Using this emacs lisp setting one ends up with BSD/Allman style braces but introduces tabs with 8 spaces.
>
> (add-hook 'c-mode-hook
> (lambda ()
> (c-set-style "linux")))
>
> How do I keep the Allman style braces but keep the tab spaces at 4?
For keeping the indentation at 4 spaces, I think all you should need
to do is stick into your c-mode-hook:
(setq c-basic-offset 4)
That's what I have, though I use "ellemtel" style rather than "linux" style.
However, you refer to "tabs" rather than "indentation", so perhaps I
misunderstand. If you are using tabs (i.e., ASCII <tab> characters),
I would strongly urge you to avoid using tab characters for the
purposes of indentation altogether. Using tab characters for the
purposes of indentation causes infinite grief (IMO), and I would
advise you to stick:
(setq-default indent-tabs-mode nil)
into your .emacs file.
--
Will
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2012-11-02 0:21 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-11-01 2:15 Emacs BSD/Allman Style with 4 Space Tabs? hany
2012-11-02 0:21 ` Will Parsons
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).