[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/leaf 1f51e90e99 01/28: On :package, save already instal
From: |
ELPA Syncer |
Subject: |
[elpa] externals/leaf 1f51e90e99 01/28: On :package, save already installed pkgs into selected-packages |
Date: |
Wed, 19 Jan 2022 18:58:33 -0500 (EST) |
branch: externals/leaf
commit 1f51e90e99283e733c59c49cecb7d5db8c0d0833
Author: Genki Sato <13384803+gksato@users.noreply.github.com>
Commit: Genki Sato <13384803+gksato@users.noreply.github.com>
On :package, save already installed pkgs into selected-packages
Make sure the `:package`'s target packages are always saved into
the variable `packages-selected-packages`, whether or not
the packages are already installed. This way we can more easily
use package.el-related utilities like `package-autoremove`.
Fixes:
- https://github.com/conao3/leaf.el/issues/504
- https://github.com/conao3/leaf.el/issues/294
---
README.md | 10 ++++++----
README.org | 10 ++++++----
leaf-tests.el | 10 ++++++----
leaf.el | 6 ++++--
4 files changed, 22 insertions(+), 14 deletions(-)
diff --git a/README.md b/README.md
index abaa2f29b0..0bbdd99c3d 100644
--- a/README.md
+++ b/README.md
@@ -396,11 +396,13 @@ Since `:ensure` is to use `package.el` by default,
`:ensure` and `:package` prod
(prog1 'macrostep
(leaf-handler-package macrostep macrostep nil)))
- ;; `leaf-handler-package' expandion example.
- ;; If `macrostep' isn't installed, try to install.
- ;; If fail install, update local cache and retry to install.
+ ;; `leaf-handler-package' expansion example.
+ ;; If `macrostep' is installed, set it as a selected package;
+ ;; otherwise try to install it.
+ ;; If installation fails, update local cache and retry to install.
((leaf-handler-package macrostep macrostep nil)
- (unless (package-installed-p 'macrostep)
+ (if (package-installed-p 'macrostep)
+ (package--update-selected-packages '(macrostep) nil)
(unless (assoc 'macrostep package-archive-contents)
(package-refresh-contents))
(condition-case err
diff --git a/README.org b/README.org
index 251288f56e..6d4a49bf2c 100644
--- a/README.org
+++ b/README.org
@@ -414,11 +414,13 @@ Since ~:ensure~ is to use ~package.el~ by default,
~:ensure~ and
(prog1 'macrostep
(leaf-handler-package macrostep macrostep nil)))
- ;; `leaf-handler-package' expandion example.
- ;; If `macrostep' isn't installed, try to install.
- ;; If fail install, update local cache and retry to install.
+ ;; `leaf-handler-package' expansion example.
+ ;; If `macrostep' is installed, set it as a selected package;
+ ;; otherwise try to install it.
+ ;; If installation fails, update local cache and retry to install.
((leaf-handler-package macrostep macrostep nil)
- (unless (package-installed-p 'macrostep)
+ (if (package-installed-p 'macrostep)
+ (package--update-selected-packages '(macrostep) nil)
(unless (assoc 'macrostep package-archive-contents)
(package-refresh-contents))
(condition-case err
diff --git a/leaf-tests.el b/leaf-tests.el
index 3fb5534298..86bf79fdec 100644
--- a/leaf-tests.el
+++ b/leaf-tests.el
@@ -2385,11 +2385,13 @@ Example:
(prog1 'macrostep
(leaf-handler-package macrostep macrostep nil)))
- ;; `leaf-handler-package' expandion example.
- ;; If `macrostep' isn't installed, try to install.
- ;; If fail install, update local cache and retry to install.
+ ;; `leaf-handler-package' expansion example.
+ ;; If `macrostep' is installed, set it as a selected package;
+ ;; otherwise try to install it.
+ ;; If installation fails, update local cache and retry to install.
((leaf-handler-package macrostep macrostep nil)
- (unless (package-installed-p 'macrostep)
+ (if (package-installed-p 'macrostep)
+ (package--update-selected-packages '(macrostep) nil)
(unless (assoc 'macrostep package-archive-contents)
(package-refresh-contents))
(condition-case _err
diff --git a/leaf.el b/leaf.el
index 49937269c9..1f579f84c1 100644
--- a/leaf.el
+++ b/leaf.el
@@ -1074,8 +1074,10 @@ FN also accept list of FN."
(add-to-list 'leaf--paths (cons ',name file)))))
(defmacro leaf-handler-package (name pkg _pin)
- "Handler ensure PKG via PIN in NAME leaf block."
- `(unless (package-installed-p ',pkg)
+ "Handler for ensuring the installation of PKG with package.el
+via PIN in the leaf block NAME."
+ `(if (package-installed-p ',pkg)
+ (package--update-selected-packages '(,pkg) nil)
(unless (assoc ',pkg package-archive-contents)
(package-refresh-contents))
(condition-case _err
- [elpa] externals/leaf updated (0ccc52bb85 -> 9eb18e8c9c), ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 1f51e90e99 01/28: On :package, save already installed pkgs into selected-packages,
ELPA Syncer <=
- [elpa] externals/leaf 6f78d67369 12/28: Now :bind can accept lambda form binding. #322, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 7d8f768db5 19/28: Merge pull request #515 from meziberry/p/bind, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 1fd4508d4f 13/28: add testcase, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf a3835be6cc 20/28: Fix typo (isearch-mode-map), ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 3d8684dc2d 22/28: warn at :after when specified nil or any keywords, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf b6276d7faa 15/28: Change the expand form of leaf-key, when binding to lambda or menu-item, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 9797d3258d 27/28: Get rid the warning in define minor mode., ELPA Syncer, 2022/01/19
- [elpa] externals/leaf d314af8e9f 26/28: Merge pull request #521 from lorniu/master, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 7460e3c5eb 11/28: Merge pull request #518 from conao3/test, ELPA Syncer, 2022/01/19
- [elpa] externals/leaf 2d395ee3d4 24/28: Merge pull request #525 from conao3/warn-after-keyword, ELPA Syncer, 2022/01/19