reddit / emacs

Org-Journal- Create a single file each month, instead of each day.

UShouldntSayThat · 2022-05-31 18:18
(setq org-journal-dir "~/MyJournalLocations org-journal-date-prefix "#+TITLE: " org-journal-time-prefix "* " org-journal-date-format "%a, %d-%b-%Y" org-journal-file-format "%m-%Y.org") This is how I would want it se up, with a file only being created/named by month, however this generates an error ("Failed to extract month from file). My org-journal only works if I do it daily org-journal-file-format "%d-%m-%Y.org
EFLS_ · 2022-05-31 20:38
Straight fro the FAQ on GitHub: > Can I use weekly/monthly/yearly journal entries instead of daily ones? > Yes, see org-journal-file-type. And > org-journal-file-type - the journal file type either ‘daily (default), ‘weekly, ‘monthly or ‘yearly.
UShouldntSayThat · 2022-05-31 20:56
how embarrassing, thank you.
EFLS_ · 2022-06-01 09:03
np, glad it helped
UShouldntSayThat · 2022-06-01 15:42
I'm hoping I could trouble you with a follow up, ever since adding the file type, I receive the following error on save: `Error (after-save-hook): Error running hook "org-journal-after-save-hook" because: (user-error Before first headline at position 14 in buffer Jun-2022.org)` Perhaps my googling skills are lacking, but I haven't been able to find anything similar?
EFLS_ · 2022-06-02 13:31
Not sure I can help with that. I use the weekly agenda files. Are there any hooks you've added? What does the variable `org-journal-after-save-hook` show? If all else fails, try asking on the `org-journal` Github.
UShouldntSayThat · 2022-06-02 14:56
I don't see a variable for `org-journal-after-save-hook`, but I haven't touched the default function: (defun org-journal-after-save-hook () "Update agenda files and dates." (org-journal--update-org-agenda-files) (org-journal--dates-puthash) (org-journal--serialize)) My config file is also pretty bare, I'm funnin Doom emacs, but pretty much in a default state, other then a couple mappings, all I've added manually is * org-fancy-priorities settings * deft, org-roam, org-agenda directory settings and then the following org-journal settings: (setq org-journal-dir "~/OneDrive/Documents/.../Emacs/Notes/Journal" org-journal-date-prefix "#+TITLE: " org-journal-time-prefix "* " org-journal-file-type 'monthly org-journal-date-format "%a, %Y-%m-%d" org-journal-file-format "%b-%Y.org") would you mind maybe sharing your weekly config for org-journal? I could atleast see if there's an obvious miss on my part for setting up non default file types and/or if it doesn't work on mine help troubleshoot that the issue is not with the config specfically. That's a good idea to reach out to the github community, I'll do that too. Thanks!
EFLS_ · 2022-06-03 07:49
Not sure whether it helps, but this is the basis of my config: (use-package org-journal :defer t :custom (org-journal-dir (efls/org-dir "journal/")) (org-journal-date-format "%A, %d %B %Y") (org-journal-file-format "%Y-%m-%d.org") (org-journal-file-header "#+title: Week %W, %Y\n#+category: journal\n\n") (org-journal-time-format "") (org-journal-find-file 'find-file) (org-journal-carryover-items nil) (org-journal-file-type 'weekly) (org-journal-enable-agenda-integration t) :init (efls/general-leader-def "j" '(efls/journal-hydra/body :wk "journaling")) :config (set-face-attribute 'org-journal-calendar-entry-face nil :slant 'normal) (set-face-attribute 'org-journal-calendar-scheduled-face nil :slant 'normal)) Faces are adjusted so that the calendar entries are not slanted.
UShouldntSayThat · 2022-06-03 17:41
Yup that helped, comparing the two and moving back and fourth helped trouble shoot. org-journal-file-format does not like the `%b` tag, so will have to settle for %m. Thanks again for your help!