emacs-devel
[Top][All Lists]
Advanced

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

Re: Friendly discussion about (package-initialize)


From: Stefan Monnier
Subject: Re: Friendly discussion about (package-initialize)
Date: Sun, 06 Aug 2017 21:39:41 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux)

> Sure, I think it's reasonable for Emacs to provide special support for
> packages which are built in. But there's such a thing as going too
> far.  And I personally think that you've gone too far in providing
> special support when that support actively makes it *more* difficult
> to swap out an alternative implementation.

You wrote lots and lots of lines of text just to complain about the
addition of a single "(package-initialize)" in the user's ~/.emacs,
which should do absolutely nothing in the case where the user doesn't
use package.el (i.e. doesn't have anything inside ~/.emacs.d/elpa).

So, it's not that big of a deal, really.

We could arrange for "(package-initialize)" to only be added if there is
at least one package inside ~/.emacs.d/elpa.

More to the point, I think that's already the case.  So users of other
package managers should simply never bump into this text (unless they
also user package.el, of course).  If they do, they should report it as
a bug.

> * Make it trivial to disable package.el. Right now, the only foolproof
>   way to prevent the init-file from being modified by package.el is to
>   place multiple advices on internal functions, and to do this as

Multiple?  Doesn't

    (advice-add 'package--ensure-init-file :override #'ignore)

do the trick?

I suspect that

    (setq package-enable-at-startup nil)

might also do the trick.

This said, the main motivation for calling package--ensure-init-file
from package-initialize was to fix existing user's config where they had
packages installed yet their .emacs didn't call package-initialize, so
they had trouble configuring their packages.  One might argue that this
situation is now mostly fixed and we could change tactic: only call
package--ensure-init-file when the user installs a package.

Another thing is that rather then look for "(package-initialize)" in
~/.emacs we could keep track of whether package-initialize was called
during initialization.  This will avoid the problem when the user placed
his call in another file.


        Stefan


PS: BTW, I'd be very interested to work with maintainers of other
package managers to see how we could make them better interoperate
(e.g. make it possible to install with one tool, but activate&config
with another).




reply via email to

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