From a588d349153a86e892901e9c63352d35a064bb3d Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Wed, 16 Apr 2008 03:24:06 +0000 Subject: [PATCH] (diary-remind): Don't clobber `date' passed by diary-sexp-entry. --- lisp/ChangeLog | 5 +++++ lisp/calendar/diary-lib.el | 17 +++++++++-------- 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index d5e033daf41..32734c15c24 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-04-16 Glenn Morris + + * calendar/diary-lib.el (diary-remind): Don't clobber `date' passed + by diary-sexp-entry. + 2008-04-16 Markus Triska * proced.el (proced-command-alist): Add support for darwin. diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index e3711331c5d..54c99e30346 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el @@ -1929,8 +1929,8 @@ entry specifies that the diary entry (not the reminder) is non-marking. Marking of reminders is independent of whether the entry itself is a marking or nonmarking; if optional parameter MARKING is non-nil then the reminders are marked on the calendar." - (let ((diary-entry (eval sexp)) - date) + ;; `date' has a value at this point, from diary-sexp-entry. + (let ((diary-entry (eval sexp))) (cond ;; Diary entry applies on date. ((and diary-entry @@ -1940,12 +1940,13 @@ marked on the calendar." ((and (integerp days) (not diary-entry) ; diary entry does not apply to date (or (not diary-marking-entries-flag) marking)) - (setq date (calendar-gregorian-from-absolute - (+ (calendar-absolute-from-gregorian date) days))) - (when (setq diary-entry (eval sexp)) ; re-evaluate with adjusted date - ;; Discard any mark portion from diary-anniversary, etc. - (if (consp diary-entry) (setq diary-entry (cdr diary-entry))) - (mapconcat 'eval diary-remind-message ""))) + ;; Adjust date, and re-evaluate. + (let ((date (calendar-gregorian-from-absolute + (+ (calendar-absolute-from-gregorian date) days)))) + (when (setq diary-entry (eval sexp)) + ;; Discard any mark portion from diary-anniversary, etc. + (if (consp diary-entry) (setq diary-entry (cdr diary-entry))) + (mapconcat 'eval diary-remind-message "")))) ;; Diary entry may apply to one of a list of days before date. ((and (listp days) days) (or (diary-remind sexp (car days) marking) -- 2.11.4.GIT