emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Doug Hellmann <doug.hellmann@gmail.com>
To: org-mode mailing list <emacs-orgmode@gnu.org>
Cc: suckling@gmail.com
Subject: patch to make org-mac-iCal work with calendar "groups"
Date: Mon, 2 Nov 2009 09:24:30 -0500	[thread overview]
Message-ID: <9A9B7E30-62EC-44BA-A9F9-E7BD33E7B9B7@gmail.com> (raw)

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

             reply	other threads:[~2009-11-02 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-11-02 14:24 Doug Hellmann [this message]
2009-11-03  4:39 ` patch to make org-mac-iCal work with calendar "groups" 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=9A9B7E30-62EC-44BA-A9F9-E7BD33E7B9B7@gmail.com \
    --to=doug.hellmann@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    --cc=suckling@gmail.com \
    /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).