Commit c6b6c929 authored by Jim Blandy's avatar Jim Blandy

* cal-mayan.el (calendar-mayan-days-before-absolute-zero,

        calendar-mayan-haab-difference, calendar-mayan-tzolkin-difference,
        calendar-mayan-tzolkin-haab-on-or-before,
        calendar-previous-calendar-round-date,
        calendar-absolute-from-mayan-long-count,
        calendar-print-mayan-date): Fix doc strings.
parent 44e9df9a
...@@ -65,11 +65,10 @@ ...@@ -65,11 +65,10 @@
(1+ (mayan-mod (1- m) n))) (1+ (mayan-mod (1- m) n)))
(defconst calendar-mayan-days-before-absolute-zero 1137140 (defconst calendar-mayan-days-before-absolute-zero 1137140
"Number of days of the Mayan calendar epoch before absolute day 0 (that is, "Number of days of the Mayan calendar epoch before absolute day 0.
Dec 31, 0 (Gregorian)), according to the Goodman-Martinez-Thompson According to the Goodman-Martinez-Thompson correlation. This correlation is
correlation. This correlation is not universally accepted, as it still a not universally accepted, as it still a subject of astro-archeological
subject of astro-archeological research. Using 1232041 will give you the research. Using 1232041 will give you the correlation used by Spinden.")
correlation used by Spinden.")
(defconst calendar-mayan-haab-at-epoch '(8 . 18) (defconst calendar-mayan-haab-at-epoch '(8 . 18)
"Mayan haab date at the epoch.") "Mayan haab date at the epoch.")
...@@ -132,8 +131,7 @@ correlation used by Spinden.") ...@@ -132,8 +131,7 @@ correlation used by Spinden.")
(cons day month))) (cons day month)))
(defun calendar-mayan-haab-difference (date1 date2) (defun calendar-mayan-haab-difference (date1 date2)
"Number of days from Mayan haab date DATE1 to the next occurrence of Mayan "Number of days from Mayan haab DATE1 to next occurrence of haab date DATE2."
haab date DATE2."
(mayan-mod (+ (* 20 (- (cdr date2) (cdr date1))) (mayan-mod (+ (* 20 (- (cdr date2) (cdr date1)))
(- (car date2) (car date1))) (- (car date2) (car date1)))
365)) 365))
...@@ -192,8 +190,7 @@ Echo Mayan date if NOECHO is t." ...@@ -192,8 +190,7 @@ Echo Mayan date if NOECHO is t."
(cons day name))) (cons day name)))
(defun calendar-mayan-tzolkin-difference (date1 date2) (defun calendar-mayan-tzolkin-difference (date1 date2)
"Number of days from Mayan tzolkin date DATE1 to the next occurrence of "Number of days from Mayan tzolkin DATE1 to next occurrence of tzolkin DATE2."
Mayan tzolkin date DATE2."
(let ((number-difference (- (car date2) (car date1))) (let ((number-difference (- (car date2) (car date1)))
(name-difference (- (cdr date2) (cdr date1)))) (name-difference (- (cdr date2) (cdr date1))))
(mayan-mod (+ number-difference (mayan-mod (+ number-difference
...@@ -239,8 +236,9 @@ Echo Mayan date if NOECHO is t." ...@@ -239,8 +236,9 @@ Echo Mayan date if NOECHO is t."
(aref calendar-mayan-tzolkin-names-array (1- (cdr tzolkin))))) (aref calendar-mayan-tzolkin-names-array (1- (cdr tzolkin)))))
(defun calendar-mayan-tzolkin-haab-on-or-before (tzolkin-date haab-date date) (defun calendar-mayan-tzolkin-haab-on-or-before (tzolkin-date haab-date date)
"Absolute date of latest date on or before date that is Mayan TZOLKIN-DATE "Absolute date that is Mayan TZOLKIN-DATE and HAAB-DATE.
and HAAB-DATE; returns nil if such a tzolkin-haab combination is impossible." Latest such date on or before DATE.
Returns nil if such a tzolkin-haab combination is impossible."
(let* ((haab-difference (let* ((haab-difference
(calendar-mayan-haab-difference (calendar-mayan-haab-difference
(calendar-mayan-haab-from-absolute 0) (calendar-mayan-haab-from-absolute 0)
...@@ -311,8 +309,8 @@ Echo Mayan date if NOECHO is t." ...@@ -311,8 +309,8 @@ Echo Mayan date if NOECHO is t."
(defun calendar-previous-calendar-round-date (defun calendar-previous-calendar-round-date
(tzolkin-date haab-date &optional noecho) (tzolkin-date haab-date &optional noecho)
"Move cursor to previous instance of Mayan TZOKLIN-DATE HAAB-DATE "Move to previous instance of Mayan TZOKLIN-DATE HAAB-DATE combination.
combination. Echo Mayan date if NOECHO is t." Echo Mayan date if NOECHO is t."
(interactive (list (calendar-read-mayan-tzolkin-date) (interactive (list (calendar-read-mayan-tzolkin-date)
(calendar-read-mayan-haab-date))) (calendar-read-mayan-haab-date)))
(let ((date (calendar-mayan-tzolkin-haab-on-or-before (let ((date (calendar-mayan-tzolkin-haab-on-or-before
...@@ -327,8 +325,8 @@ combination. Echo Mayan date if NOECHO is t." ...@@ -327,8 +325,8 @@ combination. Echo Mayan date if NOECHO is t."
(or noecho (calendar-print-mayan-date))))) (or noecho (calendar-print-mayan-date)))))
(defun calendar-absolute-from-mayan-long-count (c) (defun calendar-absolute-from-mayan-long-count (c)
"Compute the absolute date corresponding to the Mayan Long "Compute the absolute date corresponding to the Mayan Long Count C.
Count $c$, which is a list (baktun katun tun uinal kin)" Long count is a list (baktun katun tun uinal kin)"
(+ (* (nth 0 c) 144000) ; baktun (+ (* (nth 0 c) 144000) ; baktun
(* (nth 1 c) 7200) ; katun (* (nth 1 c) 7200) ; katun
(* (nth 2 c) 360) ; tun (* (nth 2 c) 360) ; tun
...@@ -338,8 +336,7 @@ Count $c$, which is a list (baktun katun tun uinal kin)" ...@@ -338,8 +336,7 @@ Count $c$, which is a list (baktun katun tun uinal kin)"
calendar-mayan-days-before-absolute-zero))) calendar-mayan-days-before-absolute-zero)))
(defun calendar-print-mayan-date () (defun calendar-print-mayan-date ()
"Show the Mayan long count, tzolkin, and haab equivalents of the date "Show the Mayan long count, tzolkin, and haab equivalents of date."
under the cursor."
(interactive) (interactive)
(let* ((d (calendar-absolute-from-gregorian (let* ((d (calendar-absolute-from-gregorian
(or (calendar-cursor-to-date) (or (calendar-cursor-to-date)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment