From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: reingold@emr.cs.iit.edu (Edward M. Reingold) Newsgroups: gmane.emacs.help Subject: Re: diary sexp question Date: 14 Dec 2005 15:00:19 -0600 Organization: Illinois Institute of Technology Message-ID: <858xunjsws.fsf@emr.cs.iit.edu> References: <85fyoxk9ri.fsf@emr.cs.iit.edu> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1134603673 8099 80.91.229.2 (14 Dec 2005 23:41:13 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 14 Dec 2005 23:41:13 +0000 (UTC) Cc: bxf4@yahoo.com Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 15 00:41:03 2005 Return-path: Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1EmgEI-0002MI-O9 for geh-help-gnu-emacs@m.gmane.org; Thu, 15 Dec 2005 00:40:15 +0100 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1EmgEt-0006yu-Jo for geh-help-gnu-emacs@m.gmane.org; Wed, 14 Dec 2005 18:40:51 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!news4.google.com!newsfeed2.dallas1.level3.net!news.level3.com!news.illinois.net!news.iit.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 50 Original-NNTP-Posting-Host: emr.cs.iit.edu Original-X-Trace: condor2.cns.iit.edu 1134594021 16101 216.47.142.126 (14 Dec 2005 21:00:21 GMT) Original-X-Complaints-To: usenet@news.iit.edu Original-NNTP-Posting-Date: Wed, 14 Dec 2005 21:00:21 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.3 Original-Xref: shelby.stanford.edu gnu.emacs.help:136318 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:31942 Archived-At: >>>>> "b" == bxf4 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.