[Top][All Lists]

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

Re: defcustom: changing from defvar - order of execution

From: Stefan Monnier
Subject: Re: defcustom: changing from defvar - order of execution
Date: Wed, 04 May 2005 11:03:26 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     Second setup - library foo.el has this:

>      (defcustom foovar nil)
>      (defun foo-fn () foovar)

>     Second setup - user has this in .emacs, after customizing
>     foovar to `t' with Customize:

>      (load-library "foo")
>      (foo-fn)
>      ...
>      (custom-set-variables '(foovar t)...)

>     When .emacs is loaded, (foo-fn) is executed, foovar is (has
>     default value) `nil', so (foo-fn) returns `nil'.

You're comparing two different elisp package code and two different .emacs
code.  Try to separate those two cases; it will help you understand
the problem.

E.g. changing the elisp package to use defcustom, but without the user
changing her .emacs will not result in any problem.

The problem comes when the user replaces her "setq at the beginning" with
a "custom-set-var at the end".

It's only weakly related to the use of custom since the same behavior
appears if you move the setq, or if you move the custom-set-var.


reply via email to

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