[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: default.el and site-start.el
From: |
David Masterson |
Subject: |
Re: default.el and site-start.el |
Date: |
07 Jul 2003 09:53:03 -0700 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.1 |
>>>>> Stefan Monnier writes:
>> Users should tend toward 'setq' in their .emacs while admins should
>> tend toward 'defvar' (or 'defcustom') in default.el. (CMIAW) defvar
>> doesn't override the value set by setq.
> Please avoid defvar to set a variable. `defvar' is used to declare
> a variable (and secondarily to provide a default value for it). If
> you misuse it like you recommend, you can end up confusing Emacs as
> to where a variable is defined, so things like C-h v <var> RET will
> not point to the proper file, M-x unload-feature will not do what it
> should, ...
Hmmmm. Interesting point. Does the same apply to defcustom? In
other words, is `setq' really the only thing users should use in their
init files (be it .emacs or default.el or site-start.el)? Is it
reasonable to use `setq-default' in default.el so that you don't have
to do special testing to see if the user set the variable in his
.emacs?
I think it's appropriate for the Emacs admin to use `defcustom' in
site-start.el to create *site* *specific* variables since it also
establishes documentation for them and, thus, makes them easier for
the users to understand. I used to use `defvar' for this in the early
days before customize.
--
David Masterson David DOT Masterson AT synopsys DOT com
Sr. R&D Engineer Synopsys, Inc.
Software Engineering Sunnyvale, CA