From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Piotr Zielinski" Subject: Re: Emacs-Calendar export to iCal/vcal Date: Wed, 23 Aug 2006 22:53:12 +0100 Message-ID: <3c12eb8d0608231453m720e8979leda736ca9198e4da@mail.gmail.com> References: <78B08AAF-5557-4770-AE7D-42DF67B2A0AB@macnews.de> <4e8bb638b2644b433db5dd68f7968236@science.uva.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1GG0ey-0004bt-Hi for emacs-orgmode@gnu.org; Wed, 23 Aug 2006 17:53:16 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1GG0ew-0004aL-RR for emacs-orgmode@gnu.org; Wed, 23 Aug 2006 17:53:16 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GG0ew-0004a8-Kh for emacs-orgmode@gnu.org; Wed, 23 Aug 2006 17:53:14 -0400 Received: from [64.233.184.234] (helo=wr-out-0506.google.com) by monty-python.gnu.org with esmtp (Exim 4.52) id 1GG0mr-0006GN-DT for emacs-orgmode@gnu.org; Wed, 23 Aug 2006 18:01:25 -0400 Received: by wr-out-0506.google.com with SMTP id 71so121177wra for ; Wed, 23 Aug 2006 14:53:13 -0700 (PDT) In-Reply-To: <4e8bb638b2644b433db5dd68f7968236@science.uva.nl> Content-Disposition: inline List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: emacs-orgmode 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 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/