On Sat, 10 Jul 2010 08:53:42 +0200, Jordi Inglada wrote: > > Eric, > > Thanks for your reply. Now I understand. > > The advice function is now called when I add a diary entry, however, > when I load emacs I get this message: > > Warning: reference to free variable `d1' > > And when I add a diary entry, I get an error message like this: > > org-agenda-diary-entry-in-org-file: Wrong number of arguments: [...] [ad-return-value d1 dates > entry d2 day1 nil > ad-Orig-org-agenda-add-entry-to-org-agenda-diary-file 2 block ...] 17 > #("Advice doc string" 0 17 (ad-advice-info > org-agenda-add-entry-to-org-agenda-diary-file))], 3 > > > I am not sure to use the right syntax for the diary entry. I think this is more than likely due to you using a older version of org mode. What version are you using? (try "M-x org-version RET").