emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Piotr Zielinski" <piotr.zielinski@gmail.com>
To: Carsten Dominik <dominik@science.uva.nl>
Cc: emacs-orgmode <emacs-orgmode@gnu.org>
Subject: Re: Emacs-Calendar export to iCal/vcal
Date: Wed, 23 Aug 2006 22:53:12 +0100	[thread overview]
Message-ID: <3c12eb8d0608231453m720e8979leda736ca9198e4da@mail.gmail.com> (raw)
In-Reply-To: <4e8bb638b2644b433db5dd68f7968236@science.uva.nl>

Hi Phil,

Not directly relevant, but here's what I use to synchronize the
calendar information in the other direction: from iCalendar calendars
to emacs org-mode.  The whole setup is rather hacky and complicated (I
didn't really have time to make it more presentable) but it might be
still useful to some.

I have all my org-files in ~/myfiles/org/.  File calendars.txt,
contains URLs of remote calendars I'd like to include in my
org-agenda.  The first word in each line is the name of the local file
to which the remote calendar will periodically be downloaded:

---------- calendars.txt STARTS ----------
camtalks http://talks.cam.ac.uk/show/ics/5245
msresearchtalks http://www.srcf.ucam.org/users/pz215/msr.ics
---------- calendars.txt ENDS ----------

Once a day I execute the following script (from cron):

---------- update-calendars STARTS ----------
#!/bin/bash

orgdir=~/myfiles/org
diary=$orgdir/calendars.diary
emacs=$orgdir/local-calendars.el

> $diary
echo "(setq local-calendars '(" > $emacs

cat $orgdir/calendars.txt | \
{
    while read name url ; do
	wget -N -O $orgdir/$name.ics $url
	echo "#include \"$orgdir/$name.diary\"" >> $diary
	echo "\"$name\" " >> $emacs
    done
}

echo "))" >> $emacs
---------- update-calendars ENDS ----------

It downloads all the remote calendars described in "calendars.txt" and
creates two new files.  First, "calendars.diary", which is an emacs
diary meta-file that just includes the proper calendar files.

---------- calendars.diary STARTS ----------
#include "/home/pz215/myfiles/org/camtalks.diary"
#include "/home/pz215/myfiles/org/msresearchtalks.diary"
---------- calendars.diary ENDS ----------

The second file created by "update-calendars" is "local-calendars.el",
an elisp file that contains a list of calendars:

---------- local-calendars.el STARTS ----------
(setq local-calendars '(
"camtalks"
"msresearchtalks"
))
---------- local-calendars.el ENDS ----------

What remains is to convert the downloaded icalendar files into the
diary files included by "calendars.diary".  To this end, I have the
following lines in my ".emacs":

---------- .emacs SNIPPET STARTS ----------
(require 'calendar)
(european-calendar)
(load "~/myfiles/org/local-calendars.el")
(dolist (name local-calendars)
  (let ((ical (concat "/home/pz215/myfiles/org/" name ".ics"))
	(diary (concat "/home/pz215/myfiles/org/" name ".diary")))
    (when (file-newer-than-file-p ical diary)
      (with-current-buffer (find-file-noselect diary)
	(kill-region (point-min) (point-max))
	(icalendar-import-file ical diary)))))
---------- .emacs SNIPPET ENDS ----------

That's it.  If you want emacs to notify you about your appointments,
take a look at the function "appt-activate" in the appt library.  If
you use a desktop environment that uses the standard notification
deamon (e.g., GNOME), you can set up the appt library to use it.  Take
a look at the "send-notify" command from the "libnotify-bin" package
(Debian/Ubuntu).

Thanks,
Piotr


On 23/08/06, Carsten Dominik <dominik@science.uva.nl> wrote:
>
> Hi Phillip,
>
> have you read this?
>
> http://staff.science.uva.nl/~dominik/Tools/org/org.html#iCalendar-export
>
> If yes, can you be more specific about what you are missing?
>
> - Carsten
>
> On Aug 23, 2006, at 22:46, Philipp Raschdorff wrote:
>
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Hi,
> >
> > I'm using emacs +org-mode mainly for organizing todos and for
> > brainstorming in project planing and organizing tasks etc. So it's
> > mainly a (very powerfull) outliner.
> >
> > I playes arround with the DUE & DEADLINE features and realized that
> > there is one thing missing for me:
> >
> > synchronizing emacs-todos / appointments to iCal (Mac OS X 10.4)
> >
> > To make it easier: I really would like to have it one way: Adding data
> > from emacs to an iCal-file.
> >
> > I'm using my mobile phone to synchronize with my calendar (iCal) and
> > it would be nice to have EMacs copying data to iCal and then have this
> > data on my mobile phone after the next sync.
> >
> > What do you think? Are you using the emacs-calendar-functions and how
> > to you synchronize to other applications?
> >
> > Any suggestions would be great.
> >
> > Best regards from Berlin / Germany
> >
> > Phil
> > -----BEGIN PGP SIGNATURE-----
> > Version: GnuPG v1.4.3 (Darwin)
> >
> > iD8DBQFE7L7HmbjPeL8dZWgRAt29AJ9JyQJK5Ps3UJyAuFDGGhlZq+WdQgCeIMvj
> > Sl/n5RM1yFFlpSX8umWWH8A=
> > =+rV9
> > -----END PGP SIGNATURE-----
> >
> >
> > _______________________________________________
> > Emacs-orgmode mailing list
> > Emacs-orgmode@gnu.org
> > http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> >
> >
>
> --
> Carsten Dominik
> Sterrenkundig Instituut "Anton Pannekoek"
> Universiteit van Amsterdam
> Kruislaan 403
> NL-1098SJ Amsterdam
> phone: +31 20 525 7477
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>


-- 
Piotr Zielinski, Research Associate
Cavendish Laboratory, University of Cambridge, UK
http://www.cl.cam.ac.uk/~pz215/

  reply	other threads:[~2006-08-23 21:53 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-23 20:46 Emacs-Calendar export to iCal/vcal Philipp Raschdorff
2006-08-23 21:36 ` Carsten Dominik
2006-08-23 21:53   ` Piotr Zielinski [this message]
2006-08-23 22:45   ` Philipp Raschdorff
2006-08-24  6:36     ` Carsten Dominik
2006-08-23 22:15 ` Pete Phillips
2006-09-01 15:50 ` Carsten Dominik

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=3c12eb8d0608231453m720e8979leda736ca9198e4da@mail.gmail.com \
    --to=piotr.zielinski@gmail.com \
    --cc=dominik@science.uva.nl \
    --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).