Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

org-mode schedule weekly event for a period

Tags:

emacs

org-mode

I would like to use agenda to keep track of my classes, assuming i have a com 355 class every week from march to june,

<2010-03-23 Tue 10:40-12:10 +1w>

this works but it schedules it indefinitely if i use,

<2010-03-23 Tue 10:40-12:10 +1w>-<2010-06-23>

it gets scheduled for everyday from march to june, how can i schedule this once a week for a period of time?

like image 860
Hamza Yerlikaya Avatar asked Mar 17 '10 17:03

Hamza Yerlikaya


4 Answers

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,

like image 192
Jeremy Avatar answered Nov 03 '22 02:11

Jeremy


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.

like image 39
brontitall Avatar answered Nov 03 '22 02:11

brontitall


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.

like image 2
Robert P. Goldman Avatar answered Nov 03 '22 02:11

Robert P. Goldman


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.

like image 2
Amos Avatar answered Nov 03 '22 02:11

Amos