branch: externals/denote-org commit 408b6be42f2d43620d5db98cd3b898a0512e4fe3 Author: Protesilaos Stavrou <i...@protesilaos.com> Commit: Protesilaos Stavrou <i...@protesilaos.com>
Use denote-sequence-get-path instead of bespoke functions I forgot about this one. We already had everything we needed to find a unique match. --- denote-org.el | 19 ++----------------- 1 file changed, 2 insertions(+), 17 deletions(-) diff --git a/denote-org.el b/denote-org.el index aa4ebaef7f..575935bcba 100644 --- a/denote-org.el +++ b/denote-org.el @@ -1020,21 +1020,6 @@ With optional FILES operate on them, otherwise use the return value of (dolist (link (nreverse links)) (insert link)))) - ;; TODO 2025-08-14: Once these are stable, consider moving them to denote-sequence.el - (defun denote-org-sequence--format-word-regexp (sequence) - "Return word regexp matching SEQUENCE. -If sequence does not start with a =, then include it." - (unless (string-prefix-p "=" sequence) - (setq sequence (concat "=" sequence))) - (format "%s\\b" (regexp-quote sequence))) - - (defun denote-org-sequence--get-file (sequence) - "Get file matching SEQUENCE." - (let ((file (denote-directory-files (denote-org-sequence--format-word-regexp sequence)))) - (if (length> file 1) - (error "Sequence `%s' does not have a unique match" sequence) - file))) - (defun org-dblock-write:denote-sequence (params) "Function to update `denote-sequence' Org Dynamic blocks. When sequence is an empty string, then use all Denote files with a sequence. @@ -1043,9 +1028,9 @@ Used by `org-dblock-update' with PARAMS provided by the dynamic block." (let ((block-name (plist-get params :block-name))) (when-let* ((sequence (plist-get params :sequence)) (depth (plist-get params :depth)) - (parent (denote-org-sequence--get-file sequence)) + (parent (denote-sequence-get-path sequence)) (children (denote-sequence-get-relative sequence 'all-children)) - (family (append parent children)) + (family (push parent children)) (files (denote-org-sequence--get-files-with-max-depth depth family))) (when block-name (insert "#+name: " block-name "\n")) (denote-org--insert-sequence files)