bug-gnu-emacs
[Top][All Lists]
Advanced

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

bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no


From: Stefan Monnier
Subject: bug#31397: 27.0.50; Emacs doesn't call package-initialize if there's no elpa directory
Date: Tue, 29 May 2018 18:58:42 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/27.0.50 (gnu/linux)

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





reply via email to

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