org-journal icon indicating copy to clipboard operation
org-journal copied to clipboard

org-journal-new-entry needs to save any new file it creates.

Open PaulSchulz opened this issue 2 years ago • 1 comments

Describe the bug Several time now I have lost my TODO's which get copied to a new org-journal file when the 'org-journal-new-entry' is run for the first time in the day. I do this, and them my emacs/system crashes (high load on startup) and all of the TODO's are lost.

To Reproduce

  • Start emacs with org-mode and org-journal
  • Create TODO entries in a journal file with 'org-journal-new-entry (add TODO on header line).
  • Save journal file as previous days date.
  • Run 'org-journal-new-entry' to recreate the day's journal file. Note that the 'TODO' entries have been copied .
  • Kill emacs
  • Restart emacs, run 'org-journal-new-entry' and note that TODO's are now missing.

Expected behavior Don't allow TODO entries to be lost.

The current behavour removes the TODO's from the previous day as it copies them into the current day, but by not saving the new file will cause the TODO's to be completely removed from any existing files on disk.

(I realise that I can resolve this for myself if I remember to deliberately save my files after creating the new journal file. This has proved to be problematic when experiencing interuptions and system issues.)

Your Emacs Configuration org-journal Archive: melpa Version: 20220920.1514

PaulSchulz avatar Nov 17 '22 01:11 PaulSchulz

You could add save-buffer to org-journal-after-entry-create-hook.

bastibe avatar Nov 19 '22 08:11 bastibe