# HG changeset patch # User Glenn Morris # Date 1208316210 0 # Node ID d7d3cc08c6cde10389a09b6bf1a5b441a4f54062 # Parent 6457a4cc8690853d500a56f874a578633812b2a7 (diary-remind): Don't clobber `date' passed by diary-sexp-entry. diff -r 6457a4cc8690 -r d7d3cc08c6cd lisp/calendar/diary-lib.el --- a/lisp/calendar/diary-lib.el Wed Apr 16 03:09:58 2008 +0000 +++ b/lisp/calendar/diary-lib.el Wed Apr 16 03:23:30 2008 +0000 @@ -1929,8 +1929,8 @@ 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 @@ ((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)