[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elisa 2e508f1daf 1/3: Add command to enable all collect
From: |
ELPA Syncer |
Subject: |
[elpa] externals/elisa 2e508f1daf 1/3: Add command to enable all collections |
Date: |
Sat, 23 Nov 2024 18:57:53 -0500 (EST) |
branch: externals/elisa
commit 2e508f1daf43d746d4c615ff2111e29289075533
Author: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Commit: Sergey Kostyaev <kostyaev.sergey2@wb.ru>
Add command to enable all collections
Added a new function `elisa-enable-all-collections` to enable all
collections. Updated the README with documentation for this new
command.
---
README.org | 4 ++++
elisa.el | 13 +++++++++++++
2 files changed, 17 insertions(+)
diff --git a/README.org b/README.org
index acf155f1e0..3fc9d4003a 100644
--- a/README.org
+++ b/README.org
@@ -187,6 +187,10 @@ Add webpage to collection.
Enable collection for ~elisa-chat~.
+*** elisa-enable-all-collections
+
+Enable all collections.
+
*** elisa-disable-collection
Disable collection.
diff --git a/elisa.el b/elisa.el
index 8b5dd40e38..a05483618f 100644
--- a/elisa.el
+++ b/elisa.el
@@ -1368,6 +1368,19 @@ It does nothing if buffer file not inside one of
existing collections."
"SELECT name FROM collections;")))))))
(push col elisa-enabled-collections)))
+;;;###autoload
+(defun elisa-enable-all-collections ()
+ "Enable all collections."
+ (interactive)
+ (let ((all-collections
+ (flatten-tree
+ (sqlite-select
+ elisa-db
+ "SELECT DISTINCT name FROM collections;"))))
+ (setq elisa-enabled-collections
+ (cl-set-difference all-collections elisa-enabled-collections :test
#'string=))
+ (mapc #'elisa-enable-collection all-collections)))
+
;;;###autoload
(defun elisa-create-empty-collection (&optional collection)
"Create new empty COLLECTION."