help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Help with sexp calendar entry for marking class schedule


From: Denis Bueno
Subject: Help with sexp calendar entry for marking class schedule
Date: Mon, 23 Apr 2007 11:19:57 -0400

All-

I want to be able to have diary keep my school schedule. I found the
following [1] on EmacsWiki, but creating the following entry using it
causes Emacs to hang:

 %%(diary-schedule 23 4 2007 25 4 2007 1)

Does anyone have enough sexp-entry-fu to see the problem?

I'm using GNU Emacs 22.0.92.2 (powerpc-apple-darwin8.8.0, Carbon
Version 1.6.0) of 2007-01-18. I use the european-calendar.

-Denis

[1]
;; For school. From http://www.emacswiki.org/cgi-bin/wiki/DiaryMode.
(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 (<= date1 d)
            (<= d date2)
            (= (calendar-day-of-week date) dayname)
            (not (check-calendar-holidays date)))
       t)))




reply via email to

[Prev in Thread] Current Thread [Next in Thread]