[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: diary sexp question
From: |
Edward M. Reingold |
Subject: |
Re: diary sexp question |
Date: |
14 Dec 2005 15:00:19 -0600 |
User-agent: |
Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 |
>>>>> "b" == bxf4 <bxf4@yahoo.com> writes:
b> if today is in date_range and if today is Tues or Thurs then 1:30--2:20
b> teach Bldg 1 else if today is Wed or Fri then 1:30--2:20 teach Bldg 7
I would use
&%%(let ((dayname (calendar-day-of-week date))
(day (extract-calendar-day date)))
(and (memq dayname '(2 4))
(diary-block 1 23 2006 5 8 2006))) 1:30pm-2:20pm teach Bldg 1
&%%(let ((dayname (calendar-day-of-week date))
(day (extract-calendar-day date)))
(and (memq dayname '(3 5))
(diary-block 1 23 2006 5 8 2006))) 1:30pm-2:20pm teach Bldg 7
Combining these into a single entry makes it more confusing, not simpler.
b> if today is in date_range and if today is Friday then 12:00 brown-bag
b> seminar
Similarly, I'd use
&%%(let ((dayname (calendar-day-of-week date))
(day (extract-calendar-day date)))
(and (= dayname 5)
(diary-block 1 23 2006 5 8 2006))) 12pm brown-bag seminar
If you use the definition of the quarter very often, you write this as
&%%(progn (defun this-quarter () (diary-block 1 23 2006 5 8 2006)) nil)
&%%(let ((dayname (calendar-day-of-week date))
(day (extract-calendar-day date)))
(and (memq dayname '(2 4)) (this-quarter))) 1:30pm--2:20pm teach Bldg 1
&%%(let ((dayname (calendar-day-of-week date))
(day (extract-calendar-day date)))
(and (memq dayname '(3 5)) (this-quarter))) 1:30pm--2:20pm teach Bldg 7
--
Professor Edward M. Reingold Email: reingold@iit.edu
Chairman, Department of Computer Science Voice: (312) 567-3309
Illinois Institute of Technology Assistant: (312) 567-5152
Stuart Building Fax: (312) 567-5067
10 West 31st Street, Suite 236
Chicago, IL 60616-3729 U.S.A.