The two possibilities I can think of are: 1) you have not added the file to your org-agenda-files
or 2) you have redefined calendar-date-style
to use a different order from the default month, day, year
.
To test the first possibility:
- start with
emacs -q
- create an Org mode file with the following contents:
* Anniversaries
%%(diary-anniversary 01 27 1948) Arthur's birthday (%d years old)
- save the buffer and add the file to the agenda list with
C-c [
- create an agenda with
M-x org-agenda RET a
Since you start with emacs -q
you are not going to have C-c a a
available to you - that's why I specified M-x org-agenda RET a
above.
The entry should appear in the agenda, regardless of what you have done in your init file (since -q
does not use it).
If you now start with emacs
i.e. with your init file, visit the file you created above, add it to the agenda list and create an agenda with C-c a a
(presumably the key binding is now available). If the entry appears, you are done: just make sure that the file is made part of your agenda list wherever org-agenda-files
is initialized.
If not, check calendar-date-style
with C-h v calendar-date-style
where you will see:
Your preferred style for writing dates.
The options are:
‘american’ - month/day/year
‘european’ - day/month/year
‘iso’ - year/month/day
This affects how dates written in your diary are interpreted.
If you have set that to european
e.g. you have to specify the date as (27 1 1948)
.
The Timestamps section of the Org mode manual warns about this in a footnote:
(2) When working with the standard diary expression functions, you
need to be very careful with the order of the arguments. That order
depends evilly on the variable ‘calendar-date-style’. For example, to
specify a date December 1, 2005, the call might look like ‘(diary-date
12 1 2005)’ or ‘(diary-date 1 12 2005)’ or ‘(diary-date 2005 12 1)’,
depending on the settings. This has been the source of much confusion.
Org mode users can resort to special versions of these functions, namely
‘org-date’, ‘org-anniversary’, ‘org-cyclic, and ~org-block’. These work
just like the corresponding ‘diary-’ functions, but with stable ISO
order of arguments (year, month, day) wherever applicable, independent
of the value of ‘calendar-date-style’.
I use ISO dates exclusively, so I prefer to use the suggested org-anniversary
form:
%%(org-anniversary 1948 01 27) Arthur's birthday (%d years old)
which is not affected by calendar-date-style
.
C-c [
, the key sequence is bound toorg-agenda-file-to-front
so you can ALWAYS use the extended commandM-x org-agenda-file-to-front
to do the same thing. This is used mostly for testing: it adds the file to the front of the currentorg-agenda-files
list, so its contents are scanned in order to construct the agenda, If the file is already a member of that list, you do NOT need to add it.