Journaling cleanup

This commit is contained in:
Howard Abrams 2024-08-10 21:59:03 -07:00
parent a9ce3c1d27
commit 4e11a22457
2 changed files with 83 additions and 95 deletions

View file

@ -29,36 +29,28 @@ Using the [[https://github.com/bastibe/org-journal][org-journal]] project to eas
#+begin_src emacs-lisp #+begin_src emacs-lisp
(use-package org-journal (use-package org-journal
:init :after org
:config
(setq org-journal-dir "~/journal" (setq org-journal-dir "~/journal"
org-journal-date-format " " org-journal-date-format " "
org-journal-time-format "" org-journal-time-format ""
org-journal-file-type 'daily org-journal-file-type 'daily
org-journal-file-format "%Y%m%d") org-journal-file-format "%Y%m%d")
:config
#+end_src
Notice that the rest of this file's contents is /contained/ in this =config= section!
And let's put a /leader key/ sequence for it (Doom-specific):
#+begin_src emacs-lisp
(ha-leader "f j" '("journal" . org-journal-new-entry)) (ha-leader "f j" '("journal" . org-journal-new-entry))
#+end_src
In normal Org file, I like large headers, but in my Journal, where each task is a header, I want them smaller:
#+begin_src emacs-lisp ;; In normal Org file, I like large headers, but in my Journal,
;; where each task is a header, I want them smaller:
(add-hook 'org-journal-mode-hook (add-hook 'org-journal-mode-hook
(lambda () (lambda ()
(set-face-attribute 'org-level-1 nil :height 1.2) (set-face-attribute 'org-level-1 nil :height 1.2)
(set-face-attribute 'org-level-2 nil :height 1.1) (set-face-attribute 'org-level-2 nil :height 1.1)
(set-face-attribute 'org-level-3 nil :height 1.0))) (set-face-attribute 'org-level-3 nil :height 1.0)))
#+end_src
But new files could use /my formatting/ (which is different than the options available in the project): ;; But new files could use /my formatting/ (which is different
;; than the options available in the project):
#+begin_src emacs-lisp (ha-auto-insert-file (rx "journal/" (zero-or-more any) (= 8 digit)) "journal"))
(ha-auto-insert-file (rx "journal/" (zero-or-more any) (= 8 digit)) "journal")
#+end_src #+end_src
This depends on the following [[file:~/.doom.d/snippets/org-journal-mode/__journal][snippet/template file]]: This depends on the following [[file:~/.doom.d/snippets/org-journal-mode/__journal][snippet/template file]]:
@ -99,10 +91,6 @@ Using the "date" associated with a file, we can create our standard timestamp:
(format-time-string "%e %b %Y (%A)" (ha-journal-file-date datename))) (format-time-string "%e %b %Y (%A)" (ha-journal-file-date datename)))
#+end_src #+end_src
Close the =use-package= call:
#+begin_src emacs-lisp
)
#+end_src
* Journal Capture * Journal Capture
Capturing a task (that when uncompleted, would then spillover to following days) could go to the daily journal entry. This requires a special function that opens today's journal, but specifies a non-nil prefix argument in order to inhibit inserting the heading, as =org-capture= will insert the heading. Capturing a task (that when uncompleted, would then spillover to following days) could go to the daily journal entry. This requires a special function that opens today's journal, but specifies a non-nil prefix argument in order to inhibit inserting the heading, as =org-capture= will insert the heading.
@ -138,7 +126,7 @@ Sometimes it is obvious what is the /next file/ based on the one I'm currently r
Which means that the following defines this function: Which means that the following defines this function:
#+begin_src emacs-lisp :tangle no #+begin_src emacs-lisp :tangle no
(ert-deftest split-string-with-number-test () (ert-deftest split-string-default-separatorsg-with-number-test ()
(should (equal (split-string-with-number "abc42xyz") '("abc" "42" "xyz"))) (should (equal (split-string-with-number "abc42xyz") '("abc" "42" "xyz")))
(should (equal (split-string-with-number "42xyz") '("" "42" "xyz"))) (should (equal (split-string-with-number "42xyz") '("" "42" "xyz")))
(should (equal (split-string-with-number "abc42") '("abc" "42" ""))) (should (equal (split-string-with-number "abc42") '("abc" "42" "")))

View file

@ -1,3 +1,3 @@
#+TITLE: Journal Entry- `(ha-journal-file-datestamp)` #+title: Journal Entry- `(ha-journal-file-datestamp)`
$0 $0