From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Martins Subject: Re: Re: Organizing a students live Date: Wed, 10 Feb 2010 17:02:11 -0200 Message-ID: <6ac505ad1002101102i290108a6wf17a3dbf935e5790@mail.gmail.com> References: <877hskh81j.fsf@uni-mainz.de> <87oclv2osr.fsf@uni-mainz.de> <6ac505ad0912201454r1a9a951wbe4607adfa824376@mail.gmail.com> <6ac505ad0912210754x72a4e37cx674d3bf0af5cb4d6@mail.gmail.com> <0B9ABBC1-4CE1-4F14-B056-8BEBFCB5B0F0@gmail.com> <6ac505ad0912261651v553e4701y8299e3cd0ad0fdb9@mail.gmail.com> <7261F3CD-8614-462A-A47E-5C2B16374A51@gmail.com> <6ac505ad0912281309v53e8a923v6490c2f780c73a64@mail.gmail.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============0812151049==" Return-path: Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NfHpS-0006Pg-Ve for emacs-orgmode@gnu.org; Wed, 10 Feb 2010 14:02:27 -0500 Received: from [140.186.70.92] (port=55970 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NfHpM-0006F3-9J for Emacs-orgmode@gnu.org; Wed, 10 Feb 2010 14:02:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1NfHpH-0003Cl-9T for Emacs-orgmode@gnu.org; Wed, 10 Feb 2010 14:02:19 -0500 Received: from mail-bw0-f219.google.com ([209.85.218.219]:46363) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1NfHpG-0003B9-Bb for Emacs-orgmode@gnu.org; Wed, 10 Feb 2010 14:02:14 -0500 Received: by mail-bw0-f219.google.com with SMTP id 19so355077bwz.8 for ; Wed, 10 Feb 2010 11:02:12 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Carsten Dominik Cc: Matt Lundin , Emacs-orgmode@gnu.org --===============0812151049== Content-Type: multipart/alternative; boundary=001485f7c150f73997047f43ab3c --001485f7c150f73997047f43ab3c Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Someone could send me an example of the use of the org-diary-class ?? Daniel 2010/1/3 Carsten Dominik > > On Dec 28, 2009, at 10:09 PM, Daniel Martins wrote: > > > Interesting. But too complex for now - and I actually do prefer local >> control. >> >> I know it is complex. >> >> I thought about the first steps >> >> I was thinking about a variable (list?) with predefined holidays >> >> or better omit-holidays >> >> such as org-omit-holidays >> >> we could add the omit dates in any place >> (add-to-list 'org-omit-holidays "25 Dec") >> (add-to-list 'org-omit-holidays "1 Jan") >> (add-to-list 'org-omit-holidays "1 May") >> etc. >> >> > Hmm, this is a possibility - but I don't have the time now to implement i= t. > And then the question remains: What exactly should be omitted on these > days? > Everything? - probably not. So I don't see how this leads to useful > control, unless > we have a really fine-grained control for each entry. > > > >> Then we could change (adapt) the >> >> function calendar-check-holydays from holidays.el >> >> >> I did a search-replace to something like this: >> >> (defun org-check-calendar-omit-holidays (date) >> "Check the list of org-omit-holidays for any that occur on DATE. >> The value returned is a list of strings of relevant org-omit-holiday >> descriptions. >> The org-omit-holidays are those in the list `org-omit-holidays'." >> (let ((displayed-month (extract-calendar-month date)) >> (displayed-year (extract-calendar-year date)) >> (org-omit-holiday-list)) >> (dolist (h (calendar-org-omit-holiday-list)) >> (if (calendar-date-equal date (car h)) >> (setq org-omit-holiday-list (append org-omit-holiday-list (cdr >> h))))) >> org-omit-holiday-list)) >> >> with these adaptation we could use a slighly changed version of the >> "diary-schedule" function I sent before. >> >> I did not go further nor tested it. >> >> Thinking again now: I think it is better to avoid holidays than week >> numbers. The problem is that we have to decide which holidays are "reall= y" >> holidays and not rely on the holidays variables that come with Emacs. >> > > > I do not agree. Lectures are not only skipped on holidays, but also on > other > days, so a more general approach is needed. > > > >> >> Daniel >> >> 2009/12/28 Carsten Dominik >> Hi Daniel, >> >> >> On Dec 27, 2009, at 1:51 AM, Daniel Martins wrote: >> >> I liked the idea of org-diary-class! >> >> I have added the function now to org-agenda.el >> >> >> >> About avoiding holidays and certain weeks: >> >> I used remind and wyrd for a while and they are a quite good software >> for dealing with such appts. >> >> There we have the OMIT function where we determine holidays and other >> non-working days including Sat and Sundays >> >> >> Normally we have an OMIT list at the beginning of file >> >> Some functions simply omit those dates >> >> Other expressions use another keyword AFTER (or BEFORE) to change >> OMIT behaviour >> >> like >> 23 Mar AFTER OMIT "Bank payment" >> >> eg If 23 Mar is in Saturday it will appear in Monday >> >> This preamble is just to say 2 things: >> >> 1) remind/wyrd could be used as a benchmark for some of the calendar >> isuues we have >> >> 2) I do not know if the week number in a year is a practical way of >> setting exceptions to org-diary-class >> >> Daniel >> >> PS Wyrd page is >> >> http://pessimization.com/software/wyrd/ >> >> Interesting. But too complex for now - and I actually do prefer local >> control. >> >> - Carsten >> >> >> >> >> >> >> >> 2009/12/26 Carsten Dominik : >> Hi Daniel, >> >> I think it is a good idea to add such a function to org-mode. But I >> am not sure if skipping holidays is the best, because Universities >> also have lecture-free weeks etc. >> >> So I am more thinking about a function like this (untested) >> >> (defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks) >> "Entry applies if date is between dates on DAYNAME, but skips SKIP-WEEK= S. >> Order of the parameters is M1, D1, Y1, M2, D2, Y2 if >> `european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if >> `european-calendar-style' is t. The weeks are ISO week numbers where >> the item should not apply." >> (let* ((date1 (calendar-absolute-from-gregorian >> (if european-calendar-style >> (list d1 m1 y1) >> (list m1 d1 y1)))) >> (date2 (calendar-absolute-from-gregorian >> (if european-calendar-style >> (list d2 m2 y2) >> (list m2 d2 y2)))) >> (d (calendar-absolute-from-gregorian date))) >> (and >> (<=3D date1 d) >> (<=3D d date2) >> (=3D (calendar-day-of-week date) dayname) >> (or (not skip-weeks) >> (progn >> (require 'cal-iso) >> (not (member (car (calendar-iso-from-absolute d)) skip-weeks)))) >> entry))) >> >> >> What do you think? >> >> - Carsten >> >> On Dec 21, 2009, at 4:54 PM, Daniel Martins wrote: >> >> In fact, it helps! Thanks >> >> However a sentence like this: >> >> >> +# a class that meets every Monday evening between February 16 and >> April 20, 2009 >> ** Class 7:00pm-9:00pm >> <%%(and (=3D 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20 >> 2009))> >> >> is not an example of simplicity and visibility for a quite common featur= e! >> >> Maybe as a suggestion we could encapsulate such a huge expression in a >> simpler org-mode function ? >> >> Daniel >> >> >> PS In >> >> http://www.emacswiki.org/cgi-bin/wiki/DiaryMode#toc12 >> >> I found another suggestion which I do not know how to include in org-mod= e >> >> >> ------------------------------------ >> Schedule >> >> If you want to write a schedule for school or university, you need to >> define a block (it=92s derived from diary-block) between two dates and a >> weekday. The following function also recognizes holidays and won=92t >> send you to school on those days=85 :) >> >> (defun diary-schedule (m1 d1 y1 m2 d2 y2 dayname) >> "Entry applies if date is between dates on DAYNAME. >> Order of the parameters is M1, D1, Y1, M2, D2, Y2 if >> `european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if >> `european-calendar-style' is t. Entry does not apply on a history." >> (let ((date1 (calendar-absolute-from-gregorian >> (if european-calendar-style >> (list d1 m1 y1) >> (list m1 d1 y1)))) >> (date2 (calendar-absolute-from-gregorian >> (if european-calendar-style >> (list d2 m2 y2) >> (list m2 d2 y2)))) >> (d (calendar-absolute-from-gregorian date))) >> (if (and >> (<=3D date1 d) >> (<=3D d date2) >> (=3D (calendar-day-of-week date) dayname) >> (not (check-calendar-holidays date)) >> ) >> entry))) >> >> Then: "&%%(diary-schedule 22 4 2003 1 8 2003 2) 18:00 History" >> >> >> ------------------------------------ >> >> >> >> 2009/12/20 Matt Lundin : >> >> Daniel Martins writes: >> >> All academics here present (including of course Carsten) suffer from >> the same problem, I think >> >> >> *** Math classes >> <2009-12-10 Thu 11:00-14:00 +1w> >> >> >> will repeat forever and ever... >> >> We need to create a schedule for a period. >> >> The package "remind" (and its simple interface "wyrd") do this job >> wonderfully but I do not know how to deal with this problem in Org >> mode >> >> The following FAQ should help: >> >> http://orgmode.org/worg/org-faq.php#diary-sexp-in-org-files >> >> - Matt >> >> >> >> >> >> - Carsten >> >> >> >> >> > - Carsten > > > > --001485f7c150f73997047f43ab3c Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable Someone could send me an example of the use of the org-diary-class ??
Daniel

2010/1/3 Carsten Dominik <carsten.domini= k@gmail.com>

On Dec 28, 2009, at 10:09 PM, Daniel Martins wrote:

> Interesting. =A0But too complex for now - and I actually do prefer loc= al control.

I know it is complex.

I thought about the first steps

I was thinking about a variable (list?) with predefined holidays

or better omit-holidays

such as org-omit-holidays

we could add the omit dates in any place
=A0(add-to-list 'org-omit-holidays "25 Dec")
=A0(add-to-list 'org-omit-holidays "1 Jan")
=A0(add-to-list 'org-omit-holidays "1 May")
etc.


Hmm, this is a possibility - but I don't have the time now to implement= it.
And then the question remains: What exactly should be omitted on these days= ?
Everything? - probably not. =A0So I don't see how this leads to useful = control, unless
we have a really fine-grained control for each entry.



Then we could change (adapt) the

function calendar-check-holydays from holidays.el


I did a search-replace to something like this:

(defun org-check-calendar-omit-holidays (date)
=A0"Check the list of org-omit-holidays for any that occur on DATE. The value returned is a list of strings of relevant org-omit-holiday descri= ptions.
The org-omit-holidays are those in the list `org-omit-holidays'."<= br> =A0(let ((displayed-month (extract-calendar-month date))
=A0 =A0 =A0 =A0(displayed-year (extract-calendar-year date))
=A0 =A0 =A0 =A0(org-omit-holiday-list))
=A0 =A0(dolist (h (calendar-org-omit-holiday-list))
=A0 =A0 =A0(if (calendar-date-equal date (car h))
=A0 =A0 =A0 =A0 =A0(setq org-omit-holiday-list (append org-omit-holiday-li= st (cdr h)))))
=A0 =A0org-omit-holiday-list))

