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

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

[elpa] externals/elisa 27fc248901 71/98: Remove files metadata on collec


From: ELPA Syncer
Subject: [elpa] externals/elisa 27fc248901 71/98: Remove files metadata on collection remove
Date: Wed, 17 Jul 2024 18:58:06 -0400 (EDT)

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

    Remove files metadata on collection remove
---
 elisa.el | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/elisa.el b/elisa.el
index 72fe45f604..659ae5b5aa 100644
--- a/elisa.el
+++ b/elisa.el
@@ -1257,6 +1257,19 @@ It does nothing if buffer file not inside one of 
existing collections."
                        "select rowid from data where collection_id = %d;"
                        collection-id)))))
     (elisa-disable-collection col)
+    (when (file-directory-p col)
+      (let ((files
+            (flatten-tree
+             (sqlite-select
+              elisa-db
+              (format
+               "select distinct path from data where collection_id = %d;"
+               collection-id)))))
+       (sqlite-execute
+        elisa-db
+        (format
+         "delete from files where path in %s;"
+         (elisa-sqlite-format-string-list files)))))
     (elisa--delete-data delete-ids)
     (sqlite-execute
      elisa-db



reply via email to

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