From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo de Moraes Serpa Subject: Re: Exclude some files from Date: Tue, 4 Oct 2011 11:16:41 -0500 Message-ID: References: <24332.1317743622@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=0015175cffe8b685ac04ae7b6af5 Return-path: Received: from eggs.gnu.org ([140.186.70.92]:38799) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB7fi-0005bN-Q9 for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 12:16:47 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RB7fe-0001ka-KQ for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 12:16:46 -0400 Received: from mail-bw0-f41.google.com ([209.85.214.41]:53429) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RB7fe-0001kO-FD for emacs-orgmode@gnu.org; Tue, 04 Oct 2011 12:16:42 -0400 Received: by bkbzs2 with SMTP id zs2so992646bkb.0 for ; Tue, 04 Oct 2011 09:16:41 -0700 (PDT) In-Reply-To: <24332.1317743622@alphaville.dokosmarshall.org> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: nicholas.dokos@hp.com Cc: emacs-orgmode@gnu.org --0015175cffe8b685ac04ae7b6af5 Content-Type: text/plain; charset=ISO-8859-1 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 > --0015175cffe8b685ac04ae7b6af5 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Thank Nick. I'll test it out.=A0

On T= ue, Oct 4, 2011 at 10:53 AM, Nick Dokos <nicholas.dokos@hp.com> wrote:
=
Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:

> *bump* ... I am being too stupid :) I could not find it in the documen= tation.
>
> Thanks,
>
> - M
>
> On Mon, Oct 3, 2011 at 1:48 PM, Marcelo de Moraes Serpa <celoserpa@gmail.com> wrote:
>
> =A0 =A0 Hey guys,
>
> =A0 =A0 I'm using org-export-icalendar-combine-agenda-files to exp= ort the agenda files into one .ics
> =A0 =A0 file. However, I'd like to exclude a particular org file f= rom 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 ()
| =A0 "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'= ;."
| =A0 (interactive)
| =A0 (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 ()
=A0 =A0 =A0 (interactive)
=A0 =A0 =A0 (apply 'org-export-icalendar t
=A0 =A0 =A0 =A0 =A0 =A0 =A0(mdm/exclude '("~/org/foo.org" "~/org/bar.org") (org-agenda-files t))))

(defun mdm/exclude (items lst)
=A0(if (null lst)
=A0 =A0 =A0lst
=A0 =A0(if (member (car lst) items)
=A0 =A0 =A0 =A0(mdm/exclude items (cdr lst))
=A0 =A0 =A0(cons (car lst) (mdm/exclude items (cdr lst))))))

Mostly untested.

Nick

--0015175cffe8b685ac04ae7b6af5--