emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [O] ICS import?


From: Nick Dokos
Subject: Re: [O] ICS import?
Date: Mon, 14 May 2012 22:57:56 -0400

Russell Adams <address@hidden> wrote:

> On Wed, Jan 25, 2012 at 07:21:06PM -0500, Nick Dokos wrote:
> > Russell Adams <address@hidden> 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] 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]