[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/elisa fb803f736d 2/3: Merge pull request #29 from s-kos
From: |
ELPA Syncer |
Subject: |
[elpa] externals/elisa fb803f736d 2/3: Merge pull request #29 from s-kostyaev/add-enable-all-collections-command |
Date: |
Sat, 23 Nov 2024 18:57:53 -0500 (EST) |
branch: externals/elisa
commit fb803f736d1eeda58d8e26d60826000225d540ac
Merge: 1c1e0f1715 2e508f1daf
Author: Sergey Kostyaev <s-kostyaev@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Merge pull request #29 from s-kostyaev/add-enable-all-collections-command
Add command to enable all collections
---
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."