aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lisp/calendar/cal-coptic.el22
-rw-r--r--lisp/calendar/cal-french.el34
2 files changed, 28 insertions, 28 deletions
diff --git a/lisp/calendar/cal-coptic.el b/lisp/calendar/cal-coptic.el
index d90526cf6d3..3a206d9866a 100644
--- a/lisp/calendar/cal-coptic.el
+++ b/lisp/calendar/cal-coptic.el
@@ -57,7 +57,7 @@
57(defun coptic-calendar-last-day-of-month (month year) 57(defun coptic-calendar-last-day-of-month (month year)
58 "Return last day of MONTH, YEAR on the Coptic calendar. 58 "Return last day of MONTH, YEAR on the Coptic calendar.
59The 13th month is not really a month, but the 5 (6 in leap years) day period of 59The 13th month is not really a month, but the 5 (6 in leap years) day period of
60Nisi (Kebus) at the end of the year." 60Nisi (Kebus) at the end of the year."
61 (if (< month 13) 61 (if (< month 13)
62 30 62 30
63 (if (coptic-calendar-leap-year-p year) 63 (if (coptic-calendar-leap-year-p year)
@@ -71,11 +71,11 @@ Gregorian date Sunday, December 31, 1 BC."
71 (let ((month (extract-calendar-month date)) 71 (let ((month (extract-calendar-month date))
72 (day (extract-calendar-day date)) 72 (day (extract-calendar-day date))
73 (year (extract-calendar-year date))) 73 (year (extract-calendar-year date)))
74 (+ (1- coptic-calendar-epoch);; Days before start of calendar 74 (+ (1- coptic-calendar-epoch) ; days before start of calendar
75 (* 365 (1- year)) ;; Days in prior years 75 (* 365 (1- year)) ; days in prior years
76 (/ year 4) ;; Leap days in prior years 76 (/ year 4) ; leap days in prior years
77 (* 30 (1- month)) ;; Days in prior months this year 77 (* 30 (1- month)) ; days in prior months this year
78 day))) ;; Days so far this month 78 day))) ; days so far this month
79 79
80 80
81(defun calendar-coptic-from-absolute (date) 81(defun calendar-coptic-from-absolute (date)
@@ -84,15 +84,15 @@ The result is a list of the form (MONTH DAY YEAR).
84The absolute date is the number of days elapsed since the imaginary 84The absolute date is the number of days elapsed since the imaginary
85Gregorian date Sunday, December 31, 1 BC." 85Gregorian date Sunday, December 31, 1 BC."
86 (if (< date coptic-calendar-epoch) 86 (if (< date coptic-calendar-epoch)
87 (list 0 0 0);; pre-Coptic date 87 (list 0 0 0) ; pre-Coptic date
88 (let* ((approx (/ (- date coptic-calendar-epoch) 88 (let* ((approx (/ (- date coptic-calendar-epoch)
89 366)) ;; Approximation from below. 89 366)) ; approximation from below
90 (year ;; Search forward from the approximation. 90 (year ; search forward from the approximation
91 (+ approx 91 (+ approx
92 (calendar-sum y approx 92 (calendar-sum y approx
93 (>= date (calendar-absolute-from-coptic (list 1 1 (1+ y)))) 93 (>= date (calendar-absolute-from-coptic (list 1 1 (1+ y))))
94 1))) 94 1)))
95 (month ;; Search forward from Tot. 95 (month ; search forward from Tot
96 (1+ (calendar-sum m 1 96 (1+ (calendar-sum m 1
97 (> date 97 (> date
98 (calendar-absolute-from-coptic 98 (calendar-absolute-from-coptic
@@ -100,7 +100,7 @@ Gregorian date Sunday, December 31, 1 BC."
100 (coptic-calendar-last-day-of-month m year) 100 (coptic-calendar-last-day-of-month m year)
101 year))) 101 year)))
102 1))) 102 1)))
103 (day ;; Calculate the day by subtraction. 103 (day ; calculate the day by subtraction
104 (- date 104 (- date
105 (1- (calendar-absolute-from-coptic (list month 1 year)))))) 105 (1- (calendar-absolute-from-coptic (list month 1 year))))))
106 (list month day year)))) 106 (list month day year))))
diff --git a/lisp/calendar/cal-french.el b/lisp/calendar/cal-french.el
index 08bdea78d76..1a537dac645 100644
--- a/lisp/calendar/cal-french.el
+++ b/lisp/calendar/cal-french.el
@@ -93,9 +93,9 @@ and 11 were leap years; 15 and 20 would have been leap years). For later
93years uses the proposed rule of Romme (never adopted)--leap years fall every 93years uses the proposed rule of Romme (never adopted)--leap years fall every
94four years except century years not divisible 400 and century years that are 94four years except century years not divisible 400 and century years that are
95multiples of 4000." 95multiples of 4000."
96 (or (memq year '(3 7 11));; Actual practice--based on equinoxes 96 (or (memq year '(3 7 11)) ; actual practice--based on equinoxes
97 (memq year '(15 20)) ;; Anticipated practice--based on equinoxes 97 (memq year '(15 20)) ; anticipated practice--based on equinoxes
98 (and (> year 20) ;; Romme's proposal--never adopted 98 (and (> year 20) ; Romme's proposal--never adopted
99 (zerop (% year 4)) 99 (zerop (% year 4))
100 (not (memq (% year 400) '(100 200 300))) 100 (not (memq (% year 400) '(100 200 300)))
101 (not (zerop (% year 4000)))))) 101 (not (zerop (% year 4000))))))
@@ -117,18 +117,18 @@ Gregorian date Sunday, December 31, 1 BC."
117 (let ((month (extract-calendar-month date)) 117 (let ((month (extract-calendar-month date))
118 (day (extract-calendar-day date)) 118 (day (extract-calendar-day date))
119 (year (extract-calendar-year date))) 119 (year (extract-calendar-year date)))
120 (+ (* 365 (1- year));; Days in prior years 120 (+ (* 365 (1- year)) ; days in prior years
121 ;; Leap days in prior years 121 ;; Leap days in prior years.
122 (if (< year 20) 122 (if (< year 20)
123 (/ year 4);; Actual and anticipated practice (years 3, 7, 11, 15) 123 (/ year 4) ; actual and anticipated practice (years 3, 7, 11, 15)
124 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion) 124 ;; Romme's proposed rule (using the Principle of Inclusion/Exclusion).
125 (+ (/ (1- year) 4);; Luckily, there were 4 leap years before year 20 125 (+ (/ (1- year) 4) ; luckily, there were 4 leap years before year 20
126 (- (/ (1- year) 100)) 126 (- (/ (1- year) 100))
127 (/ (1- year) 400) 127 (/ (1- year) 400)
128 (- (/ (1- year) 4000)))) 128 (- (/ (1- year) 4000))))
129 (* 30 (1- month));; Days in prior months this year 129 (* 30 (1- month)) ; days in prior months this year
130 day;; Days so far this month 130 day ; days so far this month
131 (1- french-calendar-epoch))));; Days before start of calendar 131 (1- french-calendar-epoch)))) ; days before start of calendar
132 132
133(defun calendar-french-from-absolute (date) 133(defun calendar-french-from-absolute (date)
134 "Compute the French Revolutionary equivalent for absolute date DATE. 134 "Compute the French Revolutionary equivalent for absolute date DATE.
@@ -136,15 +136,15 @@ The result is a list of the form (MONTH DAY YEAR).
136The absolute date is the number of days elapsed since the 136The absolute date is the number of days elapsed since the
137\(imaginary) Gregorian date Sunday, December 31, 1 BC." 137\(imaginary) Gregorian date Sunday, December 31, 1 BC."
138 (if (< date french-calendar-epoch) 138 (if (< date french-calendar-epoch)
139 (list 0 0 0);; pre-French Revolutionary date 139 (list 0 0 0) ; pre-French Revolutionary date
140 (let* ((approx ;; Approximation from below. 140 (let* ((approx ; approximation from below
141 (/ (- date french-calendar-epoch) 366)) 141 (/ (- date french-calendar-epoch) 366))
142 (year ;; Search forward from the approximation. 142 (year ; search forward from the approximation
143 (+ approx 143 (+ approx
144 (calendar-sum y approx 144 (calendar-sum y approx
145 (>= date (calendar-absolute-from-french (list 1 1 (1+ y)))) 145 (>= date (calendar-absolute-from-french (list 1 1 (1+ y))))
146 1))) 146 1)))
147 (month ;; Search forward from Vendemiaire. 147 (month ; search forward from Vendemiaire
148 (1+ (calendar-sum m 1 148 (1+ (calendar-sum m 1
149 (> date 149 (> date
150 (calendar-absolute-from-french 150 (calendar-absolute-from-french
@@ -152,7 +152,7 @@ The absolute date is the number of days elapsed since the
152 (french-calendar-last-day-of-month m year) 152 (french-calendar-last-day-of-month m year)
153 year))) 153 year)))
154 1))) 154 1)))
155 (day ;; Calculate the day by subtraction. 155 (day ; calculate the day by subtraction
156 (- date 156 (- date
157 (1- (calendar-absolute-from-french (list month 1 year)))))) 157 (1- (calendar-absolute-from-french (list month 1 year))))))
158 (list month day year)))) 158 (list month day year))))
@@ -220,7 +220,7 @@ Echo French Revolutionary date unless NOECHO is t."
220 (lambda (x) (concat "Jour " x)) 220 (lambda (x) (concat "Jour " x))
221 french-calendar-special-days-array) 221 french-calendar-special-days-array)
222 (reverse 222 (reverse
223 (cdr;; we don't want rev. day in a non-leap yr. 223 (cdr ; we don't want rev. day in a non-leap yr
224 (reverse 224 (reverse
225 (mapcar 225 (mapcar
226 (lambda (x) 226 (lambda (x)