1

In a nutshell: I'm looking for a way to selectively hide one instance of a repeated diary entry so it doesn't show up in my org-agenda.


I have many repeating diary entries for things like weekly meetings, etc. using basic sexp syntax.

I've set up my org-agenda to include these diary entries in my weekly/daily views.

Sometimes, a weekly event is cancelled. How can I hide/delete it from my org agenda just this once, without deleting the entire entry in the diary?

1

How about modifying the last line of your custom diary sexp so that it becomes an and statement that checks to ensure that the DATE is not a member of your excluded dates?:

(and [YOUR-SEXP-RESULT-THAT-IS-NON-NIL]
     (not (member DATE '((2 28 2017)
                         (5 1 2017)
                         (5 31 2017)))))

Granted, of course, you will need to modify the diary sexp every time you decide to add a custom date to be excluded. You can assign the list of excluded dates to a variable that is accessible to the sexp, if that makes things easier to add additional dates as needed ...

Here is a link to an example of a custom diary sexp that looks for the last day of every month:

https://emacs.stackexchange.com/a/31708/2287

The last line in that linked example is (= day last-day-of-month), which would be replaced with the snippet above -- the incoming argument of date to the custom sexp named diary-last-day-of-month is written in lowercase; i.e.,

(and (= day last-day-of-month)
     (not (member date '((2 28 2017)
                         (5 1 2017)
                         (5 31 2017)))))

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.