Re: [O] ICS import?

2012-05-14 Thread Nick Dokos
[previous message sent prematurely]

I meant to add that I'll submit it to the emacs bugs list for
their consideration.

I also meant to fix the footnote but too late for that :-)

Nick



Re: [O] ICS import?

2012-05-14 Thread Nick Dokos
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] 



Re: [O] ICS import?

2012-01-25 Thread Russell Adams
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.


--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [O] ICS import?

2012-01-25 Thread Nick Dokos
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.

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 ;-)

Nick



Re: [O] ICS import?

2012-01-25 Thread Arun Persaud
Hello

> I only need import. Two way sync is (currently) not required. I just
> need to get data into Org. Famous last words I know. ;]

perhaps you can modify the script on the following page to do what you want:
http://orgmode.org/worg/org-tutorials/org-google-sync.html

The script can be used to import from google calendar into org mode, but
doesn't handle all ics cases, timezones, etc. It's working for me (but
then again, I don't use google calendar that often).

It would be nice to have this directly in emacs using icalender or
something similar though and real two way-sync would be great ;)

Arun



Re: [O] ICS import?

2012-01-25 Thread Russell Adams
On Wed, Jan 25, 2012 at 04:26:27PM -0600, Matthew Sauer wrote:
> Forgot to add the list in -- I know that the last time I remember
> seeing google-calendar to org-sync the problem was that it wasn't a
> true sync but just an import.  In other words you could download but
> couldn't change something and have it auto-update on the other.
> Anyone have a better update?
> >
> >> Well, Google has a feature that I use called Google Calendar Sync. ?It
> >> takes my default Google Calendar and syncs it with my outlook that is
> >> running off my exchange at work.

I only need import. Two way sync is (currently) not required. I just
need to get data into Org. Famous last words I know. ;]

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.

Thanks.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3



Re: [O] ICS import?

2012-01-25 Thread Matthew Sauer
Forgot to add the list in -- I know that the last time I remember
seeing google-calendar to org-sync the problem was that it wasn't a
true sync but just an import.  In other words you could download but
couldn't change something and have it auto-update on the other.
Anyone have a better update?
>
>> Well, Google has a feature that I use called Google Calendar Sync.  It
>> takes my default Google Calendar and syncs it with my outlook that is
>> running off my exchange at work.
>>
>
> Yup - that half of it is no problem. The problem is the
> google-calendar-to-org sync which presumably does not exist yet and
> would have to be written - or maybe someone has done that already?
>
> There has been some discussion about google calendar on the list but I
> haven't followed it too closely: is there anybody who does the
> google-calendar-to-org sync routinely?
>
> Nick
>
>> > Matthew Sauer  wrote:
>> >
>> >> I almost wonder if it would be easier to complete a good sync with
>> >> google calendar and just sync outlook with google calendar and sync
>> >> org with the google calendar -- or is that too many steps?
>> >>
>> >
>> > Does google calendar use something other than ics? If so, what?
>> >
>> > I don't think the number of steps is excessive, but if it does
>> > use ics, then cutting out the middleman makes sense. If not, it
>> > would depend on whether the org-to-google calendar sync is easier.
>> >
>> > Nick
>> >
>>



Re: [O] ICS import?

2012-01-25 Thread Nick Dokos
Russell Adams  wrote:

> I constantly get invitations from Exchange users in .ics files that I
> would love to import into Org. Currently I manually input meetings
> into my Agenda files.
> 
I share your pain.

> The format of ics files is hideous, so before I started to study the
> format and write something new I thought I'd make sure I didn't
> reinvent the wheel.
> 
I've been threatening to do something like this for years, but my efforts
have stalled repeatedly for lack of time.

> Is there a way to import ics files into Org? Especially with proper
> timezone conversions?
> 

Not that I know of.

In my last foray, I thought I would start with icalendar.el (afaik, part
of the standard emacs distribution); the trouble was that icalendar.el
was heavily biased towards, and intertwined with, the standard
calendar/diary combo. So my approach was going to be to split it into a
library part and a back end part: the library part would do the parsing,
returning a standard representation of the ics file and the back ends
(one for diary, one for org) would go from the standard rep to the
backend specific one.

Also, iirc, icalendar.el was an incomplete implementation of the format:
in particular, I vaguely recall that it had TZ troubles with at least
some of the Exchange-produces ics files (but that might have been a bug
in Exchange as well - I don't remember).

But after all these years, I'm still using the same manual method you
are using :-( So if you decide to go ahead, I for one would be
eternally grateful.

Nick

PS There have been occasional outbursts on the ML about ICS, so you
probably should search the list for what others might have done.



[O] ICS import?

2012-01-25 Thread Russell Adams
I constantly get invitations from Exchange users in .ics files that I
would love to import into Org. Currently I manually input meetings
into my Agenda files.

The format of ics files is hideous, so before I started to study the
format and write something new I thought I'd make sure I didn't
reinvent the wheel.

Is there a way to import ics files into Org? Especially with proper
timezone conversions?

Thanks.

--
Russell Adamsrlad...@adamsinfoserv.com

PGP Key ID: 0x1160DCB3   http://www.adamsinfoserv.com/

Fingerprint:1723 D8CA 4280 1EC9 557F  66E8 1154 E018 1160 DCB3