help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: death to tabs


From: Benjamin Rutt
Subject: Re: death to tabs
Date: Sat, 05 Apr 2003 11:35:25 -0500
User-agent: Gnus/5.090008 (Oort Gnus v0.08) Emacs/21.3.50 (sparc-sun-solaris2.8)

Roy Smith <roy@panix.com> writes:

> 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.

Yes, I think both setting the global default and setting it as you
wish per-mode is the right way to approach this problem.  Each major
mode is free to override the default.  Having the default set to nil,
however, probably means that you'll have to use hooks like the above
less often.  Just watch out for Makefiles which require leading TABs,
as another poster mentioned.
-- 
Benjamin


reply via email to

[Prev in Thread] Current Thread [Next in Thread]