org-journal
org-journal copied to clipboard
Ignore unrecognized timestamps and timestamps in subheadings
Description
I work with Orgzly, and this produces timestamps like:
:PROPERTIES:
:CREATED: [2022-08-23 Tue 10:09]
:END:
While org-journal for me uses:
org-journal-created-property-timestamp-format
Value
"[%Y-%m-%d]"
Expected Results
org-journal ignores:
- CREATED entries on subheadings
- CREATED entries outside of PROPERTIES drawers (yes I moved it out to test and org-journal did not care)
- CREATED entries that do not match its format
No errors, no complaining, just ignore them as if they weren't there :)
Actual Results
user-error: Created property timestamp format "[%Y-%m-%d]" doesn’t match CREATED property value (nil) from entry at line: Line 637
Now this is really weird, if I call either of org-time-stamp(-inactive)
anywhere as soon as org-journal is loaded, I get an error:
user-error: Created property timestamp format "[%Y-%m-%d]" doesn’t match CREATED property value ([2022-08-23 Tue 10:09]) from entry at line: Line 602
Seems like org-journal is hooked in somewhere it shouldn't be?
See also https://github.com/bastibe/org-journal/issues/383 and https://github.com/bastibe/org-journal/issues/391
okay, org-journal hooks into the calendar to mark days. I see @jmay @dppdppd you have already created patches, could you assist on this issue as well?
After an hour of debugging I think I found the culprit:
(defun org-journal--file->calendar-dates (file)
"Return journal dates from FILE."
(org-journal--with-journal
file
(let (dates)
(save-excursion
(goto-char (point-min))
(while (re-search-forward org-journal--created-re nil t)
(when (= (save-excursion (org-back-to-heading) (org-outline-level)) 1)
(push (org-journal--entry-date->calendar-date) dates)))
dates))))
my journal contains #+startup: overview
, which means the headings are all folded and org-outline-level
always reports 1.
Inserting outline-show-all
in there did not seem to cut it :/
@xeruf Make sure you restart your emacs and have the latest org-journal changes. Are you still getting errors? I can run org-time-stamp
or org-time-stamp-inactive
without problems. The calendar-dates function above was definitely where the patch was applied.
yes, this works with the patch, which I've merged together at https://github.com/toemacs/org-journal
however, org-journal still erroneously checks on timestamps in subheadings.
I am now getting user-error: Created property timestamp format "[%Y-%m-%d]" doesn’t match CREATED property value (nil) from entry at line: Line 7
and org-journal refuses to create timestamped headings.
I can't even find the line the error is about.
Can we somehow prevent all these kinds of errors from impeding basic org-journal functionality?
Can we somehow prevent all these kinds of errors from impeding basic org-journal functionality?
Fixed by https://github.com/bastibe/org-journal/pull/380