From mboxrd@z Thu Jan 1 00:00:00 1970 From: julien cubizolles Subject: Re: Relative dates with sexep Date: Fri, 17 Sep 2010 16:41:55 +0200 Message-ID: <1284734515.7792.88.camel@localhost> References: <1284654438.7792.63.camel@localhost> <87tylo94tk.wl%ucecesf@ucl.ac.uk> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=47074 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Owc8b-00017I-JK for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 10:42:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1Owc8a-0004bP-F5 for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 10:42:05 -0400 Received: from smtp2-g21.free.fr ([212.27.42.2]:58941) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1Owc8Z-0004Yw-Mk for emacs-orgmode@gnu.org; Fri, 17 Sep 2010 10:42:04 -0400 In-Reply-To: <87tylo94tk.wl%ucecesf@ucl.ac.uk> 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: e.fraga@ucl.ac.uk Cc: org-mode Le vendredi 17 septembre 2010 =C3=A0 09:01 +0100, Eric S Fraga a =C3=A9cr= it : > On Thu, 16 Sep 2010 18:27:18 +0200, julien cubizolles wrote: > >=20 > > I'm trying to specify a date relative to another date in an org file. > > I've tried to adapt one of the examples from worg, with : > >=20 > > <%%(=3D 7 (- (calendar-absolute-from-gregorian date) > > (calendar-absolute-from-gregorian (02 02 2010))))> > >=20 > > to get the date one week after the 2nd of february 2010. Bad sexp... >=20 > Quote the date: ... '(02 02 2010) > as it is trying to evaluate the function "02" otherwise. I'm trying to make it reusable by defining a function in my .emacs : (defun diary-relative (n day) "Diary entry that will always appear N days from day" (=3D (calendar-absolute-from-gregorian date) (+ n (calendar-absolute-from-gregorian day)))) I try to use it with a sexp like : <%%(diary-relative (7 '(09 15 2010)))> which doesn't work. I really need to seriously read about lisp programming...