Thank Nick. I'll test it out. On Tue, Oct 4, 2011 at 10:53 AM, Nick Dokos wrote: > Marcelo de Moraes Serpa wrote: > > > *bump* ... I am being too stupid :) I could not find it in the > documentation. > > > > Thanks, > > > > - M > > > > On Mon, Oct 3, 2011 at 1:48 PM, Marcelo de Moraes Serpa < > celoserpa@gmail.com> wrote: > > > > Hey guys, > > > > I'm using org-export-icalendar-combine-agenda-files to export the > agenda files into one .ics > > file. However, I'd like to exclude a particular org file from this > export. How could I do it? > > > > Can't do it with org-export-icalendar-combine-agenda-files as it stands, > but > if you look at the code, all it does is: > > ,---- > | (defun org-export-icalendar-combine-agenda-files () > | "Export all files in `org-agenda-files' to a single combined iCalendar > file. > | The file is stored under the name `org-combined-agenda-icalendar-file'." > | (interactive) > | (apply 'org-export-icalendar t (org-agenda-files t))) > `---- > > so it just applies org-export-icalendar to the list of file that > org-agenda-files > returns. All you have to do is massage that list a bit: > > (defun mdm/org-export-icalendar-combine-agenda-files-with-exclusions () > (interactive) > (apply 'org-export-icalendar t > (mdm/exclude '("~/org/foo.org" "~/org/bar.org") > (org-agenda-files t)))) > > (defun mdm/exclude (items lst) > (if (null lst) > lst > (if (member (car lst) items) > (mdm/exclude items (cdr lst)) > (cons (car lst) (mdm/exclude items (cdr lst)))))) > > Mostly untested. > > Nick >