From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Using properties for diary-anniversaries Date: Tue, 25 Jan 2011 09:53:23 -0500 Message-ID: <10390.1295967203@gamaville.dokosmarshall.org> References: <1295793360.20637.1416756473@webmail.messagingengine.com><7298.1295831795@gamaville.dokosmarshall.org><1295857674.26398.1416871253@webmail.messagingengine.com> <26027.1295879818@gamaville.dokosmarshall.org> <1295961439.28177.1417118385@webmail.messagingengine.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=47655 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PhkHX-0005BJ-7n for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 09:54:12 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PhkHH-0004eV-Lt for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 09:53:53 -0500 Received: from vms173019pub.verizon.net ([206.46.173.19]:49039) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PhkHH-0004dz-IW for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 09:53:51 -0500 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173019.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LFL004TI2OZG420@vms173019.mailsrvcs.net> for emacs-orgmode@gnu.org; Tue, 25 Jan 2011 08:53:24 -0600 (CST) In-reply-to: Message from lecodesportif@eml.cc of "Tue, 25 Jan 2011 05:17:19 PST." <1295961439.28177.1417118385@webmail.messagingengine.com> 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: lecodesportif@eml.cc Cc: Nick Dokos , emacs-orgmode@gnu.org lecodesportif@eml.cc wrote: > On Mon, 24 Jan 2011 09:36 -0500, "Nick Dokos" > wrote: > > Yes, sorry: I figured that I had answered the wrong question after I > > sent it, but I was too tired to fix my mistake at that time. However, I > > could not make your formulation work for me at all. I still don't > > understand how it could possibly work: afaict, org-entry-get returns the > > birthday as a string, "5 4 1900", the read returns the month as a > > number, 5, and diary-anniversary should blow up because it needs at least > > two > > arguments (a month and a day) - and it does in my case. > > You're probably right, there was a typo in my example. The below text is > corrected, I had forgotten the parantheses for the date! > > * John > :PROPERTIES: > :Name: John > :Birthday: (5 4 1900) > :END: > %%(apply 'diary-anniversary (read (org-entry-get nil "Birthday"))) > John > > Does this work for you? > Yes it does, but having to remember to enter dates as lists in this particular context does not feel right. It'd be OK if all dates were entered as lists in org, but that's not the case. I'd rather parse a more obvious representation. > > Be that as it may, re. filling in the name, I don't know how to do it > > and I'm not sure that it can be done: the string after the function call > > is scanned for %d but no other evaluation is done. org just passes the > > string along and all of that work is done in diary-anniversary whose > > doc string says: > > > > ,---- > > | The diary entry can contain `%d' or `%d%s'; the %d will be replaced > > | by the number of years since the MONTH, DAY, YEAR, and the %s will > > | be replaced by the ordinal ending of that number (that is, `st', > > | `nd', `rd' or `th', as appropriate). The anniversary of February 29 > > | is considered to be March 1 in non-leap years. > > `---- > > Yes, it may require hacking diary-anniversary. > Or perhaps investigate Julien Danjou's org-contacts (still work in progress). Or give bbdb another chance... Nick