emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] externals/elisa 14af9ae960 66/98: Improve collection management


From: ELPA Syncer
Subject: [elpa] externals/elisa 14af9ae960 66/98: Improve collection management
Date: Wed, 17 Jul 2024 18:58:05 -0400 (EDT)

branch: externals/elisa
commit 14af9ae960214e31bb12a95fecc9c2c668210b13
Author: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Commit: Sergey Kostyaev <kostyaev.sergey2@wb.ru>

    Improve collection management
---
 elisa.el | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/elisa.el b/elisa.el
index e2cc56a9fc..aa06752113 100644
--- a/elisa.el
+++ b/elisa.el
@@ -1152,6 +1152,12 @@ Call ON-DONE callback with result as an argument after 
FUNC evaluation done."
     (setq elisa-enabled-collections
          (cl-remove col elisa-enabled-collections :test #'string=))))
 
+;;;###autoload
+(defun elisa-disble-all-collections ()
+  "Disable all collections."
+  (interactive)
+  (mapc #'elisa-disable-collection elisa-enabled-collections))
+
 ;;;###autoload
 (defun elisa-enable-collection (&optional collection)
   "Enable COLLECTION."
@@ -1159,10 +1165,13 @@ Call ON-DONE callback with result as an argument after 
FUNC evaluation done."
   (let ((col (or collection
                 (completing-read
                  "Enable collection: "
-                 (flatten-tree
-                  (sqlite-select
-                   elisa-db
-                   "select name from collections;"))))))
+                 (cl-remove-if
+                  (lambda (c)
+                    (cl-find c elisa-enabled-collections :test #'string=))
+                  (flatten-tree
+                   (sqlite-select
+                    elisa-db
+                    "select name from collections;")))))))
     (push col elisa-enabled-collections)))
 
 ;;;###autoload



reply via email to

[Prev in Thread] Current Thread [Next in Thread]