unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* Help with sexp calendar entry for marking class schedule
@ 2007-04-23 15:19 Denis Bueno
  0 siblings, 0 replies; only message in thread
From: Denis Bueno @ 2007-04-23 15:19 UTC (permalink / raw)
  To: help-gnu-emacs

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)))

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2007-04-23 15:19 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-23 15:19 Help with sexp calendar entry for marking class schedule Denis Bueno

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).