Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip marking calendar entries for date input #380

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

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
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.

4 participants