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:
parent
f1a00054b1
commit
6f0586ef52
1 changed files with 8 additions and 3 deletions
|
|
@ -434,9 +434,14 @@ manually updated package."
|
||||||
(concat ":ensure wants an optional package name "
|
(concat ":ensure wants an optional package name "
|
||||||
"(an unquoted symbol name)")))))))
|
"(an unquoted symbol name)")))))))
|
||||||
|
|
||||||
(defun use-package-ensure-elpa (package)
|
(defun use-package-ensure-elpa (package &optional no-refresh)
|
||||||
(when (not (package-installed-p package))
|
(if (package-installed-p package)
|
||||||
(package-install 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)
|
(defun use-package-handler/:ensure (name-symbol keyword ensure rest state)
|
||||||
(let ((body (use-package-process-keywords name-symbol rest state)))
|
(let ((body (use-package-process-keywords name-symbol rest state)))
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue