[Top][All Lists]

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

Re: Customizable modes and package.el

From: David Reitter
Subject: Re: Customizable modes and package.el
Date: Sat, 7 Nov 2015 22:26:01 -0500

On Mar 30, 2015, at 1:28 PM, Stefan Monnier <address@hidden> wrote:
>>>> That's not an option, because the user may need/want to run some Elisp
>>>> code of his own choosing *before* package-initialize is called.
>>>> E.g. in my case, I need to set package-load-list and
>>>> package-directory-list before package-initialize runs.
>>> `package-initialize' could look into some file like
>>> ~/.emacs.d/package-init.el and load that before initializing.
>> Please, not Yet Another File That Changes Emacs' Behaviour
> Exactly.  So, for these reasons, "the solution" is to add
> "(package-initialize)" in the ~/.emacs file.

See also Bug#21858.

Adding (package-initialize) to a user-controlled file is ugly if it has the 
consequence that it breaks startup of any older Emacs on the system.  
Also, note that the action is not undoable from the menus, even though 
installing a package can be done via the menu.

Simple kludge:

(if (fboundp ‘package-initialize) (package-initialize))

But, reasonably:

Treat .emacs as something only the user changes.  `custom-file’ is what can be 
changed by Emacs. (But that one is loaded too late,  in this case.)

If packages are present, can’t (package-initialize) be called unconditionally 
before .emacs is loaded?   In response to Stefan Monnier’s message from 
3/30/2015, perhaps package-load-list and package-directory-list can be set 
elsewhere, or their functionality eliminated.   Or they could be set in .emacs 
with a new macro such as 

        (setq package-load-list …))

or even

(set-package-load-list XXX)
(set-package-directory-list YYY)

Even the ~/.emacs.d/package-init.el file proposed by Artur seems more 
reasonable than what is done now, and it wouldn’t require an extra pass over 
the user’s .emacs.

reply via email to

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