From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Sven Bretfeld" Subject: Re: Adding entries to Google calendar Date: 4 Sep 2010 21:49:25 +0200 Message-ID: <87wrr1z3ui.fsf@rub.de> References: <8739tp1tez.fsf@gmx.ch> <8739tp5uyc.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Received: from [140.186.70.92] (port=54329 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Oryjc-0005Tu-Te for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 15:49:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Oryjb-0000V7-FE for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 15:49:08 -0400 Received: from mx6.rz.ruhr-uni-bochum.de ([134.147.64.30]:47721) by eggs.gnu.org with smtp (Exim 4.69) (envelope-from ) id 1Oryjb-0000U8-3n for emacs-orgmode@gnu.org; Sat, 04 Sep 2010 15:49:07 -0400 In-Reply-To: <8739tp5uyc.wl%ucecesf@ucl.ac.uk> (Eric S. Fraga's message of "Sat, 04 Sep 2010 17:34:19 +0100") 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: emacs-org Hi Eric Eric S Fraga writes: > I'm not sure what you mean about complete. It requires you to have > installed the Google command line tools (googlecl from Google Code). > However, this emacs lisp code is not what I would call full-featured > ;-) There were several problems, most of which I have solved by now. First, I didn't set org-agenda-diary-file. So, calling "i" from an agenda-view merely opened the default diary file. That's why I wondered when exactly the advice comes into play. (Therefore I suspected the code to be possibly incomplete -- sorry, my fault.) Now, the principle procedure works. Entries show up in Google after I added them with org-agenda-diary-entry. There is one thing left. You have structured the shell-command according to the American GoogleCL syntax. That's not working with the German locale. For a German GoogleCalendar the only syntax I found working is: google calendar add --cal org "Test am 5.9.2010 um 14:00-16:00" It's not problem, of course, to change the format of the shell-command. But, the German GoogleCalendar doesn't seem to understand commands with the time of day as the first argument. For example: google calendar add --cal org "14:00-16:00 Test am 5.9.2010" results in an entry called "Test am" (instead of "Test") with the correct time of the day but on the wrong calendar day, it is inserted to today's column (Sat 4.9.2010 instead of Sun 5.9.2010). Strangely enough, the correct date occurs nowhere in the entry, so it was not interpreted as part of the text. This shows that we are dealing with a bug in GoogleCL. Alas, there seems no description of the possible syntactical variants available on the web. So I did try-and-error: with and without the "am" and "um", with the English "on", with ISO formated dates etc etc. Except the above structure 'text am date um time' no combination works. I fear, there are only two solutions: 1. As a workaround I have set my GoogleCalendar to the American locale. With that everything works fine. 2. We have to isolate the time of day from the diary-entry as a further variable (not as part of the variable "text"), so that Germans can format the command correctly. Can you help me with that? > However, the mechanism is there to support hooking into capture > specifically and possibly into org-time-stamp or org-schedule, say. I have tried to work out an advice to org-time-stamp and/or org-remember-finish today. But my Lisp is too weak. I couldn't figure out how to grab the data. > I don't use Google calendar for scheduled tasks or deadlines so the > latter don't matter to me; I use it for appointments and my work flow > is that I always bring up the agenda view to see if my time is free > before making the appointment. That's also my work flow, except of using org-remember "k-r" instead of "i". I like to have everything in one org-file. But I can get used to keep my appointments in a separate diary file. I can refile them to the appropriate places during the "weekly review" which, then, ends with the upload of a new ics file. Thanks for sharing your code and your help Sven