summary refs log tree commit diff
path: root/emacs/init.el
diff options
context:
space:
mode:
authornoa2024-10-06 13:28:54 +0800
committernoa2024-10-06 13:28:54 +0800
commit6fe3e83f8e776d3c7ae427ccd299ec51ea74b8f0 (patch)
treea4548530f07a21c21cf12ae5e71cbfb9393d43e1 /emacs/init.el
parent1b6ba459142657cb4a3f8c7f1764055a85f7e5f2 (diff)
Add command to open today's diary entry
Diffstat (limited to 'emacs/init.el')
-rw-r--r--emacs/init.el8
1 files changed, 8 insertions, 0 deletions
diff --git a/emacs/init.el b/emacs/init.el
index 116172f..927a73d 100644
--- a/emacs/init.el
+++ b/emacs/init.el
@@ -735,6 +735,14 @@ The misspelled word is taken from OVERLAY.  WORD is the corrected word."
   ("<f12>" . howm-list-all)
   ("<C-f12>" . howm-create))
 (setopt howm-file-name-format "%Y-%m-%dT%H%M%S.md")
+
+(defun noa/open-todays-diary ()
+  (interactive)
+  (let ((date (format-time-string "%Y-%m-%d")))
+    (find-file (format "~/Documents/notes/diary/%s.md"  date))
+    (if (= (buffer-size) 0)
+        (insert (concat "# " date "\n\n")))))
+
 ;;; Bibliography management
 (use-package ebib
   :ensure t