From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?utf-8?Q?S=C3=A9bastien_Vauban?= Subject: Re: org google weather Date: Sat, 05 Mar 2011 00:03:44 +0100 Message-ID: <801v2mmqsv.fsf@somewhere.org> References: <87oc5rlwc4.wl%lists@700c.org> <4D70A577.4000509@manor-farm.org> <80k4gfnth7.fsf@somewhere.org> <4D70CCB6.5080101@manor-farm.org> <8736.1299256681@alphaville.dokosmarshall.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: 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-mXXj517/zsQ@public.gmane.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org-mXXj517/zsQ@public.gmane.org To: emacs-orgmode-mXXj517/zsQ@public.gmane.org Hi Nick, Nick Dokos wrote: > Ian Barton wrote: >> > Ian Barton wrote: >> >>> Has anybody tried adding the functionality of %%(diary-sunrise-sunse= t) >> >>> (sunrise, sunset time and daylight hours) to the google weather code? >> >> >> >> I just have something like: >> >> >> >> #+CATEGORY: Day/Year >> >> &%%(diary-day-of-year) >> >> #+CATEGORY: Sunrise >> >> &%%(diary-sunrise-sunset) >> >> >> >> in one of my Agenda files. Sunrise then appears at sunrise time in my >> >> Agenda like: >> >> >> >> Sunrise: 6:53...... Sunrise (GMT), sunset 5:52pm (GMT) at >> >> Wilkesley (10:58 hours daylight) >> > >> > Do you have a way to get the sunset located on a line on its own >> > (different line from the sunrise one)? That'd be even much nicer... >> >> No, but I would like one:) If there were separate diary functions for >> sunrise and sunset it would be easy. Maybe I need to look at the diary >> elisp and write my own separate functions. > > Quick hack just parsing the output of diary-sunrise-sunset. Excellent hack, for at least 2 reasons: the feature itself, and showing us = the way how to enhance the agenda... Thanks a lot. > I added this early in my org-config file (which is sourced by .emacs) > [...] and this to one of my agenda files: > > #+CATEGORY: Weather > %%(diary-sunrise) > %%(diary-sunset) > > and I get: > > ,---- > | Friday 4 March 2011 > | Weather: 6:16...... Sunrise (EST) > | 8:00...... ---------------- > | 10:00...... ---------------- > | 12:00...... ---------------- > | 14:00...... ---------------- > | 16:00...... ---------------- > | Weather: 17:36...... Sunset (EST) > | 18:00...... ---------------- > | 20:00...... ---------------- > `---- Because of this: #+begin_src emacs-lisp (setq org-agenda-default-appointment-duration 60) #+end_src I get: ,---- | 2011-03-05 Sat | 0:01-1:01 now ____ | Weather: 7:18-8:18 Sunrise (+0100) | 8:00-9:00 ________ | 10:00-11:00 ________ | 12:00-13:00 ________ | 14:00-15:00 ________ | 16:00-17:00 ________ | 18:00-19:00 ________ | Weather: 18:24-19:24 Sunset (+0100) `---- i.e, a not-that-clear indication of when the sunrise/sunset is supposed to happen. In this case, it's clearly a one-minute event. Is there, then, a way to avo= id the "+ 1 hour" range computation for it, while keeping the above variable f= or other common tasks? Best regards, Seb --=20 S=C3=A9bastien Vauban