[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: ox-icalendar: Filter todo-types
From: |
Jack Kamm |
Subject: |
Re: ox-icalendar: Filter todo-types |
Date: |
Sat, 22 Jun 2024 16:28:41 -0700 |
Michaël Cadilhac <michael@cadilhac.name> writes:
> I have a task that was recurring, which I KILLED a few weeks ago. It
> now looks like:
>
> ** KILLED Do the right thing
> SCHEDULED: <2023-07-14 Fri +1w>
>
> ox-icalendar still exports it every week, because I have
> 'event-if-not-todo in org-icalendar-use-scheduled (which is the
> behavior I want for some other headers).
>
> BEGIN:VEVENT
> DTSTAMP:20240622T163042Z
> UID:SC-671b3d13-f985-472a-be33-b4eeb298f2cd
> DTSTART;VALUE=DATE:20230714
> DTEND;VALUE=DATE:20230715
> RRULE:FREQ=WEEKLY;INTERVAL=1
> SUMMARY:S: KILLED Do the right thing :
> CATEGORIES:todos
> END:VEVENT
>
> Would it be acceptable to add a variable to filter todo-types, e.g.,
> with a variable org-icalendar-excluded-todo-types? More generally,
> one could think of introducing a variable:
> org-icalendar-entry-filter
> which receives the ENTRY argument of org-icalendar-entry, and would
> return non-nil if the entry is to be treated. (This is basically what
> I do using an advice.)
I agree ox-icalendar should have an option to exclude certain
todo-keywords from export.
However I think the option should also be flexible to allow exporting
todo-keywords as different STATUS:
https://datatracker.ietf.org/doc/html/rfc5545#section-3.8.1.11
For example, in your case it might make more sense to export the task as
CANCELLED in iCalendar.
I think I'd rather have a customization option for this than a filter
function. That way, other Lisp programs that import ICS to Org (such as
org-caldav) could refer to this option to interoperate with ox-icalendar
for 2-way sync.
Perhaps we could have an option ox-icalendar-export-todo-keywords-as
which could determine whether a keyword should be exported, and if so
with what status, e.g.:
(defcustom ox-icalendar-export-todo-keywords-as
'((no-export . ("SKIP"))
(cancelled . ("KILLED" "CANCELLED"))
(in-process . ("PROG"))))
By default, todo-keywords not in the list would be exported with status
"NEEDS-ACTION" or "COMPLETED", depending on whether the keyword is a
done state.
What do you think?