[Top][All Lists]

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

Re: Calling (package-initialize) sooner during initialization

From: Thierry Volpiatto
Subject: Re: Calling (package-initialize) sooner during initialization
Date: Tue, 31 Mar 2015 16:03:30 +0200

Thierry Volpiatto <address@hidden> writes:

> Thierry Volpiatto <address@hidden> writes:
>> Stefan Monnier <address@hidden> writes:
>>>>> Stefan kindly explains why it can't just be done before loading the init 
>>>>> file:
>>>>>> [...] the user may need/want to run some Elisp
>>>>>> code of his own choosing *before* package-initialize is called.
>>>>>> E.g. [...] set package-load-list and package-directory-list
>>>> Why not adding a set function to these vars calling
>>>> `package-initialize', so if one set these functions AFTER a
>>>> `package-initialize' call `package-initialize' will be called again.
>>>> Of course these vars have to be set with customize, not setq.
>>> The default of package-load-list is to enable everything, so the main
>>> use for package-load-list is to *prevent* initialization of
>>> some packages.
>>> IOW, the "setter" would have to *undo* some initializations, which is
>>> can't be done reliably.
>> IIUC `package-load-list' once set with 'all (the default) can't be
>> changed to something else (not all packages) after running
>> `package-initialize' (i.e it can't unload the already loaded packages)
>> unless restarting emacs.
>> There is something wrong here IMHO.
> Maybe `package-load-list' should have a nil default value instead of all
> and once package-initialize run, it could set it to 'all if it don't
> find a customized value.
> This with not help the real time setting of this var (no way to unload), 
> but may solve the problem at startup.

Seems it is working fine with this:

1) default value of package-load-list => nil
2) customize yourself package-load-list e.g => ' (all)
3) Add at beginning of package-initialize someting like:
    (unless package-load-list
       (setq package-load-list '(all)))

When starting emacs the value of package-load-list before calling
package-initialize is '(all).

Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 

reply via email to

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