From: Zachary Kanfer <zkanfer@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: 31397@debbugs.gnu.org, radon.neon@gmail.com, npostavs@gmail.com
Subject: bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no elpa directory
Date: Mon, 6 Aug 2018 19:41:18 -0400 [thread overview]
Message-ID: <CAFXT+RNce94CLZDU=VY2KQ7WSeXw2AOC_wz+n9wYr3SqB87HNw@mail.gmail.com> (raw)
In-Reply-To: <jwvh8mq5aym.fsf-monnier+bug#31397@gnu.org>
[-- Attachment #1: Type: text/plain, Size: 1595 bytes --]
I'm circling back around to this; I think that that change makes a lot of
sense. It seems better to me -- if you're calling one of these package
functions, you probably want to work with the package system, which is only
properly set up when you call package-initialize.
What other functions would need to call package-initialize, if it hasn't
been called? I notice that package-install already does that. Some other
functions for installing don't
(package-install-from-archive, package-install-from-buffer), but I'm not
sure whether they need to.
On Tue, May 29, 2018 at 6:58 PM, Stefan Monnier <monnier@iro.umontreal.ca>
wrote:
> >> 1. Make `package-installed-p' and other functions automatically
> >> initialize package.el if necessary.
>
> Yes, when I changed it recently I hesitated to do that and decided to
> refrain from doing so in order to minimize the changes, but it makes
> a lot of sense.
>
>
> Stefan
>
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 94d98178c4..56be5ef70c 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -1889,8 +1889,8 @@ package-installed-p
> ;; We used the quickstart: make it possible to use package-installed-p
> ;; even before package is fully initialized.
> (memq package package-activated-list))
> - ((not package--initialized) (error "package.el is not yet
> initialized!"))
> (t
> + (unless package--initialized (package-initialize 'no-activate))
> (or
> (let ((pkg-descs (cdr (assq package package-alist))))
> (and pkg-descs
>
[-- Attachment #2: Type: text/html, Size: 2094 bytes --]
next prev parent reply other threads:[~2018-08-06 23:41 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-10 5:17 bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no elpa directory Zachary Kanfer
2018-05-29 2:41 ` bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no Zachary Kanfer
2018-05-29 11:52 ` bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no elpa directory Noam Postavsky
2018-05-29 16:13 ` Radon Rosborough
2018-05-29 22:40 ` Noam Postavsky
2018-05-29 22:58 ` Stefan Monnier
2018-08-06 23:41 ` Zachary Kanfer [this message]
2019-01-22 23:12 ` Stefan Monnier
2019-11-04 20:01 ` Stefan Kangas
2019-11-04 22:57 ` 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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAFXT+RNce94CLZDU=VY2KQ7WSeXw2AOC_wz+n9wYr3SqB87HNw@mail.gmail.com' \
--to=zkanfer@gmail.com \
--cc=31397@debbugs.gnu.org \
--cc=monnier@iro.umontreal.ca \
--cc=npostavs@gmail.com \
--cc=radon.neon@gmail.com \
/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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.