Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to set up birthdays with org-contacts? Error: Bad sexp

Tags:

emacs

org-mode

How can I set up anniversaries with org-contacts so that birthdays etc. are shown in my agenda.org file?

My agenda.org file contains the following, as mentioned on the bottom of org-contacts

#+STARTUP: showeverything
* Birthdays
  %%(org-contacts-anniversaries)

My contacts.org file contains (e.g.):

* My contact                                                   :my.tag:
:PROPERTIES:
:EMAIL:  address@hidden
:URL:
:WORK: 
:HOME: 
:MOBILE:
:LOCATION:
:BIRTHDAY: 2000-01-01
:NOTE: 
:END:

When I access agenda view via C-c a a, I obtain:

Bad sexp at line 3 in /Users/myusername/org/agenda.org: (org-contacts-anniversaries) [7 times]

Note that line three corresponds to "%%(org-contacts-anniversaries)"

I tried to contact the author of org-contacts but did not obtain an answer (so far). I am hoping someone has tried this before and it worked. I tried it under Emacs 24.0.91 (9.0) on Mac OS X 10.7.2

like image 643
Marius Hofert Avatar asked Nov 07 '11 13:11

Marius Hofert


2 Answers

I solved this problem by changing the org-contacts-files variable to a list rather than a string.

For example, going from:

(setq org-contacts-files "~/Org Files/contacts.org")

to:

(setq org-contacts-files '("~/Org Files/contacts.org"))

worked for me.

It looks like the org-contacts-filter function expects the org-contacts-files variable to be a list rather than a string.

like image 100
maxwell_power Avatar answered Sep 28 '22 18:09

maxwell_power


I got the error when there are contacts with the BIRTHDAY property but no value. Removing these entries eliminated the error.

like image 30
user3343350 Avatar answered Sep 28 '22 18:09

user3343350