[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/denote 3eb82c0bd0 1/3: Update denote-journal-extras--en
From: |
ELPA Syncer |
Subject: |
[elpa] externals/denote 3eb82c0bd0 1/3: Update denote-journal-extras--entry-today to handle custom filename component order |
Date: |
Wed, 17 Jul 2024 06:58:02 -0400 (EDT) |
branch: externals/denote
commit 3eb82c0bd05b5cb08d6a60a55b6b3a9c3e4ce773
Author: Jakub Szczerbowski <3611452+j4kub5@users.noreply.github.com>
Commit: GitHub <noreply@github.com>
Update denote-journal-extras--entry-today to handle custom filename
component order
The `denote-journal-extras--entry-today` was misbehaving if keywords were
in front of the identifier (which is allowed since denote 3.0.0). The corrected
version (1) searches for files only based on date and (2) subsequently filters
them for the denote-journal-extras-keyword.
---
denote-journal-extras.el | 11 +++++++----
1 file changed, 7 insertions(+), 4 deletions(-)
diff --git a/denote-journal-extras.el b/denote-journal-extras.el
index c017fab299..7223da0e88 100644
--- a/denote-journal-extras.el
+++ b/denote-journal-extras.el
@@ -164,10 +164,13 @@ is internally processed by `denote-parse-date'."
(defun denote-journal-extras--entry-today (&optional date)
"Return list of files matching a journal for today or optional DATE.
DATE has the same format as that returned by `denote-parse-date'."
- (denote-directory-files
- (format "%sT[0-9]\\{6\\}.*_%s"
- (format-time-string "%Y%m%d" date)
- denote-journal-extras-keyword)))
+ (let* ((identifier (format "%sT[0-9]\\{6\\}" (format-time-string "%Y%m%d"
date)))
+ (files (denote-directory-files identifier))
+ (keyword (concat "_" (regexp-quote denote-journal-extras-keyword))))
+ (seq-filter
+ (lambda (file)
+ (string-match-p keyword file))
+ files)))
;;;###autoload
(defun denote-journal-extras-new-or-existing-entry (&optional date)