From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: ICS import? Date: Mon, 14 May 2012 22:57:56 -0400 Message-ID: <4895.1337050676@alphaville> References: <20120125173421.GQ3747@x201> <9802.1327513848@alphaville> <3023.1327520270@alphaville> <4180.1327526628@alphaville> <20120125235059.GZ3747@x201> <5794.1327537266@alphaville> <20120126005823.GC3747@x201> Reply-To: nicholas.dokos@hp.com Return-path: Received: from eggs.gnu.org ([208.118.235.92]:60257) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU7xb-0007Bc-4n for emacs-orgmode@gnu.org; Mon, 14 May 2012 22:58:04 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SU7xZ-0008Gp-5c for emacs-orgmode@gnu.org; Mon, 14 May 2012 22:58:02 -0400 Received: from g4t0014.houston.hp.com ([15.201.24.17]:9374) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SU7xY-0008Gh-VQ for emacs-orgmode@gnu.org; Mon, 14 May 2012 22:58:01 -0400 Received: from g4t0009.houston.hp.com (g4t0009.houston.hp.com [16.234.32.26]) by g4t0014.houston.hp.com (Postfix) with ESMTP id C945A240A9 for ; Tue, 15 May 2012 02:57:58 +0000 (UTC) Received: from ldl (ldl.usa.hp.com [16.125.112.222]) by g4t0009.houston.hp.com (Postfix) with ESMTP id B1567C2A7 for ; Tue, 15 May 2012 02:57:58 +0000 (UTC) Received: from localhost (ldl.fc.hp.com [127.0.0.1]) by ldl (Postfix) with ESMTP id 596E31A7E0D2 for ; Mon, 14 May 2012 20:57:58 -0600 (MDT) Received: from ldl ([127.0.0.1]) by localhost (ldl.fc.hp.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id uu7a2RZr65W3 for ; Mon, 14 May 2012 20:57:58 -0600 (MDT) Received: from alphaville.dokosmarshall.org (squirrel.fc.hp.com [15.11.146.57]) by ldl (Postfix) with ESMTP id D20351A7E0D6 for ; Mon, 14 May 2012 20:57:57 -0600 (MDT) Received: from alphaville (localhost [127.0.0.1]) by alphaville.dokosmarshall.org (Postfix) with ESMTP id CFED440093 for ; Mon, 14 May 2012 22:57:56 -0400 (EDT) In-Reply-To: Message from Russell Adams of "Wed, 25 Jan 2012 18:58:23 CST." <20120126005823.GC3747@x201> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org Russell Adams wrote: > On Wed, Jan 25, 2012 at 07:21:06PM -0500, Nick Dokos wrote: > > Russell Adams wrote: > > > > > It's awkward having to mail folks back and ask that they resend the > > > date/time and details as text for me, just so I can manually enter > > > them into my calendar. > > > > > > > You don't need to do that: you can save the text/calendar attachment in > > a file and then use icalendar-import-file on the file to get it into > > your diary. > > > > You can then copy the data from your diary or if you do > > > > (setq org-agenda-include-diary t) > > > > it will then show up in your agenda and you can copy the data from > > *there* into your appt.org or wherever. > > Wow! I had no idea that functionality was available. I just don't use > diary... I'd prefer to use a capture buffer. > > I need to look into this further. > > > I suspect this is quicker (and certainly less awkward) than asking them > > to send you text. The only downside is that you will not be a thorn on their > > side any more, so they will feel free to continue with their uncivilized > > ways - barbarians ;-) > > At least ics isn't xml. Then they'd be sparkly undead barbarians. > > Just in case you actually use this method, there is a nasty bug in icalendar.el that caused havoc with timezones (and no-shows at meetings). The problem is that the vcalendar attachment contained time zone specs like this: TZID:(UTC+01:00) Amsterdam\, Berlin\, Bern\, Rome\, Stockholm\, Vienna with escaped commas, but icalendar.el did not unescape the commas on import so when it tried to match timezones, it failed and left the time unchanged (i.e at the sender's timezone, instead of the receiver's). The patch to fix that is simple enough, and good enough for my purposes, although it's not clear whether it's enough for all cases and/or the best possible[fn:1] (box-quoted to make it not look like a patch and therefore keep it off patchwork - hope that works): ,---- | diff --git a/icalendar.el b/icalendar.el | index f1549ec..5d85b83 100644 | --- a/icalendar.el | +++ b/icalendar.el | @@ -491,7 +491,7 @@ The strings are suitable for assembling into a TZ variable." | (defun icalendar--parse-vtimezone (alist) | "Turn a VTIMEZONE ALIST into a cons (ID . TZ-STRING). | Return nil if timezone cannot be parsed." | - (let* ((tz-id (icalendar--get-event-property alist 'TZID)) | + (let* ((tz-id (icalendar--convert-string-for-import (icalendar--get-event-property alist 'TZID))) | (daylight (cadr (cdar (icalendar--get-children alist 'DAYLIGHT)))) | (day (and daylight (icalendar--convert-tz-offset daylight t))) | (standard (cadr (cdar (icalendar--get-children alist 'STANDARD)))) `---- Footnotes: [fn:1]