mirror of
https://github.com/protesilaos/denote.git
synced 2026-09-10 07:16:20 -04:00
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.
This commit is contained in:
parent
77acc10fe4
commit
3eb82c0bd0
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue