diff options
author | Matthew Lemon <matt@matthewlemon.com> | 2022-12-08 09:06:42 +0000 |
---|---|---|
committer | Matthew Lemon <matt@matthewlemon.com> | 2022-12-08 09:06:42 +0000 |
commit | 9cc67051db30b73931d701fa8ad751352ad73539 (patch) | |
tree | c456f116a9400012738aee47708a682819544c66 | |
parent | e05295a4dea200980119f790adeeb200092680a3 (diff) |
refactored journal func
-rw-r--r-- | init.el | 9 |
1 files changed, 5 insertions, 4 deletions
@@ -275,14 +275,15 @@ Restart works only on graphic display." (defun mrl/denote-journal () "Create an entry tagged 'journal' with the date as its title." (interactive) - (let* ((today-journal + (let* ((journal-dir (concat (denote-directory) "journals")) + (today-journal (car (-non-nil - (mapcar #'mrl/is-todays-journal? (directory-files (concat (denote-directory) "journals") nil "_journal")))))) + (mapcar #'mrl/is-todays-journal? (directory-files journal-dir nil "_journal")))))) (if today-journal - (find-file (concat (denote-directory) "journals/" today-journal)) + (find-file (concat journal-dir "/" today-journal)) (denote (format-time-string "%A %e %B %Y") - '("journal") nil (concat (denote-directory) "journals"))))) + '("journal") nil journal-dir)))) :bind (("C-c n n" . denote-create-note) ("C-c n d" . mrl/denote-journal) |