emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nick Dokos <nicholas.dokos@hp.com>
To: Marcelo de Moraes Serpa <celoserpa@gmail.com>
Cc: nicholas.dokos@hp.com, emacs-orgmode@gnu.org
Subject: Re: Exclude some files from
Date: Tue, 04 Oct 2011 11:53:42 -0400	[thread overview]
Message-ID: <24332.1317743622@alphaville.dokosmarshall.org> (raw)
In-Reply-To: Message from Marcelo de Moraes Serpa <celoserpa@gmail.com> of "Tue, 04 Oct 2011 10:13:50 CDT." <CACHMzOFKs645f8RNzh__FdFB5DjORZHt2MahsNyww9VvGxM0Wg@mail.gmail.com>

Marcelo de Moraes Serpa <celoserpa@gmail.com> 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

  reply	other threads:[~2011-10-04 15:53 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-10-03 18:48 Exclude some files from Marcelo de Moraes Serpa
2011-10-04 15:13 ` Marcelo de Moraes Serpa
2011-10-04 15:53   ` Nick Dokos [this message]
2011-10-04 16:16     ` Marcelo de Moraes Serpa

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=24332.1317743622@alphaville.dokosmarshall.org \
    --to=nicholas.dokos@hp.com \
    --cc=celoserpa@gmail.com \
    --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).