emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Michaël Cadilhac" <michael@cadilhac.name>
To: Org-Mode mailing list <emacs-orgmode@gnu.org>
Subject: ox-icalendar: Filter todo-types
Date: Sat, 22 Jun 2024 18:33:43 +0200	[thread overview]
Message-ID: <CADt3fpMUPWvmqZTfuiAy07ccw++tAY6650DA=F_8QJiDQXq3+A@mail.gmail.com> (raw)

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

I do not see any way to filter on todo-type in org-calendar-entry, the
relevant bit thereof reading:

            (and scheduled
                 (pcase todo-type
                   (`todo (or (memq 'event-if-todo-not-done use-scheduled)
                              (memq 'event-if-todo use-scheduled)))
                   (`done (memq 'event-if-todo use-scheduled))
                   (_ (memq 'event-if-not-todo use-scheduled)))
                 (org-icalendar--vevent
                  entry scheduled (concat "SC-" uid)
                  (concat scheduled-summary-prefix summary)
                  loc desc cat tz class)))

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

Cheers,
Michaël


             reply	other threads:[~2024-06-22 16:35 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-06-22 16:33 Michaël Cadilhac [this message]
2024-06-22 23:28 ` ox-icalendar: Filter todo-types Jack Kamm
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='CADt3fpMUPWvmqZTfuiAy07ccw++tAY6650DA=F_8QJiDQXq3+A@mail.gmail.com' \
    --to=michael@cadilhac.name \
    --cc=emacs-orgmode@gnu.org \
    /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).