[Top][All Lists]

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

Re: Calling (package-initialize) sooner during initialization

From: Stefan Monnier
Subject: Re: Calling (package-initialize) sooner during initialization
Date: Tue, 31 Mar 2015 16:46:02 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

> So we could just require that a mode that is supposed to be enabled
> through customize also has a ':require' keyword for the corresponding
> feature.

The require will fail if executed before calling package-initialize.

> And for :require features the whole problem looks pretty simple to me:
>  Try to load the feature on 'set-custom-variables'.  If it fails
> remember the corresponding form somewhere (i.e. 'custom-delayed-vars'
> or whatever), and just try again after 'package-initialize'.  If it
> still fails, report an error.

Doesn't seem significantly simpler than adding (package-initialize) in
the ~/.emacs file.  Also the "lazy calling" of that function makes it
harder to figure out what's going on.

Also, the canonical way to handle minor modes is not to have them
use :require but to mark them as autoload.  In this case, Custom might
not even know that this var is a minor-mode until after
package-initialize is called, so if package-initialize is not called
early, then Custom may simply "do the wrong thing", oblivious to the
fact that it should have called a minor mode function instead of just
setting the variable.


reply via email to

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