From mboxrd@z Thu Jan 1 00:00:00 1970 From: Doug Hellmann Subject: patch to make org-mac-iCal work with calendar "groups" Date: Mon, 2 Nov 2009 09:24:30 -0500 Message-ID: <9A9B7E30-62EC-44BA-A9F9-E7BD33E7B9B7@gmail.com> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N4xpv-0005T1-OS for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:24:47 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N4xpr-0005S4-3N for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:24:47 -0500 Received: from [199.232.76.173] (port=46144 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N4xpq-0005Ri-Pv for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:24:42 -0500 Received: from mail-yx0-f191.google.com ([209.85.210.191]:47119) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1N4xpp-0002qn-HF for emacs-orgmode@gnu.org; Mon, 02 Nov 2009 09:24:41 -0500 Received: by yxe29 with SMTP id 29so4777944yxe.14 for ; Mon, 02 Nov 2009 06:24:41 -0800 (PST) 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: org-mode mailing list Cc: suckling@gmail.com Some calendar systems (Google, Zimbra) handle subscriptions to multiple calendars (or to an account) by grouping them under a single caldav directory in the calendar tree. org-mac-iCal assumes there is only one ics file created per caldav directory, so while it *creates* all of the needed merged ics files, it only copies one of them to ~/ Library/Calendar before importing the contents into the diary. The patch below fixes the problem. Doug -------------------- diff --git a/contrib/lisp/org-mac-iCal.el b/contrib/lisp/org-mac-iCal.el index 015eab4..0d0b4f8 100644 --- a/contrib/lisp/org-mac-iCal.el +++ b/contrib/lisp/org-mac-iCal.el @@ -96,17 +96,20 @@ the the Emacs diary" (omi-checked x)) all-calendars))) - ;; for each caledar, concatenate individual events into a single ics file + ;; for each calendar, concatenate individual events into a single ics file (with-temp-buffer (shell-command "sw_vers" " *temp*") (when (re-search-backward "10.5" nil t) (omi-concat-leopard-ics all-calendars))) - ;; move any caldav ics files to the same place as local ics files + ;; move all caldav ics files to the same place as local ics files (mapc (lambda (x) - (when (directory-files x 1 ".*ics$") - (rename-file (car (directory-files x 1 ".*ics$")) (concat "~/ Library/Cal + (mapc + (lambda (y) + (rename-file (concat x "/" y); + (concat "~/Library/Calendars/" y))) + (directory-files x nil ".*ics$"))) caldav-folders) ;; check calendar has contents and import