[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: death to tabs
From: |
Roy Smith |
Subject: |
Re: death to tabs |
Date: |
Sat, 05 Apr 2003 08:50:08 -0500 |
User-agent: |
MT-NewsWatcher/3.3b1 (PPC Mac OS X) |
Benjamin Rutt <rutt+news@cis.ohio-state.edu> wrote:
> John Russell <jorussel@cisco.com> writes:
>
> > Ok, seriously, I don't ever want to see another tab as long as I
> > live. I want _every__ tab I ever wrote converted to spaces right
> > now and I never want to have a tab show up when I hit the TAB key
> > again. All spaces all the time.
> >
> > I found
> > (setq indent-tabs-mode nil)
>
> I think to set this globally, you actually want
>
> (setq-default indent-tabs-mode nil)
>
> in your ~/.emacs, since indent-tabs-mode is one of those variables
> which becomes buffer-local when set in any fashion.
I've had trouble getting the global default value to not be over-ridden
locally in each buffer. What I do now is set it in my C mode hook:
(add-hook 'c-mode-hook 'my-c-mode-hook t)
(add-hook 'c++-mode-hook 'my-c-mode-hook t)
(defun my-c-mode-hook ()
(c-set-style "linux")
(line-number-mode 1)
(setq indent-tabs-mode nil)
(setq c-basic-offset 4))
I'm not sure if this is the "right" way to do it, but it seems to do
what I want, so I'm happy.