mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-01 01:41:01 -08:00
(package-activate-all): Be more robust when quickstart fails
Quickstart can fail in all kinds of ways, for example if a package was removed without updating the quickstart file. * lisp/emacs-lisp/package.el (package-activate-all): Revert to the slow path if the quickstart signals an error. (package--activate-all): Fix compilation warning without an autoload.
This commit is contained in:
parent
1f1dbfc6e8
commit
4f0239d814
1 changed files with 14 additions and 11 deletions
|
|
@ -1720,18 +1720,21 @@ The variable `package-load-list' controls which packages to load."
|
||||||
package-quickstart-file))))
|
package-quickstart-file))))
|
||||||
;; The quickstart file presumes that it has a blank slate,
|
;; The quickstart file presumes that it has a blank slate,
|
||||||
;; so don't use it if we already activated some packages.
|
;; so don't use it if we already activated some packages.
|
||||||
(if (and qs (not (bound-and-true-p package-activated-list)))
|
(or (and qs (not (bound-and-true-p package-activated-list))
|
||||||
;; Skip load-source-file-function which would slow us down by a factor
|
;; Skip `load-source-file-function' which would slow us down by
|
||||||
;; 2 when loading the .el file (this assumes we were careful to
|
;; a factor 2 when loading the .el file (this assumes we were
|
||||||
;; save this file so it doesn't need any decoding).
|
;; careful to save this file so it doesn't need any decoding).
|
||||||
(let ((load-source-file-function nil))
|
(with-demoted-errors "Error during quickstart: %S"
|
||||||
(unless (boundp 'package-activated-list)
|
(let ((load-source-file-function nil))
|
||||||
(setq package-activated-list nil))
|
(unless (boundp 'package-activated-list)
|
||||||
(load qs nil 'nomessage))
|
(setq package-activated-list nil))
|
||||||
(require 'package)
|
(load qs nil 'nomessage)
|
||||||
(package--activate-all)))))
|
t)))
|
||||||
|
(progn
|
||||||
|
(require 'package)
|
||||||
|
(declare-function package--activate-all "package" ())
|
||||||
|
(package--activate-all))))))
|
||||||
|
|
||||||
;;;###autoload
|
|
||||||
(defun package--activate-all ()
|
(defun package--activate-all ()
|
||||||
(dolist (elt (package--alist))
|
(dolist (elt (package--alist))
|
||||||
(condition-case err
|
(condition-case err
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue