Skip to content

Conversation

@dppdppd
Copy link

@dppdppd dppdppd commented Jan 24, 2022

(ugh. renaming the branch reset the PR. never again...)

I flipped the logic so it might be clearer now.

We always mark entries, unless we call org-read-date.

(defun org-journal--org-read-date (orig-fun &rest args)
  "In the case where the calendar is opened to input a timestamp, don't mark entries."
  (progn
    (setq org-journal-allow-mark-entries nil) <----- turn it off temporarily
    (unwind-protect
        (apply orig-fun args)               <------- (calendar) gets called in here, and therefore org-journal-mark-entries
      (setq org-journal-allow-mark-entries t)))) <---- turn it back on

@bastibe
Copy link
Owner

bastibe commented Feb 2, 2022

This looks reasonable. I still don't quite understand why we have to disable marking explicitly for org-read-date, since the function that does the marking is disabled anyway. But if you say it's necessary, I'll trust your assessment.

But since the variable is supposed to be configured by the user, it should be a defcustom, not a defvar.

@xeruf
Copy link
Collaborator

xeruf commented Jan 3, 2023

@dppdppd can you make the suggested correction so we can merge?
Then I would squash this with the title "Skip marking calendar entries for date input"

@xeruf xeruf changed the title Skip mark entries Skip marking calendar entries for date input Jan 6, 2023
@casch-at casch-at added this to the 2.3.0 milestone Dec 7, 2023
@casch-at casch-at self-assigned this Dec 7, 2023
@superhans2
Copy link

can you accept this pull request? I am also getting same errors that are reported in #397 and it makes journal unusable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants