~protesilaos/denote

Fix confirmation message for denote-migrate-old-markdown-yaml-tags v1 APPLIED

Abin Simon: 3
 Fix confirmation message for denote-migrate-old-markdown-yaml-tags
 Fix regexp for denote--{title,keywords}-key-regexp
 Fix denote--migrate-type-files detection of old keywords when only one tag

 3 files changed, 8 insertions(+), 5 deletions(-)
Thank you!

I installed the patches.  Note that the aggregate change is below the
~15 line threshold and thus does not require copyright assignment to the
Free Software Foundation.  However, we are close to the limit.  For
future changes it is safer if you assign copyright to the FSF (unless
you already did, of course).

If you need the relevant form, it is mentioned in the manual:
<https://protesilaos.com/emacs/denote#h:1ebe4865-c001-4747-a6f2-0fe45aad71cd>.
Export patchset (mbox)
How do I use this?

Copy & paste the following snippet into your terminal to import this patchset into git:

curl -s https://lists.sr.ht/~protesilaos/denote/patches/34632/mbox | git am -3
Learn more about email & git

[PATCH 1/3] Fix confirmation message for denote-migrate-old-markdown-yaml-tags Export this patch

---
 denote.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index 59ed2ad..b18a522 100644
--- a/denote.el
+++ b/denote.el
@@ -2245,7 +2245,7 @@ Consult the manual for template samples."

(add-hook 'org-capture-after-finalize-hook #'denote-org-capture-delete-empty-file)

;;;; For the migration of old Org filetags
;;;; For the migration of old Org filetags/Markdown+YAML tags

(defun denote--migrate-type-files (type file-type)
  "Return list of TYPE files in variable `denote-directory'.
@@ -2321,7 +2321,7 @@ This command is provided for the convenience of the user.  It
shall be deprecated and eventually removed from future versions
of Denote.  Written on 2022-08-10 for version 0.5.0."
  (interactive)
  (when-let (((yes-or-no-p "Rewrite filetags in Org files to use colons (buffers are NOT saved)?"))
  (when-let (((yes-or-no-p "Rewrite tags in Markdown files with YAML header to use lists (buffers are NOT saved)?"))
             (files (denote--migrate-type-files "md" 'markdown-yaml)))
    (dolist (file files)
      (when-let* ((kw (denote--front-matter-keywords-to-list file 'markdown-yaml))
-- 
2.37.0

[PATCH 2/3] Fix regexp for denote--{title,keywords}-key-regexp Export this patch

---
 denote.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/denote.el b/denote.el
index b18a522..426356c 100644
--- a/denote.el
+++ b/denote.el
@@ -567,7 +567,7 @@ output is sorted with `string-lessp'."
  (cond ((or (eq file-type 'markdown-yaml) (eq file-type 'text))
         "^title\\s-*:")
        ((eq file-type 'org)
         "^#+title\\s-*:")
         "^#\\+title\\s-*:")
        ((eq file-type 'markdown-toml)
         "^title\\s-*=")))

@@ -576,7 +576,7 @@ output is sorted with `string-lessp'."
  (cond ((or (eq file-type 'markdown-yaml) (eq file-type 'text))
         "^tags\\s-*:")
        ((eq file-type 'org)
         "^#+filetags\\s-*:")
         "^#\\+filetags\\s-*:")
        ((eq file-type 'markdown-toml)
         "^tags\\s-*=")))

-- 
2.37.0

[PATCH 3/3] Fix denote--migrate-type-files detection of old keywords when only one tag Export this patch

---
 denote.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/denote.el b/denote.el
index 426356c..c1d42f1 100644
--- a/denote.el
+++ b/denote.el
@@ -2256,7 +2256,10 @@ FILE-TYPE is the symbol file-type."
         (lambda (file)
           (when-let* ((value (denote--retrieve-value-keywords
                               file file-type))
                       ((string-match-p "\s\s" value)))
                       ((cond
                         ((eq file-type 'markdown-yaml) (not (string-match-p "," value)))
                         ((eq file-type 'org) (not (string-match-p ":" value)))
                         (t nil))))
             file))
         (seq-remove
          (lambda (file)
-- 
2.37.0
Thank you!

I installed the patches.  Note that the aggregate change is below the
~15 line threshold and thus does not require copyright assignment to the
Free Software Foundation.  However, we are close to the limit.  For
future changes it is safer if you assign copyright to the FSF (unless
you already did, of course).

If you need the relevant form, it is mentioned in the manual:
<https://protesilaos.com/emacs/denote#h:1ebe4865-c001-4747-a6f2-0fe45aad71cd>.