Or something like the following (not bullet-proof I guess): (defmacro test-diary-sexp (date &rest body) `(let ((date ,date)) ,@body))
(test-diary-sexp (calendar-current-date) (org-google-weather "De Bilt" "nl")) ... and in calendar-current-date lies your answer to the format question. I do not know however whether or not `date' is the only variable that is bound dynamically for sexps though; this is something that make me go crazy too, so (better) documentation might be in order for one. On Mon, Apr 11, 2011 at 4:55 PM, Nick Dokos <nicholas.do...@hp.com> wrote: > Suvayu Ali <fatkasuvayu+li...@gmail.com> wrote: > >> On Mon, 11 Apr 2011 14:55:24 +0200 >> Niels Giesen <niels.gie...@gmail.com> wrote: >> >> > On Mon, Apr 11, 2011 at 1:57 PM, Rainer Stengele >> > <rainer.steng...@diplan.de> wrote: >> > > Am 11.04.2011 10:36, schrieb Suvayu Ali: >> > >> On Mon, 11 Apr 2011 08:52:52 +0200 >> > >> >> > >> %%(if (calendar-date-equal date (calendar-current-date)) >> > >> (diary-sunrise-sunset)) >> > >> >> > > Perfect, thanks. >> > > >> > > I can find the other functions in calendar.el, >> > > but where is "date" from? >> > > >> > >> > date is a dynamically bound variable at the time of evaluation. >> > >> >> I have a question I have been meaning to ask for a long time. How does >> one test sexps with variables like these? I have tried the scratch >> buffer but it gives errors like "(void-variable date)". I found the only >> way I could test is to put it on one of the agenda files. >> >> Any suggestions? >> > > Bind date explicitly in the scratch buffer and then evaluate: > > (setq date '(4 11 2011)) > > ... > > I think the format is (month day year) but be sure to check. > > Nick > -- http://pft.github.com