[Top][All Lists]

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

Re: defvar vs setqif..

From: Thien-Thi Nguyen
Subject: Re: defvar vs setqif..
Date: 20 May 2002 15:41:16 -0400

"D. Goel" <address@hidden> writes:

   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..

there's a better way to do this: use `eval-after-load'.  for example:

  ;; not recommended: using "forward declarations"
  (defvar foo)  ; from foo-package
  (munge foo)

  ;; recommended: delaying evaluation until after some package is loaded
  (eval-after-load "foo-package"
    '(munge foo))

note that the form needs to be quoted unless its evaluation is to return the
actual form to be evaluated (after/when foo-package is loaded).


reply via email to

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