[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Replacing custom-set-variables
From: |
Nikolaj Schumacher |
Subject: |
Re: Replacing custom-set-variables |
Date: |
Sun, 14 Sep 2008 23:30:27 +0200 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.2.50 (darwin) |
Tim X <timx@nospam.dev.null> wrote:
> Giorgos Keramidas <keramida@ceid.upatras.gr> writes:
>
> Be careful using setq-default in .emacs. The difference between setq and
> setq-default is that if the variable is already bound to a value,
> setq-default does nothing.
I think that is not quite correct. `setq-default' never does
"nothing". It only leaves values untouched for buffers that have a
local value for the variable.
> This is not to say that setq-default should not be used. To a large
> extent its a matter of taste/style. I just wanted to emphasise the
> differences between the two.
The difference is important mostly for variables that become
buffer-local automatically, like `tab-width'. There's only two ways to
set them in your .emacs: Either with hooks or with `setq-default'.
For all other variables, `setq' and `setq-default' are identical.
regards,
Nikolaj Schumacher