summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Lemon <matt@matthewlemon.com>2022-12-08 09:06:42 +0000
committerMatthew Lemon <matt@matthewlemon.com>2022-12-08 09:06:42 +0000
commit9cc67051db30b73931d701fa8ad751352ad73539 (patch)
treec456f116a9400012738aee47708a682819544c66
parente05295a4dea200980119f790adeeb200092680a3 (diff)
refactored journal func
-rw-r--r--init.el9
1 files changed, 5 insertions, 4 deletions
diff --git a/init.el b/init.el
index df1cb1d..f50e206 100644
--- a/init.el
+++ b/init.el
@@ -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)