with these adaptation we could use a slighly changed =A0version of the &quo= t;diary-schedule" function =A0I sent before.

I did not go further nor tested it.

Thinking again now: I think it is better to avoid holidays than week number= s. The problem is that we have to decide which holidays are "really&qu= ot; holidays and not rely on the holidays variables that come with Emacs.


I do not agree. =A0Lectures are not only skipped on holidays, but also on o= ther
days, so a more general approach is needed.




Daniel

2009/12/28 Carsten Dominik <carsten.dominik@gmail.com>
Hi Daniel,


On Dec 27, 2009, at 1:51 AM, Daniel Martins wrote:

I liked the idea of org-diary-class!

I have added the function now to org-agenda.el



About avoiding holidays and certain weeks:

I used remind and wyrd for a while =A0and they are a quite good software for dealing with such appts.

There we have the OMIT function where we determine holidays and other
non-working days including Sat and Sundays


Normally we have an OMIT list at the beginning of file

Some functions simply omit those dates

Other expressions use another keyword AFTER (or BEFORE) =A0to change
OMIT behaviour

like
23 Mar AFTER OMIT "Bank payment"

eg If 23 Mar is in Saturday it will appear in Monday

This preamble is just to say 2 things:

1) remind/wyrd could be used as a benchmark for some of the calendar
isuues we have

