On Mon, May 5, 2014 at 11:08 PM, Arun Persaud <apersaud@lbl.gov> wrote:
pretty sure this can be done. I export only events to an ics file that
have a start and an end date and are not in a certain category. For this
I use

That's great, thank you. I have this, but it doesn't work:

(defun filter-scheduled-todo-tasks (content backend info)
  "Filter iCalendar export to include only TODO tasks that are
not done, but which are scheduled or have a deadline."
  (when (eq backend 'icalendar)
    (if (and (org-entry-is-todo-p)
             (not (org-entry-is-done-p))
             (or (org-get-scheduled-time (point))
                 (org-get-deadline-time (point))))
        content nil)))

... called with:

(let ((org-export-filter-final-output-functions
         '(filter-scheduled-todo-tasks)))
    (org-icalendar-combine-agenda-files))

I have (setq org-icalendar-include-todo t) too.

Using edebug, it seems that the `content' argument only iterates through the top-level headings of each of my agenda files. I was assuming it'd iterate through each subheading too --- do I need to do this manually?