From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nick Dokos Subject: Re: Using properties for diary-anniversaries Date: Sun, 23 Jan 2011 16:03:54 -0500 Message-ID: <334.1295816634@gamaville.dokosmarshall.org> References: <1295793360.20637.1416756473@webmail.messagingengine.com> Reply-To: nicholas.dokos@hp.com Return-path: Received: from [140.186.70.92] (port=36576 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Ph76g-0005mK-JK for emacs-orgmode@gnu.org; Sun, 23 Jan 2011 16:04:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ph76f-0006jX-Ea for emacs-orgmode@gnu.org; Sun, 23 Jan 2011 16:04:18 -0500 Received: from vms173011pub.verizon.net ([206.46.173.11]:64126) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ph76f-0006jN-Ba for emacs-orgmode@gnu.org; Sun, 23 Jan 2011 16:04:17 -0500 Received: from gamaville.dokosmarshall.org ([unknown] [173.76.32.106]) by vms173011.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0LFH009V7UIJM420@vms173011.mailsrvcs.net> for emacs-orgmode@gnu.org; Sun, 23 Jan 2011 15:03:55 -0600 (CST) In-reply-to: Message from lecodesportif@eml.cc of "Sun, 23 Jan 2011 06:36:00 PST." <1295793360.20637.1416756473@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: nicholas.dokos@hp.com, emacs-orgmode@gnu.org lecodesportif@eml.cc wrote: > > I have an anniversary list in Org Mode where entries have this format: > > * John > :PROPERTIES: > :Name: John > :Birthday: 5 4 1900 > :END: > > I would like to add the "Birthday" and "Name" properties to Org Agenda > automatically. What I have so far is: > > %%(apply 'diary-anniversary (read (org-entry-get nil "Birthday"))) John > > When I enter this line right after the properties, the anniversary is > added at the correct date in the agenda. But I still have to enter the > name manually. > > Is there a way to have the "Name" property added to the diary text > automatically? Can this be done for all entries in the list by adding > code at the top of the org file? Not really an answer to your question - it's a different method that I find convenient. I use bbdb for contacts and so I prefer to add birthday/anniversary information to selected bbdb entries. Then one of the org files in my org-agenda-files includes the following entry: --8<---------------cut here---------------start------------->8--- #+CATEGORY: Anniv %%(org-bbdb-anniversaries) --8<---------------cut here---------------end--------------->8--- This causes entries in my agenda like this: ,---- | Friday 28 January 2011 | ... | Anniv: Birthday: [[bbdb:John][John (32nd)]] `---- with a link to the bbdb entry that you can open with org-open-at-point to get more information (e.g. an email address that you can send birthday wishes to). The bbdb entry for "John" is presented by bbdb like this: John: net: john@foo.com anniversary: 1979-01-28 birthday 2009-02-28 wedding and the entry in the bbdb database looks like this: ["John" nil nil nil nil ("john@foo.com") ((creation-date . "...") (timestamp . "...") (anniversary . "1979-01-22 birthday\n2009-02-28 wedding") ...) nil] The only difficulty was how to enter multiple anniversaries into an entry (as above): when you visit a bbdb entry, you create a new field with ``C-o'' called ``anniversary'' (bbdb knows about it and conveniently provides completion) or edit the existing ``anniversary'' field with ``e''. The value is entered literally, except that you have to quote any newlines, so you type: 1979-01-28 birthday C-q C-j 2009-02-28 wedding I added some spaces for readability above but you should *not* type any spaces except those explicitly called out as . HTH, Nick