2) I do not know if the week number in a year is a practical way of
setting exceptions to org-diary-class

Daniel

PS Wyrd page is

http:= //pessimization.com/software/wyrd/

Interesting. =A0But too complex for now - and I actually do prefer local co= ntrol.

- Carsten







2009/12/26 Carsten Dominik <carsten.dominik@gmail.com>:
Hi Daniel,

I think it is a good idea to add such a function to org-mode. =A0But I
am not sure if skipping holidays is the best, because Universities
also have lecture-free weeks etc.

So I am more thinking about a function like this (untested)

(defun org-diary-class (m1 d1 y1 m2 d2 y2 dayname &rest skip-weeks)
=A0"Entry applies if date is between dates on DAYNAME, but skips SKIP-= WEEKS.
Order of the parameters is M1, D1, Y1, M2, D2, Y2 if
`european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if
`european-calendar-style' is t. =A0The weeks are ISO week numbers where=
the item should not apply."
=A0(let* ((date1 (calendar-absolute-from-gregorian
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (if european-calendar-style
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list d1 m1 y1)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list m1 d1 y1))))
=A0 =A0 =A0 (date2 (calendar-absolute-from-gregorian
=A0 =A0 =A0 =A0 =A0 =A0 =A0 (if european-calendar-style
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list d2 m2 y2)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list m2 d2 y2))))
=A0 =A0 =A0 (d (calendar-absolute-from-gregorian date)))
=A0(and
=A0 (<=3D date1 d)
=A0 (<=3D d date2)
=A0 (=3D (calendar-day-of-week date) dayname)
=A0 (or (not skip-weeks)
=A0 =A0 =A0 (progn
=A0 =A0 =A0 =A0 (require 'cal-iso)
=A0 =A0 =A0 =A0 (not (member (car (calendar-iso-from-absolute d)) skip-wee= ks))))
=A0 entry)))


