org-mode schedule weekly event for a period

There might not be a way to do that directly, but Org-mode allows you to specify times using the diary sexp style. (http://orgmode.org/org.html#Timestamps)

If you look at some of the examples in the manual for the diary functions (http://www.gnu.org/software/emacs/manual/html_node/emacs/Sexp-Diary-Entries.html#Sexp-Diary-Entries) you'll see that you can provide arbitrary code to define the occurrences of the event.


You can use the diary to do this, there's an explanation here if you follow the instructions (make sure you have a ~/diary file) then it will pick it up and add it to your agenda. You may need to alter your date format depending on your settings.


There is no way to do what you want --- ranges don't work for this (I asked on the org-mode list).

You can clone the appointment, setting the clones one week apart. This will give you one instance of the item for every day in the period. This might be cumbersome, or it might be just what you want.


I had a similar problem and found usefull the answer to "How can I create more complex appointments in my org-files?" in the FAQ at http://orgmode.org/worg/org-faq.html#Appointments/Diary You can even add exceptions for holidays. I was not able to make work the time though: when you add it the formula stops working :(

1) My example: Courses on Tuesdays and Thursdays falling in [2011-03-07 Mon]--[2011-06-25 Sat] minus [2011-05-15 Sun]--[2011-05-20 Fri] (a week of holiday):

** TEST Tuesday and Thursday in [2011-03-07 Mon]-[2011-06-20 Mon] minus holidays [2011-05-15 Sun]-[2011-05-22 Sun]
<%%(and (diary-block 3 7 2011 6 20 2011)(or (= 2 (calendar-day-of-week date) (= 4 (calendar-day-of-week date))))(not (diary-block 5 15 2011 5 22 2011)))>

If you decompose the boolean function, you get the following, which is self explanatory:

<%%(and (diary-block 3 7 2011 6 20 2011) 
(or (= 2 (calendar-day-of-week date) (= 4 (calendar-day-of-week date))))  
(not (diary-block 5 15 2011 5 22 2011))
)>

2) My suggestion for your case: a class every Tuesday every week from March to June (I took the liberty to fix the year to 2011):

<%%(and (= 2 (calendar-day-of-week date)) (diary-block 3 23 2011 6 23 2011)))>

You might want to have a look to the newly added section "How can I schedule a weekly class that lasts for a limited period of time?", about the function "org-diary-class", but it still seems to have problem with scheduling hours :(

Hope it helps,

Tags:

Emacs

Org Mode