开发者

org-mode schedule weekly event for a period

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 in开发者_StackOverflowdefinitely 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?


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,


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.


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.


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.


Something like this should do the trick, and it should schedule hours

%%(org-diary-class 2011 5 31 2011 10 13 2) 5:00pm-6:30pm German Class
%%(org-diary-class 2011 5 31 2011 10 13 4) 6:45pm-8:15pm German Class

Where the numbers represent Start Y M D Finish Y M D DayOfWeek (Sun = 0, Mon = 1 ...)


This works for me already many years:

* Modeling of curves and surfaces II 13:10-14:40
    <%%(org-class 2019 2 18 2019 5 17 4 13)>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