lecodespor...@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: j...@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 ("j...@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 <SP> birthday C-q C-j 2009-02-28 <SP> wedding <RET>

I added some spaces for readability above but you should *not* type any spaces
except those explicitly called out as <SP>.

HTH,
Nick

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

Reply via email to