comparison lisp/calendar/diary-lib.el @ 94110:d7d3cc08c6cd

(diary-remind): Don't clobber `date' passed by diary-sexp-entry.
author Glenn Morris <rgm@gnu.org>
date Wed, 16 Apr 2008 03:23:30 +0000
parents 4490d4f3ae50
children 71ec8fd62188
comparison
equal deleted inserted replaced
94109:6457a4cc8690 94110:d7d3cc08c6cd
1927 A `diary-nonmarking-symbol' at the beginning of the line of the `diary-remind' 1927 A `diary-nonmarking-symbol' at the beginning of the line of the `diary-remind'
1928 entry specifies that the diary entry (not the reminder) is non-marking. 1928 entry specifies that the diary entry (not the reminder) is non-marking.
1929 Marking of reminders is independent of whether the entry itself is a marking 1929 Marking of reminders is independent of whether the entry itself is a marking
1930 or nonmarking; if optional parameter MARKING is non-nil then the reminders are 1930 or nonmarking; if optional parameter MARKING is non-nil then the reminders are
1931 marked on the calendar." 1931 marked on the calendar."
1932 (let ((diary-entry (eval sexp)) 1932 ;; `date' has a value at this point, from diary-sexp-entry.
1933 date) 1933 (let ((diary-entry (eval sexp)))
1934 (cond 1934 (cond
1935 ;; Diary entry applies on date. 1935 ;; Diary entry applies on date.
1936 ((and diary-entry 1936 ((and diary-entry
1937 (or (not diary-marking-entries-flag) diary-marking-entry-flag)) 1937 (or (not diary-marking-entries-flag) diary-marking-entry-flag))
1938 diary-entry) 1938 diary-entry)
1939 ;; Diary entry may apply to `days' before date. 1939 ;; Diary entry may apply to `days' before date.
1940 ((and (integerp days) 1940 ((and (integerp days)
1941 (not diary-entry) ; diary entry does not apply to date 1941 (not diary-entry) ; diary entry does not apply to date
1942 (or (not diary-marking-entries-flag) marking)) 1942 (or (not diary-marking-entries-flag) marking))
1943 (setq date (calendar-gregorian-from-absolute 1943 ;; Adjust date, and re-evaluate.
1944 (+ (calendar-absolute-from-gregorian date) days))) 1944 (let ((date (calendar-gregorian-from-absolute
1945 (when (setq diary-entry (eval sexp)) ; re-evaluate with adjusted date 1945 (+ (calendar-absolute-from-gregorian date) days))))
1946 ;; Discard any mark portion from diary-anniversary, etc. 1946 (when (setq diary-entry (eval sexp))
1947 (if (consp diary-entry) (setq diary-entry (cdr diary-entry))) 1947 ;; Discard any mark portion from diary-anniversary, etc.
1948 (mapconcat 'eval diary-remind-message ""))) 1948 (if (consp diary-entry) (setq diary-entry (cdr diary-entry)))
1949 (mapconcat 'eval diary-remind-message ""))))
1949 ;; Diary entry may apply to one of a list of days before date. 1950 ;; Diary entry may apply to one of a list of days before date.
1950 ((and (listp days) days) 1951 ((and (listp days) days)
1951 (or (diary-remind sexp (car days) marking) 1952 (or (diary-remind sexp (car days) marking)
1952 (diary-remind sexp (cdr days) marking)))))) 1953 (diary-remind sexp (cdr days) marking))))))
1953 1954