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

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

Re: 'initial-major-mode interaction with 'major-mode


From: Cecil Westerhof
Subject: Re: 'initial-major-mode interaction with 'major-mode
Date: Wed, 08 Dec 2010 15:09:11 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux)

Op donderdag 20 mei 2010 11:44 CEST schreef Lars Wessman:

> Just for curiosity's sake, why was the decision made to create a
> separate function for defining defaults (assuming that is what setq-
> default does without having checked the code)? What is gained by
> departing from the simplicity of just using setq? Again, I'm not
> challenging the change, just interested in the reasoning behind it
> because I like to know how architectural decisions are justified in
> general.

With setq you set the value in the current buffer (if it is not a global
value). With setq-default  you make the value you set  the value for all
the buffers you do not explicitly set it. So that could change the value
in for example ten buffers instead of only the current one.

There is  a little caveat. If you  already set the value  in the current
buffer and then use setq-default  the value changes in the buffers where
it was not set, but not in the current buffer.

-- 
Cecil Westerhof
Senior Software Engineer
LinkedIn: http://www.linkedin.com/in/cecilwesterhof


reply via email to

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