What do you think?

- Carsten

On Dec 21, 2009, at 4:54 PM, Daniel Martins wrote:

In fact, it helps! Thanks

However a sentence like this:


+# a class that meets every Monday evening between February 16 and
April 20, 2009
** Class 7:00pm-9:00pm
<%%(and (=3D 1 (calendar-day-of-week date)) (diary-block 2 16 2009 4 20<= br> 2009))>

is not an example of simplicity and visibility for a quite common feature!<= br>
Maybe as a suggestion we could encapsulate such a huge expression in a
simpler org-mode function ?

Daniel


PS In

http://www.emacswiki.org/cgi-bin/wiki/DiaryMode#toc12

I found another suggestion which I do not know how to include in org-mode

------------------------------------
Schedule

If you want to write a schedule for school or university, you need to
define a block (it=92s derived from diary-block) between two dates and a weekday. The following function also recognizes holidays and won=92t
send you to school on those days=85 :)

=A0(defun diary-schedule (m1 d1 y1 m2 d2 y2 dayname)
=A0 "Entry applies if date is between dates on DAYNAME.
=A0Order of the parameters is M1, D1, Y1, M2, D2, Y2 if
=A0`european-calendar-style' is nil, and D1, M1, Y1, D2, M2, Y2 if
=A0`european-calendar-style' is t. Entry does not apply on a history.&q= uot;
=A0 (let ((date1 (calendar-absolute-from-gregorian
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if european-calendar-style
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list d1 m1 y1)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list m1 d1 y1))))
=A0 =A0 =A0 =A0 (date2 (calendar-absolute-from-gregorian
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (if european-calendar-style
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list d2 m2 y2)
=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 (list m2 d2 y2))))
=A0 =A0 =A0 =A0 (d (calendar-absolute-from-gregorian date)))
=A0 =A0 (if (and
=A0 =A0 =A0 =A0 =A0(<=3D date1 d)
=A0 =A0 =A0 =A0 =A0(<=3D d date2)
=A0 =A0 =A0 =A0 =A0(=3D (calendar-day-of-week date) dayname)
=A0 =A0 =A0 =A0 =A0(not (check-calendar-holidays date))
=A0 =A0 =A0 =A0 =A0)
=A0 =A0 =A0 =A0 =A0entry)))

Then: "&%%(diary-schedule 22 4 2003 1 8 2003 2) 18:00 History"= ;


------------------------------------



2009/12/20 Matt Lundin <mdl@imapmail.org>:

Daniel Martins <danielemc@gmail.com> writes:

All academics here present (including of course Carsten) suffer from
the same problem, I think


*** Math classes
<2009-12-10 Thu 11:00-14:00 +1w>


will repeat forever and ever...

We need to create a schedule for a period.

The package "remind" (and its simple interface "wyrd") = do this job
wonderfully but I do not know how to deal with this problem in Org
mode

The following FAQ should help:

http://orgmode.org/worg/org-faq.php#diary-sexp-in-org-files<= /a>

- Matt





- Carsten





- Carsten




--001485f7c150f73997047f43ab3c-- --===============0812151049== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Emacs-orgmode mailing list Please use `Reply All' to send replies to the list. Emacs-orgmode@gnu.org http://lists.gnu.org/mailman/listinfo/emacs-orgmode --===============0812151049==--