Open drewbenn opened 3 years ago
I may have found the cause. The last line in my journal file is 3 spaces. When I C-u C-c C-j
, the * Sunday, 06/06/2021
is appended to that line (and no :PROPERTIES:
drawer is created): because there are 3 spaces before the *
, that line isn't recognized as an org-mode heading. If I C-u C-c C-j
a second time, * Sunday, 06/06/2021
is appended again, this time to a blank line, and the :PROPERTIES:
drawer is created.
hexdump of the file showing the last line, before I do anything:
$ hexdump -C 20210531 | tail -2
0000e5a0 20 20 20 20 20 34 20 7c 0a 20 20 20 0a | 4 |. .|
0000e5ad
$
So the bug seems to be: org-journal doesn't correctly create a new day in weekly mode if the last line of the file ends in a space.
How strange. Thank you for your analysis!
I also have this bug, what is the fix?
I solved this using:
(defun my-org-mode-setup ()
"Custom configurations for org-mode
."
(add-hook 'before-save-hook 'delete-trailing-whitespace nil t))
(add-hook 'org-mode-hook 'my-org-mode-setup))
I tried to add a new entry on Sunday evening after not using org-journal since Friday afternoon. When I tried to start a new entry with C-c C-j, the entry was added to the end of Friday, instead of getting a new date line added to the file.
C-u C-c C-j, to create the current date without adding a new entry, also jumps to the end of Friday without adding a new entry.
org-journal 2.1.2 installed manually on Debian stable (10) KDE. Applicable lines from my .emacs: