diff options
| author | Gerd Moellmann | 2001-01-24 11:48:19 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2001-01-24 11:48:19 +0000 |
| commit | d56aaa640eba871e373c19abbba90efedc45d005 (patch) | |
| tree | 14f36c50a0eb43bd9282031761e01bd94afd6058 /lisp | |
| parent | 7c22dc9d3eaad7e68b9465b3b51fdbd4e1fc7f0a (diff) | |
| download | emacs-d56aaa640eba871e373c19abbba90efedc45d005.tar.gz emacs-d56aaa640eba871e373c19abbba90efedc45d005.zip | |
(diary-float): Fix case of MONTH
being a list of numbers.
(diary-mail-entries): Rewritten.
Diffstat (limited to 'lisp')
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/calendar/diary-lib.el | 57 |
2 files changed, 32 insertions, 31 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9a582a6e6e6..bac8e169de2 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2001-01-24 Edward M. Reingold <reingold@emr.cs.uiuc.edu> | ||
| 2 | |||
| 3 | * calendar/diary-lib.el (diary-float): Fix case of MONTH | ||
| 4 | being a list of numbers. | ||
| 5 | (diary-mail-entries): Rewritten. | ||
| 6 | |||
| 1 | 2001-01-23 Dave Love <fx@gnu.org> | 7 | 2001-01-23 Dave Love <fx@gnu.org> |
| 2 | 8 | ||
| 3 | * international/mule.el (make-coding-system): Fix typo. | 9 | * international/mule.el (make-coding-system): Fix typo. |
diff --git a/lisp/calendar/diary-lib.el b/lisp/calendar/diary-lib.el index 7290280298b..c03b92a73d1 100644 --- a/lisp/calendar/diary-lib.el +++ b/lisp/calendar/diary-lib.el | |||
| @@ -633,29 +633,20 @@ You may have to tweak the syntax of the `at' command to suit your | |||
| 633 | system. Alternatively, you can specify a cron entry: | 633 | system. Alternatively, you can specify a cron entry: |
| 634 | 0 1 * * * diary-rem.sh | 634 | 0 1 * * * diary-rem.sh |
| 635 | to run it every morning at 1am." | 635 | to run it every morning at 1am." |
| 636 | (interactive "p") | 636 | (interactive "P") |
| 637 | (let ((text nil) | 637 | (let* ((diary-display-hook 'fancy-diary-display) |
| 638 | ;; Use the fancy-diary-display as it doesn't hide rest of | 638 | (diary-list-include-blanks t) |
| 639 | ;; diary file with ^M characters. It also looks nicer. | 639 | (text (progn (list-diary-entries (calendar-current-date) |
| 640 | (diary-display-hook 'fancy-diary-display)) | 640 | (if ndays ndays diary-mail-days)) |
| 641 | (if (not current-prefix-arg) | 641 | (set-buffer fancy-diary-buffer) |
| 642 | (setq ndays diary-mail-days)) | 642 | (buffer-substring (point-min) (point-max))))) |
| 643 | (calendar) | ||
| 644 | (view-diary-entries ndays) | ||
| 645 | (set-buffer fancy-diary-buffer) | ||
| 646 | (setq text (buffer-substring (point-min) (point-max))) | ||
| 647 | |||
| 648 | ;; Now send text as a mail message. | ||
| 649 | (mail) | 643 | (mail) |
| 650 | (mail-to) | 644 | (mail-to) (insert diary-mail-addr) |
| 651 | (insert diary-mail-addr) | 645 | (mail-subject) (insert "Diary entries generated " |
| 652 | (mail-subject) | 646 | (calendar-date-string (calendar-current-date))) |
| 653 | (insert "Diary entries generated ") | 647 | (mail-text) (insert text) |
| 654 | (insert (format-time-string "%a %d %b %Y" (current-time))) | 648 | (mail-send-and-exit nil))) |
| 655 | (mail-text) | 649 | |
| 656 | (insert text) | ||
| 657 | (mail-send-and-exit nil) | ||
| 658 | (exit-calendar))) | ||
| 659 | 650 | ||
| 660 | (defun diary-name-pattern (string-array &optional fullname) | 651 | (defun diary-name-pattern (string-array &optional fullname) |
| 661 | "Convert an STRING-ARRAY, an array of strings to a pattern. | 652 | "Convert an STRING-ARRAY, an array of strings to a pattern. |
| @@ -1295,9 +1286,10 @@ An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY." | |||
| 1295 | (d2 (extract-calendar-day last)) | 1286 | (d2 (extract-calendar-day last)) |
| 1296 | (y2 (extract-calendar-year last))) | 1287 | (y2 (extract-calendar-year last))) |
| 1297 | (if (or (and (= m1 m2) ; only possible base dates in one month | 1288 | (if (or (and (= m1 m2) ; only possible base dates in one month |
| 1298 | (or (and (listp month) (memq m1 month)) | 1289 | (or (eq month t) |
| 1299 | (eq month t) | 1290 | (if (listp month) |
| 1300 | (= m1 month)) | 1291 | (memq m1 month) |
| 1292 | (= m1 month))) | ||
| 1301 | (let ((d (or day (if (> n 0) | 1293 | (let ((d (or day (if (> n 0) |
| 1302 | 1 | 1294 | 1 |
| 1303 | (calendar-last-day-of-month m1 y1))))) | 1295 | (calendar-last-day-of-month m1 y1))))) |
| @@ -1308,22 +1300,25 @@ An optional parameter DAY means the Nth DAYNAME on or after/before MONTH DAY." | |||
| 1308 | (or | 1300 | (or |
| 1309 | ;; m1, d1 works as a base date | 1301 | ;; m1, d1 works as a base date |
| 1310 | (and | 1302 | (and |
| 1311 | (or (and (listp month) (memq m1 month)) | 1303 | (or (eq month t) |
| 1312 | (eq month t) | 1304 | (if (listp month) |
| 1313 | (= m1 month)) | 1305 | (memq m1 month) |
| 1306 | (= m1 month))) | ||
| 1314 | (<= d1 (or day (if (> n 0) | 1307 | (<= d1 (or day (if (> n 0) |
| 1315 | 1 | 1308 | 1 |
| 1316 | (calendar-last-day-of-month m1 y1))))) | 1309 | (calendar-last-day-of-month m1 y1))))) |
| 1317 | ;; m2, d2 works as a base date | 1310 | ;; m2, d2 works as a base date |
| 1318 | (and (or (and (listp month) (memq m2 month)) | 1311 | (and (or (eq month t) |
| 1319 | (eq month t) | 1312 | (if (listp month) |
| 1320 | (= m2 month)) | 1313 | (memq m2 month) |
| 1314 | (= m2 month))) | ||
| 1321 | (<= (or day (if (> n 0) | 1315 | (<= (or day (if (> n 0) |
| 1322 | 1 | 1316 | 1 |
| 1323 | (calendar-last-day-of-month m2 y2))) | 1317 | (calendar-last-day-of-month m2 y2))) |
| 1324 | d2))))) | 1318 | d2))))) |
| 1325 | entry)))) | 1319 | entry)))) |
| 1326 | 1320 | ||
| 1321 | |||
| 1327 | (defun diary-anniversary (month day year) | 1322 | (defun diary-anniversary (month day year) |
| 1328 | "Anniversary diary entry. | 1323 | "Anniversary diary entry. |
| 1329 | Entry applies if date is the anniversary of MONTH, DAY, YEAR if | 1324 | Entry applies if date is the anniversary of MONTH, DAY, YEAR if |