1
Fork 0
mirror of git://git.sv.gnu.org/emacs.git synced 2025-12-15 10:30:25 -08:00

Merge pull request from thomasf/master

Refresh package.el archives if package is missing.
GitHub-reference: https://github.com/jwiegley/use-package/issues/210
This commit is contained in:
John Wiegley 2015-06-22 12:44:34 -05:00
commit 269b1080ae

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