emacs-devel
[Top][All Lists]
Advanced

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

Re: Semantics of autoload cookies on defcustoms


From: Stefan Monnier
Subject: Re: Semantics of autoload cookies on defcustoms
Date: Fri, 07 Jul 2006 10:08:36 -0400
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.0.50 (gnu/linux)

>     What is the intended effect of adding an autoload cookie on a defcustom?
> It puts a defvar and the custom-autoload call into loaddefs.

Yes, I saw that this is the actual behavior in autoload.el.
I was expecting a description of the intention behind this actual behavior.

>     I ask this question because I recently noticed that setting variables such
>     as diary-file via custom causes calendar.el to be loaded at startup, even
>     tho I can't see any reason why such a setting would justify eagerly 
> loading
>     calendar.el.

> There was a reason for this, and I used to know it, but I have
> forgotten.

> In order to process the specified value, custom needs the defcustom
> info.

That's sometimes the case, but I can't see why it would be the case for
diary-file.  E.g. I understand the need for custom-autoload if the defcustom
has a :setter but for a plain defcustom such as diary-file it doesn't seem
to make much sense.

> So there are two options:

> 1. Save the value away and process it if/when the defcustom is loaded.
> 2. Load the defcustom now, and process the value right away.

> #1 is the usual method.  That is fine for variables that aren't really
> defined at all until the package is loaded.

> But when a variable is autoloaded, that means its value is meaningful
> already, and it could be used at any time.  So there is no correct
> alternative except #2.

So if I understand correctly, you're saying that diary-file should simply
not have an autoload cookie?


        Stefan




reply via email to

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