emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Jack Kamm <jackkamm@gmail.com>
To: "Michaël Cadilhac" <michael@cadilhac.name>,
	"Org-Mode mailing list" <emacs-orgmode@gnu.org>
Subject: Re: ox-icalendar: Filter todo-types
Date: Sat, 22 Jun 2024 16:28:41 -0700	[thread overview]
Message-ID: <874j9ko8uu.fsf@gmail.com> (raw)
In-Reply-To: <CADt3fpMUPWvmqZTfuiAy07ccw++tAY6650DA=F_8QJiDQXq3+A@mail.gmail.com>

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?


  reply	other threads:[~2024-06-22 23:29 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-22 16:33 ox-icalendar: Filter todo-types Michaël Cadilhac
2024-06-22 23:28 ` Jack Kamm [this message]
2024-06-23 11:27   ` Ihor Radchenko
2024-06-23 12:03     ` Michaël Cadilhac
2024-06-23 13:16       ` Ihor Radchenko
2024-06-24  6:38         ` Jack Kamm
2024-06-24  7:23           ` Ihor Radchenko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=874j9ko8uu.fsf@gmail.com \
    --to=jackkamm@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=michael@cadilhac.name \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).