I have been trying to set up org-journal. Initially, I set up the config using (require 'org-journal):
(setq org-journal-dir "~/org/meta/journal/") (setq org-journal-date-format "%A, %d %B %Y") (setq org-journal-file-format "%d-%m-%Y.org") (setq org-journal-file-type "weekly)") (require 'org-journal)
This seemed to work for the first day but the variables were subsequently not set. I changed to trying use-package:
(use-package org-journal :ensure t :defer t :init ;; Change default prefix key; needs to be set before loading org-journal (setq org-journal-prefix-key "C-c j ") (setq org-journal-date-format "%A, %d %B %Y") (setq org-journal-file-format "%d-%m-%Y.org") (setq org-journal-file-type "weekly)") :config (setq org-journal-dir "~/org/meta/journal/" org-journal-date-format "%A, %d %B %Y"))
I am getting variations upon the following error:
org-journal--search-forward-created: Search failed: "[ ]*:CREATED:[ ]+20200922[ ]*$"
[and full backtrace]:
Debugger entered--Lisp error: (search-failed "[ \011]*:CREATED:[ \011]+20200922[ \011]*$") re-search-forward("[ \011]*:CREATED:[ \011]+20200922[ \011]*$" nil nil nil) org-journal--search-forward-created((9 22 2020)) org-journal--goto-entry((9 22 2020)) org-journal--open-entry(t t) org-journal--carryover() org-journal-new-entry(nil) funcall-interactively(org-journal-new-entry nil) call-interactively(org-journal-new-entry nil nil) command-execute(org-journal-new-entry)
A new journal buffer is opened entitled 23-09-2020.org (ie. in the journal directory there is a file '#23-09-20920.org#'). There is an existing file in the journal directory entitled 22-09-2020.org. This first file (the first journal entry I created yesterday when I set file-type to weekly entries) contains a string ":CREATED: 20200922", which, though I don't understand all of the formatting, or indeed the syntax, re-search-forward appears to be searching for. Creating a new journal entry worked yesterday ie. I created several entries which correctly appended, with timestamp, to the 22-09-2020.org file, but fails as above and creates a new file today. This is so when ran from F5 (currently globally mapped to org-journal-new-entry), M-x org-journal-new-entry, or C-c C-j.
I thought briefly (because initially, the file-type was set to daily), that org-journal-invalidate-cache might solve it but it has no evident effect.
My elisp is poor to non-existent but looking over the code, I wonder if the problem is related to the function (org-journal--convert-time-to-file-type-time). This ought to return the first day of the week and does not appear to be doing so. The first entries in an empty directory having invalidated the cache always create a file for the present day, not the first day of the week, though org-journal-file-type is set to "weekly".
I would appreciate any constructive pointers.