From 6fe3e83f8e776d3c7ae427ccd299ec51ea74b8f0 Mon Sep 17 00:00:00 2001 From: noa Date: Sun, 6 Oct 2024 13:28:54 +0800 Subject: Add command to open today's diary entry --- emacs/init.el | 8 ++++++++ 1 file changed, 8 insertions(+) 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." ("" . howm-list-all) ("" . 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 -- cgit 1.4.1-2-gfad0