From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Only signal package.el warnings when needed Date: Mon, 14 Jan 2019 14:55:31 -0500 Message-ID: References: NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: blaine.gmane.org 1547495656 27536 195.159.176.226 (14 Jan 2019 19:54:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 14 Jan 2019 19:54:16 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Jan 14 20:54:11 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gj8JE-0006zG-N3 for ged-emacs-devel@m.gmane.org; Mon, 14 Jan 2019 20:54:08 +0100 Original-Received: from localhost ([127.0.0.1]:37463 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj8LL-0004ZF-TB for ged-emacs-devel@m.gmane.org; Mon, 14 Jan 2019 14:56:19 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:52145) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gj8Ko-0004Z3-GZ for emacs-devel@gnu.org; Mon, 14 Jan 2019 14:55:47 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gj8Km-0004P9-MP for emacs-devel@gnu.org; Mon, 14 Jan 2019 14:55:46 -0500 Original-Received: from [195.159.176.226] (port=36391 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gj8Km-0004NQ-FI for emacs-devel@gnu.org; Mon, 14 Jan 2019 14:55:44 -0500 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1gj8IY-000644-K8 for emacs-devel@gnu.org; Mon, 14 Jan 2019 20:53:26 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 46 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:b9aRZpEgbA/sVb7y2rb9BW9zq+Y= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:232344 Archived-At: > In January 2018, we added support for an early init-file to Emacs 27, > and adjusted Emacs startup to invoke `package-initialize' before > loading the standard init-file (but after loading the early > init-file). Actually, the startup code calls package-activate-all. Currently, this ends up calling package-initialize but I think it's a mistake: package-initialize does two things (activate all packages, and load the information about the various packages available in ELPA archives) and only one of the two (the activation of all packages) should be done at that point. I think we should install a patch like the one below to deal with this. It will reduce the number of variables that need to be set in early-init.el, and will avoid problems where some packages end up appearing incorrectly as new (because package-initialize at startup didn't know about some ELPA archive, so when we "refresh" the contents, all the packages in that archive are suddenly considered to be new). > However, it is easy to address this complication: simply keep track of > the values of these user options. If one or more of them has changed > since the last time `package-initialize' was invoked, then perform the > initialization a second time (and signal a warning). Agreed (tho I wouldn't even emit a warning in that case). Stefan diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index cf39fa2896..b8242e58f6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1492,8 +1492,8 @@ package-activate-all ;; any decoding). (let ((load-source-file-function nil)) (load package-quickstart-file)) - (unless package--initialized - (package-initialize t)) + (unless package-alist + (package-load-all-descriptors)) (dolist (elt package-alist) (condition-case err (package-activate (car elt))