Created
December 6, 2025 19:52
-
-
Save mlabbe/0ba4183ba425985ed2caeb4f6717502c to your computer and use it in GitHub Desktop.
Microjournal
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (defcustom microjournal-path "~/.journal.org.gpg" | |
| "name for the microjournal file" | |
| :type 'file | |
| :group 'microjournal) | |
| (defun microjournal-insert-year () | |
| "Create a root header for the current year if it doesn't exist" | |
| (interactive) | |
| (let ((header-name (format-time-string "%Y"))) | |
| (goto-char (point-max)) | |
| (unless (re-search-backward (format "^\\*+ %s" header-name) nil t) | |
| (insert (format "\n* %s\n" header-name))) | |
| (org-show-subtree))) | |
| (defun microjournal-new-entry () | |
| "Create a new entry for the current time and day" | |
| (interactive) | |
| (progn | |
| (find-file microjournal-path) | |
| (microjournal-insert-year) | |
| (org-insert-heading-respect-content) | |
| (org-do-demote) | |
| (insert (format "%s\n" (format-time-string "%A, %m/%d/%Y %I:%M%p"))) | |
| )) | |
| (provide 'microjournal) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment