1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-06 06:20:55 -08:00

Refresh package.el archives if package is missing

This commit is contained in:
Thomas Frössman 2015-05-08 12:19:35 +02:00
parent f1a00054b1
commit 6f0586ef52

View file

@ -434,9 +434,14 @@ manually updated package."
(concat ":ensure wants an optional package name "
"(an unquoted symbol name)")))))))
(defun use-package-ensure-elpa (package)
(when (not (package-installed-p package))
(package-install package)))
(defun use-package-ensure-elpa (package &optional no-refresh)
(if (package-installed-p package)
t
(if (or (assoc package package-archive-contents) no-refresh)
(package-install package)
(progn
(package-refresh-contents)
(use-package-ensure-elpa package t)))))
(defun use-package-handler/:ensure (name-symbol keyword ensure rest state)
(let ((body (use-package-process-keywords name-symbol rest state)))