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: how to get calendar- for an offset day Date: 18 Dec 2008 09:49:30 -0600 Organization: Usenet @ UIUC - http://www.acm.uiuc.edu/news/ Message-ID: <8563lhv5yt.fsf@emr.cs.iit.edu> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1229618616 21353 80.91.229.12 (18 Dec 2008 16:43:36 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 18 Dec 2008 16:43:36 +0000 (UTC) Cc: Glenn Morris , mvukovic@nycap.rr.com To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 18 17:44:41 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1LDLzK-0004AY-Bv for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Dec 2008 17:44:38 +0100 Original-Received: from localhost ([127.0.0.1]:37065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LDLy8-0007wE-3W for geh-help-gnu-emacs@m.gmane.org; Thu, 18 Dec 2008 11:43:24 -0500 Original-Path: news.stanford.edu!headwall.stanford.edu!news.glorb.com!news.acm.uiuc.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 30 Original-NNTP-Posting-Host: emr.cs.iit.edu Original-X-Trace: news.acm.uiuc.edu 1229615371 5733 216.47.142.126 (18 Dec 2008 15:49:31 GMT) Original-X-Complaints-To: news@acm.uiuc.edu Original-NNTP-Posting-Date: Thu, 18 Dec 2008 15:49:31 +0000 (UTC) User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.4 Original-Xref: news.stanford.edu gnu.emacs.help:165477 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:60803 Archived-At: >>>>> "M" == Mirko writes: M> Hi, For a personal log, I use the `calendar-current-date' function M> together with calendar-date-display-form to insert the current date M> into the diary. But sometimes I am lazy, or I forget, and I need to M> insert yesterday's date into the calendar. M> I did not find anything in calendar.el (but I might have missed it). M> Any other options? This suggests an improvement to calendar.el. Change the function calendar-current-date to have an optional OFFSET: (defun calendar-current-date (&optional offset) "Return the current date in a list (month day year). Optional OFFSET is number of days from current date." (let* ((now (decode-time))) (calendar-gregorian-from-absolute (+ (calendar-absolute-from-gregorian (list (nth 4 now) (nth 3 now) (nth 5 now))) (if offset offset 0))))) -- Professor Edward M. Reingold Email: reingold@iit.edu Department of Computer Science Voice: (312) 567-3309 Illinois Institute of Technology Fax: (312) 567-5067 Stuart Building, 228F 10 West 31st Street Chicago, IL 60616-3729 U.S.A.