Subject: bug#21423: closed (Re: bug#21423: 24.5; (package-initialize) added to init.el without (setq package-enable-at-startup nil))

From: [email-masked] (GNU bug Tracking System)
Date: Mon, 07 Sep 2015 10:27:02 +0000

Your bug report

#21423: 24.5; (package-initialize) added to init.el without (setq package-enable-at-startup nil)

which was filed against the emacs package, has been closed.

The explanation is attached below, along with your original report.
If you require more details, please reply to [email-masked].

-- 
21423: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=21423
GNU Bug Tracking System
Contact [email-masked] with problems

Subject: Re: bug#21423: 24.5; (package-initialize) added to init.el without (setq package-enable-at-startup nil)
From: Artur Malabarba <[email-masked]>
To: [email-masked]
Date: Mon, 7 Sep 2015 11:26:38 +0100
List-Id: <debbugs-submit.debbugs.gnu.org>

Pushed the patch above plus some documentation in the NEWS and the manual.

2015-09-06 23:33 GMT+01:00 Stefan Monnier <[email-masked]>:
>>> That said, this change would seem to be an issue for anyone who is
>>> performing a partial initialisation in their init file (for specific
>>> packages), and then depending on the default initialisation to deal
>>> with the remainder, post-init.
>>>
>>> I can only imagine that's a very small proportion of users indeed,
>>> but I presume the scenario ought to be considered (even if only for
>>> the purposes of documenting it in NEWS).
>
>> Yes, they'll have to add (setq package-enable-at-startup t) after
>> calling initialize. That should definitely go in the NEWS.
>
> I have a hard time imagining many users doing that.  As a user, if I'm
> picky enough to try and do a partial initialization in my init file,
> I'll probably also want to do the final full initialization explicitly
> in my init file.

Now that it's pushed, I'm sure _someone_ will be affected by this and
will politely let us know. :)

Subject: 24.5; (package-initialize) added to init.el without (setq package-enable-at-startup nil)
From: Phil Sainty <[email-masked]>
To: [email-masked]
Date: Sun, 06 Sep 2015 23:01:08 +1200
List-Id: <debbugs-submit.debbugs.gnu.org>

package--ensure-init-file inserts (package-initialize) into the user's
init file, but it does not also insert (setq package-enable-at-startup nil),
which means that (according to (emacs) Package Installation) Emacs will
re-initialize the packages post-init:

 > In some circumstances, you may want to load packages explicitly in
 > your init file (usually because some other code in your init file
 > depends on a package).  In that case, your init file should call the
 > function ‘package-initialize’.  It is up to you to ensure that
 > relevant user options, such as ‘package-load-list’ (see below), are
 > set up prior to the ‘package-initialize’ call.  You should also set
 > ‘package-enable-at-startup’ to ‘nil’, to avoid loading the packages
 > again after processing the init file.

>From 297f2d5555ba0efb0afc3412f49d1c728ebb5700 Mon Sep 17 00:00:00 2001
From: Phil Sainty <[email-masked]>
Date: Sun, 6 Sep 2015 22:48:40 +1200
Subject: [PATCH] Disable package-enable-at-startup when forcing
 package-initialize

---
 lisp/emacs-lisp/package.el | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index d4a2f02..baa4ab6 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1856,6 +1856,7 @@ add a call to it along with some explanatory comments."
                ";; installed packages.  Don't delete this line.  If you don't want it,\n"
                ";; just comment it out by adding a semicolon to the start of the line.\n"
                ";; You may delete these explanatory comments.\n"
+               "(setq package-enable-at-startup nil)\n")
                "(package-initialize)\n")
               (unless (looking-at-p "$")
                 (insert "\n"))
-- 
2.1.0