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

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

Re: setq and setq-default


From: robert . thorpe
Subject: Re: setq and setq-default
Date: 13 Sep 2006 09:29:56 -0700
User-agent: G2/1.0

jronald wrote:
> I studied them for a while, but without details and examples.
>
> For example, what is the difference of the two below:
> (setq-default tab-width 8)

This is the general way to set the default value of a variable.  If you
put (setq-default foo 9) then in the context of every buffer you create
foo will be 9 unless the buffer has it's own value for that variable.

> (setq default-tab-width 8)

This means the same thing, except it is a mechanism specific to
tab-width, not all variables have a special "default" form associated
with them.  Only a handful have them, I don't know why, perhaps
setq-default didn't exist in very early Emacs.



reply via email to

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