branch: externals/denote
commit 59891204cedef2af10482d1052c5c45b11d7a7f6
Author: Protesilaos Stavrou <[email protected]>
Commit: Protesilaos Stavrou <[email protected]>

    Limit the scope of the "migration" files
    
    See commits 5c2237e and e711b16.  This is about updating the front
    matter of Org and YAML to the correct syntax for tags.
    
    The function I just wrote is not the best code ever written, but we will
    not keep it for too long, anyway.
---
 denote.el | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/denote.el b/denote.el
index 56ab8e3fc6..45f24d7724 100644
--- a/denote.el
+++ b/denote.el
@@ -2209,10 +2209,16 @@ Consult the manual for template samples."
 (defun denote--migrate-type-files (type)
   "Return list of TYPE files in variable `denote-directory'.
 TYPE is a string which matches the `file-name-extension'."
-  (seq-remove
-   (lambda (file)
-     (not (string= (file-name-extension file) type)))
-   (denote--directory-files)))
+  (delq nil
+        (mapcar
+         (lambda (file)
+           (when-let* ((value (denote--retrieve-value-keywords file))
+                       ((string-match-p "\s\s" value)))
+             file))
+         (seq-remove
+          (lambda (file)
+            (not (string= (file-name-extension file) type)))
+          (denote--directory-files)))))
 
 ;;;###autoload
 (defun denote-migrate-old-org-filetags ()

Reply via email to