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

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

Re: Setting c-basic-offset equal to tab-width


From: Edward O'Connor
Subject: Re: Setting c-basic-offset equal to tab-width
Date: Wed, 07 Dec 2005 15:44:55 -0800
User-agent: Gnus/5.110004 (No Gnus v0.4) Emacs/22.0.50 (darwin)

> Is there a way of setting c-basic-offset to be identical to tab-width,
> so that whenever the latter is changed, the former changes too?

With Emacs from CVS, you could use `defvaralias' to accomplish this:

,----[ C-h f defvaralias RET ]
| defvaralias is a built-in function in `C source code'.
| (defvaralias NEW-ALIAS BASE-VARIABLE &optional DOCSTRING)
| 
| Make NEW-ALIAS a variable alias for symbol BASE-VARIABLE.
| Setting the value of NEW-ALIAS will subsequently set the value of 
BASE-VARIABLE,
|  and getting the value of NEW-ALIAS will return the value BASE-VARIABLE has.
| Third arg DOCSTRING, if non-nil, is documentation for NEW-ALIAS.  If it is
|  omitted or nil, NEW-ALIAS gets the documentation string of BASE-VARIABLE,
|  or of the variable at the end of the chain of aliases, if BASE-VARIABLE is
|  itself an alias.
| The return value is BASE-VARIABLE.
| 
| [back]
`----

So something like the following would do this (on CVS Emacs):

(defvaralias 'c-basic-offset 'tab-width)


HTH.
Ted

-- 
Edward O'Connor
hober0@gmail.com

Ense petit placidam sub libertate quietem.





reply via email to

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