emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] master 6b6cc56: Don't call package--ensure-init-file if in


From: Noam Postavsky
Subject: [Emacs-diffs] master 6b6cc56: Don't call package--ensure-init-file if initialized during startup
Date: Sun, 26 Feb 2017 11:15:55 -0500 (EST)

branch: master
commit 6b6cc56e728a4d8b5ccac86ac393be7cd29207e2
Author: Noam Postavsky <address@hidden>
Commit: Noam Postavsky <address@hidden>

    Don't call package--ensure-init-file if initialized during startup
    
    * lisp/emacs-lisp/package.el (package-initialize): Check
    `after-init-time' rather than `load-file-name' to decide if
    `package--ensure-init-file' should be called.  Depending on
    `load-file-name' will fail if the user calls `pacakge-initialize' in
    file which is loaded from the init file (Bug#24643, Bug#25819).
---
 lisp/emacs-lisp/package.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index 6728f1b..8d5fac9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1445,13 +1445,13 @@ individual packages after calling `package-initialize' 
-- this is
 taken care of by `package-initialize'."
   (interactive)
   (setq package-alist nil)
-  (if (equal user-init-file load-file-name)
-      ;; If `package-initialize' is being called as part of loading
-      ;; the init file, it's obvious we don't need to ensure-init.
-      (setq package--init-file-ensured t
-            ;; And likely we don't need to run it again after init.
-            package-enable-at-startup nil)
-    (package--ensure-init-file))
+  (if after-init-time
+      (package--ensure-init-file)
+    ;; If `package-initialize' is before we finished loading the init
+    ;; file, it's obvious we don't need to ensure-init.
+    (setq package--init-file-ensured t
+          ;; And likely we don't need to run it again after init.
+          package-enable-at-startup nil))
   (package-load-all-descriptors)
   (package-read-all-archive-contents)
   (unless no-activate



reply via email to

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