aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1999-05-03 20:03:07 +0000
committerKarl Heuer1999-05-03 20:03:07 +0000
commit17b7580f6f5e8654e8bc7c6d896b9064501f346a (patch)
tree04c0b5e8668036e76f277fd143df9cdb63219329
parent81af6e72e267e16bdf3c122bbaaa99e242abaa46 (diff)
downloademacs-17b7580f6f5e8654e8bc7c6d896b9064501f346a.tar.gz
emacs-17b7580f6f5e8654e8bc7c6d896b9064501f346a.zip
(diary-remind): Rewritten to behave sensibly for
diary-block diary entries for which the reminders and the diary entries can overlap.
-rw-r--r--lisp/calendar/diary-lib.el47
1 files changed, 26 insertions, 21 deletions
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el
index ade18475dce..4076e4e84ad 100644
--- a/lisp/calendar/diary-lib.el
+++ b/lisp/calendar/diary-lib.el
@@ -1387,27 +1387,32 @@ occur on. If the current date is (one of) DAYS before the event indicated by
1387SEXP, then a suitable message (as specified by `diary-remind-message' is 1387SEXP, then a suitable message (as specified by `diary-remind-message' is
1388returned. 1388returned.
1389 1389
1390In addition to the reminders beforehand, the diary entry also appears on 1390In addition to the reminders beforehand, the diary entry also appears on the
1391the date itself. 1391date itself.
1392 1392
1393If optional parameter MARKING is non-nil then the reminders are marked on the 1393A `diary-nonmarking-symbol' at the beginning of the line of the diary-remind
1394calendar. Marking of reminders is independent of whether the entry itself is 1394entry specifies that the diary entry (not the reminder) is non-marking.
1395a marking or nonmarking one." 1395Marking of reminders is independent of whether the entry itself is a marking
1396 (let ((diary-entry)) 1396or nonmarking; if optional parameter MARKING is non-nil then the reminders are
1397 (if (or (not marking-diary-entries) marking) 1397marked on the calendar."
1398 (cond 1398 (let ((diary-entry (eval sexp)))
1399 ((integerp days) 1399 (cond
1400 (let ((date (calendar-gregorian-from-absolute 1400 ;; Diary entry applies on date
1401 (+ (calendar-absolute-from-gregorian date) days)))) 1401 ((and diary-entry
1402 (if (setq diary-entry (eval sexp)) 1402 (or (not marking-diary-entries) marking-diary-entry))
1403 (setq diary-entry (mapconcat 'eval diary-remind-message ""))))) 1403 diary-entry)
1404 ((and (listp days) days) 1404 ;; Diary entry may apply to `days' before date
1405 (setq diary-entry (diary-remind sexp (car days) marking)) 1405 ((and (integerp days)
1406 (if (not diary-entry) 1406 (not diary-entry); Diary entry does not apply to date
1407 (setq diary-entry (diary-remind sexp (cdr days) marking)))))) 1407 (or (not marking-diary-entries) marking))
1408 (or diary-entry 1408 (let ((date (calendar-gregorian-from-absolute
1409 (and (or (not marking-diary-entries) marking-diary-entry) 1409 (+ (calendar-absolute-from-gregorian date) days))))
1410 (eval sexp))))) 1410 (if (setq diary-entry (eval sexp))
1411 (mapconcat 'eval diary-remind-message ""))))
1412 ;; Diary entry may apply to one of a list of days before date
1413 ((and (listp days) days)
1414 (or (diary-remind sexp (car days) marking)
1415 (diary-remind sexp (cdr days) marking))))))
1411 1416
1412(defun add-to-diary-list (date string specifier) 1417(defun add-to-diary-list (date string specifier)
1413 "Add the entry (DATE STRING SPECIFIER) to `diary-entries-list'. 1418 "Add the entry (DATE STRING SPECIFIER) to `diary-entries-list'.