unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Stefan Monnier <monnier@iro.umontreal.ca>
To: emacs-devel@gnu.org
Subject: Re: [PATCH] Only signal package.el warnings when needed
Date: Mon, 14 Jan 2019 14:55:31 -0500	[thread overview]
Message-ID: <jwvsgxvghnz.fsf-monnier+emacs@gnu.org> (raw)
In-Reply-To: CADB4rJGzUV76zBRLqViO_cLKEk5WkfbCsCSKoPBtxDSQmJovog@mail.gmail.com

> 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))




  parent reply	other threads:[~2019-01-14 19:55 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-14  4:17 [PATCH] Only signal package.el warnings when needed Radon Rosborough
2019-01-14 15:48 ` Eli Zaretskii
2019-01-14 16:10   ` Robert Pluim
2019-01-14 16:39     ` Eli Zaretskii
2019-01-14 16:48       ` Robert Pluim
2019-01-14 20:14     ` Stefan Monnier
2019-01-14 21:46     ` Radon Rosborough
2019-01-14 21:46   ` Radon Rosborough
2019-01-15 17:18     ` Eli Zaretskii
2019-01-15 18:43       ` Radon Rosborough
2019-01-15 19:26         ` Eli Zaretskii
2019-01-21 22:45           ` Radon Rosborough
2019-01-22 17:29             ` Eli Zaretskii
2019-01-23  4:06               ` Radon Rosborough
2019-01-23 15:34                 ` Eli Zaretskii
2019-01-23 16:00                   ` Stefan Monnier
2019-01-23 17:28                   ` Radon Rosborough
2019-01-14 22:13   ` Óscar Fuentes
2019-01-14 22:59     ` Clément Pit-Claudel
2019-01-15 10:39       ` João Távora
2019-01-15 17:15         ` Eli Zaretskii
2019-01-15 17:24           ` João Távora
2019-01-14 19:55 ` Stefan Monnier [this message]
2019-01-14 20:19   ` Stefan Monnier

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=jwvsgxvghnz.fsf-monnier+emacs@gnu.org \
    --to=monnier@iro.umontreal.ca \
    --cc=emacs-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).