[Top][All Lists]

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

Re: defvar vs setqif..

From: D. Goel
Subject: Re: defvar vs setqif..
Date: 20 May 2002 15:08:00 -0400
User-agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.1

> On Sun, 2002-05-19 at 16:44, D. Goel wrote:
> > An example: my .emacs needs to, say, (add-hook 'foo-mode-hook... ),
> > but the hook may not be defined, so i (defvar foo-mode-hook) before
> > this statement. 
> Why do you defvar it?  The best solution is to (require 'foo-mode)
> before adding the hook. 

true i guess, but not always carried out... that's why the issue
arises in the first place..   One reason it is not always carried out

say a user wants to frob a thousand variables in their .emacs or their
own private library...  they don't want to (require) all the involved
libraries, thus slowing down the loading of emacs.. so the user simply
make sures the variables are defined via defvar, and then runs
(add-to-list) or whatever on these variables..

authors who may do similar stuff in their libraries may have the same
reason---not wanting to slow down the loading by (requiring 'stuff).
So they may defvar variables of that libaray...

> But `add-hook' won't lose if the hook isn't bound yet.

yeah very true.. bad example, sorry :).. how about (add-to-list) ?  :)

D                                  <http://www.glue.umd.edu/~deego/>

reply via email to

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