comparison lisp/=diary-lib.el @ 1357:d1bd58483c59

Dox fix.
author Christopher Zaborsky <rogue@erratum.com>
date Tue, 06 Oct 1992 21:06:25 +0000
parents 170e5a18c4ba
children 2c7997f249eb
comparison
equal deleted inserted replaced
1356:dcf780f7ae1b 1357:d1bd58483c59
970 calendar-hebrew-month-name-array-leap-year)))))) 970 calendar-hebrew-month-name-array-leap-year))))))
971 (mark-hebrew-calendar-date-pattern mm dd yy))))) 971 (mark-hebrew-calendar-date-pattern mm dd yy)))))
972 (setq d (cdr d))))) 972 (setq d (cdr d)))))
973 973
974 (defun mark-hebrew-calendar-date-pattern (month day year) 974 (defun mark-hebrew-calendar-date-pattern (month day year)
975 "Mark all dates in the calendar window that conform to the Hebrew date 975 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
976 MONTH/DAY/YEAR. A value of 0 in any position is a wild-card." 976 A value of 0 in any position is a wild-card."
977 (save-excursion 977 (save-excursion
978 (set-buffer calendar-buffer) 978 (set-buffer calendar-buffer)
979 (if (and (/= 0 month) (/= 0 day)) 979 (if (and (/= 0 month) (/= 0 day))
980 (if (/= 0 year) 980 (if (/= 0 year)
981 ;; Fully specified Hebrew date. 981 ;; Fully specified Hebrew date.
1242 (if result 1242 (if result
1243 entry 1243 entry
1244 nil)))) 1244 nil))))
1245 1245
1246 (defun diary-block (m1 d1 y1 m2 d2 y2) 1246 (defun diary-block (m1 d1 y1 m2 d2 y2)
1247 "Block diary entry--entry applies if date is between two dates. Order of 1247 "Block diary entry.
1248 the parameters is M1, D1, Y1, M2, D2, Y2 `european-calendar-style' is nil, and 1248 Entry applies if date is between two dates. Order of the parameters is
1249 M1, D1, Y1, M2, D2, Y2 `european-calendar-style' is nil, and
1249 D1, M1, Y1, D2, M2, Y2 if `european-calendar-style' is t." 1250 D1, M1, Y1, D2, M2, Y2 if `european-calendar-style' is t."
1250 (let ((date1 (calendar-absolute-from-gregorian 1251 (let ((date1 (calendar-absolute-from-gregorian
1251 (if european-calendar-style 1252 (if european-calendar-style
1252 (list d1 m1 y1) 1253 (list d1 m1 y1)
1253 (list m1 d1 y1)))) 1254 (list m1 d1 y1))))
1272 (eq month t)) 1273 (eq month t))
1273 (calendar-date-equal date (calendar-nth-named-day n dayname m y))) 1274 (calendar-date-equal date (calendar-nth-named-day n dayname m y)))
1274 entry))) 1275 entry)))
1275 1276
1276 (defun diary-anniversary (month day year) 1277 (defun diary-anniversary (month day year)
1277 "Anniversary diary entry--entry applies if date is the anniversary of 1278 "Anniversary diary entry.
1278 MONTH, DAY, YEAR if `european-calendar-style' is nil, and DAY, MONTH, YEAR 1279 Entry applies if date is the anniversary of MONTH, DAY, YEAR if
1279 if `european-calendar-style' is t. Diary entry can contain `%d' or `%d%s'; the 1280 `european-calendar-style' is nil, and DAY, MONTH, YEAR if
1281 `european-calendar-style' is t. Diary entry can contain `%d' or `%d%s'; the
1280 %d will be replaced by the number of years since the MONTH DAY, YEAR and the 1282 %d will be replaced by the number of years since the MONTH DAY, YEAR and the
1281 %s will be replaced by the ordinal ending of that number (that is, `st', `nd', 1283 %s will be replaced by the ordinal ending of that number (that is, `st', `nd',
1282 `rd' or `th', as appropriate. The anniversary of February 29 is considered 1284 `rd' or `th', as appropriate. The anniversary of February 29 is considered
1283 to be March 1 in non-leap years." 1285 to be March 1 in non-leap years."
1284 (let* ((d (if european-calendar-style 1286 (let* ((d (if european-calendar-style
1370 "Astronomical (Julian) day number diary entry." 1372 "Astronomical (Julian) day number diary entry."
1371 (format "Astronomical (Julian) day number %d" 1373 (format "Astronomical (Julian) day number %d"
1372 (+ 1721425 (calendar-absolute-from-gregorian date)))) 1374 (+ 1721425 (calendar-absolute-from-gregorian date))))
1373 1375
1374 (defun diary-omer () 1376 (defun diary-omer ()
1375 "Omer count diary entry--entry applies if date is within 50 days after 1377 "Omer count diary entry.
1376 Passover." 1378 Entry applies if date is within 50 days after Passover."
1377 (let* ((passover 1379 (let* ((passover
1378 (calendar-absolute-from-hebrew 1380 (calendar-absolute-from-hebrew
1379 (list 1 15 (+ (extract-calendar-year date) 3760)))) 1381 (list 1 15 (+ (extract-calendar-year date) 3760))))
1380 (omer (- (calendar-absolute-from-gregorian date) passover)) 1382 (omer (- (calendar-absolute-from-gregorian date) passover))
1381 (week (/ omer 7)) 1383 (week (/ omer 7))
1421 ((= (% diff 10) 2) "nd") 1423 ((= (% diff 10) 2) "nd")
1422 ((= (% diff 10) 3) "rd") 1424 ((= (% diff 10) 3) "rd")
1423 (t "th")))))) 1425 (t "th"))))))
1424 1426
1425 (defun diary-rosh-hodesh () 1427 (defun diary-rosh-hodesh ()
1426 "Rosh Hodesh diary entry--entry applies if date is Rosh Hodesh, the day 1428 "Rosh Hodesh diary entry.
1427 before, or the Saturday before." 1429 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before."
1428 (let* ((d (calendar-absolute-from-gregorian date)) 1430 (let* ((d (calendar-absolute-from-gregorian date))
1429 (h-date (calendar-hebrew-from-absolute d)) 1431 (h-date (calendar-hebrew-from-absolute d))
1430 (h-month (extract-calendar-month h-date)) 1432 (h-month (extract-calendar-month h-date))
1431 (h-day (extract-calendar-day h-date)) 1433 (h-day (extract-calendar-day h-date))
1432 (h-year (extract-calendar-year h-date)) 1434 (h-year (extract-calendar-year h-date))
1851 calendar-islamic-month-name-array)))))) 1853 calendar-islamic-month-name-array))))))
1852 (mark-islamic-calendar-date-pattern mm dd yy))))) 1854 (mark-islamic-calendar-date-pattern mm dd yy)))))
1853 (setq d (cdr d))))) 1855 (setq d (cdr d)))))
1854 1856
1855 (defun mark-islamic-calendar-date-pattern (month day year) 1857 (defun mark-islamic-calendar-date-pattern (month day year)
1856 "Mark all dates in the calendar window that conform to the Islamic date 1858 "Mark dates in calendar window that conform to Islamic date MONTH/DAY/YEAR.
1857 MONTH/DAY/YEAR. A value of 0 in any position is a wild-card." 1859 A value of 0 in any position is a wild-card."
1858 (save-excursion 1860 (save-excursion
1859 (set-buffer calendar-buffer) 1861 (set-buffer calendar-buffer)
1860 (if (and (/= 0 month) (/= 0 day)) 1862 (if (and (/= 0 month) (/= 0 day))
1861 (if (/= 0 year) 1863 (if (/= 0 year)
1862 ;; Fully specified Islamic date. 1864 ;; Fully specified Islamic date.