;ELC   
;;; compiled by roland@churchy.gnu.ai.mit.edu on Wed Sep 27 03:03:57 1995
;;; from file /gd/gnu/emacs/19.0/lisp/cal-mayan.el
;;; emacs version 19.29.12.
;;; bytecomp version FSF 2.10
;;; optimization is on.
;;; this file uses opcodes which do not exist in Emacs 18.

(if (and (boundp 'emacs-version)
	 (or (and (boundp 'epoch::version) epoch::version)
	     (string-lessp emacs-version "19.28.90")))
    (error "`cal-mayan.el' was compiled for Emacs 19.29 or later"))


(require (quote calendar))
#@332 Number of days of the Mayan calendar epoch before absolute day 0.
According to the Goodman-Martinez-Thompson correlation.  This correlation is
not universally accepted, as it still a subject of astro-archeological
research.  Using 1232041 will give you Spinden's correlation; using
1142840 will give you Hochleitner's correlation.
(defconst calendar-mayan-days-before-absolute-zero 1137140 (#$ . 512))
#@31 Mayan haab date at the epoch.
(defconst calendar-mayan-haab-at-epoch (quote (8 . 18)) (#$ . 920))
(byte-code "ÀÁ\nBÁ‡" [["Pop" "Uo" "Zip" "Zotz" "Tzec" "Xul" "Yaxkin" "Mol" "Chen" "Yax" "Zac" "Ceh" "Mac" "Kankin" "Muan" "Pax" "Kayab" "Cumku"] calendar-mayan-haab-month-name-array current-load-list] 2)
#@34 Mayan tzolkin date at the epoch.
(defconst calendar-mayan-tzolkin-at-epoch (quote (4 . 20)) (#$ . 1230))
(byte-code "ÀÁ\nBÁ‡" [["Imix" "Ik" "Akbal" "Kan" "Chicchan" "Cimi" "Manik" "Lamat" "Muluc" "Oc" "Chuen" "Eb" "Ben" "Ix" "Men" "Cib" "Caban" "Etznab" "Cauac" "Ahau"] calendar-mayan-tzolkin-names-array current-load-list] 2)
#@66 Compute the Mayan long count corresponding to the absolute DATE.
(defalias 'calendar-mayan-long-count-from-absolute #[(date) "	\\‰Ã¥\nÃ¦‰Æ¥Æ¦‰È¥	È¦‰Ê¥Ê¦\f\f	\f¯.	‡" [date calendar-mayan-days-before-absolute-zero long-count 144000 baktun remainder 7200 katun 360 tun 20 uinal kin] 6 (#$ . 1565)])
#@57 Convert MAYAN-LONG-COUNT into traditional written form.
(defalias 'calendar-mayan-long-count-to-string #[(mayan-long-count) "ÀÁÂB\"‡" [apply format "%s.%s.%s.%s.%s" mayan-long-count] 4 (#$ . 1889)])
#@70 Given STR, a string of format "%d.%d.%d.%d.%d", return list of nums.
(defalias 'calendar-string-to-mayan-long-count #[(str) "À	GÂÆÇÈ�ˆÉ!+‡" [nil str 0 cc c rlc condition (byte-code "	Wƒ) ÂÃ\f#Æ•È	Ê\fO!‰	B+‚  GÌU„6 ÍÎÈ\"ˆÈ‡" [cc c string-match "[0-9]+" str start 0 end nil datum read rlc 5 signal invalid-read-syntax] 5) ((invalid-read-syntax)) reverse] 3 (#$ . 2095)])
#@56 Convert absolute DATE into a Mayan haab date (a pair).
(defalias 'calendar-mayan-haab-from-absolute #[(date) "	\\‰@ASÄ_\\\\Å¦‰Ä¦Ä¥T,B‡" [date calendar-mayan-days-before-absolute-zero long-count calendar-mayan-haab-at-epoch 20 365 day-of-haab day month] 5 (#$ . 2493)])
#@77 Number of days from Mayan haab DATE1 to next occurrence of haab date DATE2.
(defalias 'calendar-mayan-haab-difference #[(date1 date2) "À	A\nAZÃ_	@\n@Z\\Ä\"‡" [mod date2 date1 20 365] 4 (#$ . 2784)])
#@63 Absolute date of latest HAAB-DATE on or before absolute DATE.
(defalias 'calendar-mayan-haab-on-or-before #[(haab-date date) "‰ÁÂÃ!\f\"ZÅ¦Z‡" [date calendar-mayan-haab-difference calendar-mayan-haab-from-absolute 0 haab-date 365] 5 (#$ . 2989)])
#@83 Move cursor to next instance of Mayan HAAB-DATE. 
Echo Mayan date if NOECHO is t.
(defalias 'calendar-next-haab-date #[(haab-date &optional noecho) "ÀÁÂÄ ‰‰AA@)S‰‰@)‰A@)‰AA@)	SÊ_\\ÌVƒn Í_Î\\Ï¥Z	‰	Í¦ÐU…e 	Ñ¦ÐU?†e 	Ò¦ÐU)ƒn T-Ó_Í¥Ñ¥[Ò¥\\\\\\\\*Ó\\\"!!ˆ†” Õ ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-mayan-haab-on-or-before haab-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 noecho calendar-print-mayan-date] 12 (#$ . 3242) (list (calendar-read-mayan-haab-date))])
#@87 Move cursor to previous instance of Mayan HAAB-DATE. 
Echo Mayan date if NOECHO is t.
(defalias 'calendar-previous-haab-date #[(haab-date &optional noecho) "ÀÁÂÄ ‰‰AA@)S‰‰@)‰A@)‰AA@)	SÊ_\\ÌVƒn Í_Î\\Ï¥Z	‰	Í¦ÐU…e 	Ñ¦ÐU?†e 	Ò¦ÐU)ƒn T-Ó_Í¥Ñ¥[Ò¥\\\\\\\\*S\"!!ˆ†“ Õ ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-mayan-haab-on-or-before haab-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 noecho calendar-print-mayan-date] 12 (#$ . 3837) (list (calendar-read-mayan-haab-date))])
#@69 Convert Mayan haab date (a pair) into its traditional written form.
(defalias 'calendar-mayan-haab-to-string #[(haab) "A@‰ÃUƒ ÄÅ	\"‚ ÄÆ	\nSH#*‡" [haab day month 19 format "%d Uayeb" "%d %s" calendar-mayan-haab-month-name-array] 6 (#$ . 4438)])
#@59 Convert absolute DATE into a Mayan tzolkin date (a pair).
(defalias 'calendar-mayan-tzolkin-from-absolute #[(date) "	\\Ã\n\f@\\Å\"Ã\n\fA\\Ç\"+B‡" [date calendar-mayan-days-before-absolute-zero long-count calendar-mod calendar-mayan-tzolkin-at-epoch 13 day 20 name] 3 (#$ . 4696)])
#@78 Number of days from Mayan tzolkin DATE1 to next occurrence of tzolkin DATE2.
(defalias 'calendar-mayan-tzolkin-difference #[(date1 date2) "@	@ZA	AZÄÄ\nZÅ_Æ\"Ç_\\È\"*‡" [date2 date1 name-difference number-difference mod 3 20 13 260] 5 (#$ . 4993)])
#@66 Absolute date of latest TZOLKIN-DATE on or before absolute DATE.
(defalias 'calendar-mayan-tzolkin-on-or-before #[(tzolkin-date date) "‰ÁÂÃ!\f\"ZÅ¦Z‡" [date calendar-mayan-tzolkin-difference calendar-mayan-tzolkin-from-absolute 0 tzolkin-date 260] 5 (#$ . 5253)])
#@86 Move cursor to next instance of Mayan TZOLKIN-DATE. 
Echo Mayan date if NOECHO is t.
(defalias 'calendar-next-tzolkin-date #[(tzolkin-date &optional noecho) "ÀÁÂÄ ‰‰AA@)S‰‰@)‰A@)‰AA@)	SÊ_\\ÌVƒn Í_Î\\Ï¥Z	‰	Í¦ÐU…e 	Ñ¦ÐU?†e 	Ò¦ÐU)ƒn T-Ó_Í¥Ñ¥[Ò¥\\\\\\\\*Ô\\\"!!ˆ†” Ö ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-mayan-tzolkin-on-or-before tzolkin-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 260 noecho calendar-print-mayan-date] 12 (#$ . 5524) (list (calendar-read-mayan-tzolkin-date))])
#@90 Move cursor to previous instance of Mayan TZOLKIN-DATE. 
Echo Mayan date if NOECHO is t.
(defalias 'calendar-previous-tzolkin-date #[(tzolkin-date &optional noecho) "ÀÁÂÄ ‰‰AA@)S‰‰@)‰A@)‰AA@)	SÊ_\\ÌVƒn Í_Î\\Ï¥Z	‰	Í¦ÐU…e 	Ñ¦ÐU?†e 	Ò¦ÐU)ƒn T-Ó_Í¥Ñ¥[Ò¥\\\\\\\\*S\"!!ˆ†“ Õ ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-mayan-tzolkin-on-or-before tzolkin-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 noecho calendar-print-mayan-date] 12 (#$ . 6141) (list (calendar-read-mayan-tzolkin-date))])
#@72 Convert Mayan tzolkin date (a pair) into its traditional written form.
(defalias 'calendar-mayan-tzolkin-to-string #[(tzolkin) "ÀÁ\n@\nASH#‡" [format "%d %s" tzolkin calendar-mayan-tzolkin-names-array] 5 (#$ . 6760)])
#@155 Absolute date that is Mayan TZOLKIN-DATE and HAAB-DATE.
Latest such date on or before DATE.
Returns nil if such a tzolkin-haab combination is impossible.
(defalias 'calendar-mayan-tzolkin-haab-on-or-before #[(tzolkin-date haab-date date) "ÀÁÂ!\"ÅÆÂ!\"‰\fZ‰	Ê¦ÂU…, Ì\f	Í_\\ZÎ\"Z+‡" [calendar-mayan-haab-difference calendar-mayan-haab-from-absolute 0 haab-date haab-difference calendar-mayan-tzolkin-difference calendar-mayan-tzolkin-from-absolute tzolkin-date tzolkin-difference difference 5 date mod 365 18980] 7 (#$ . 6986)])
#@30 Prompt for a Mayan haab date
(defalias 'calendar-read-mayan-haab-date #[nil "ÀÂÃÄ\"ÆÈW… É\"\nËÌÍÎÏÐ\n\"ÑÀ$!Ò\nÓÌ#\"A,B‡" [t completion-ignore-case calendar-read "Haab kin (0-19): " (lambda (x) (and (>= x 0) (< x 20))) haab-day append calendar-mayan-haab-month-name-array 5 ("Uayeb") haab-month-list assoc capitalize completing-read "Haab uinal: " mapcar list nil calendar-make-alist 1 haab-month] 7 (#$ . 7531)])
#@33 Prompt for a Mayan tzolkin date
(defalias 'calendar-read-mayan-tzolkin-date #[nil "ÀÂÃÄ\"ÆÈ\"	ÊËÌÍÎÏ	\"ÈÀ$!Ð	ÑË#\"A,B‡" [t completion-ignore-case calendar-read "Tzolkin kin (1-13): " (lambda (x) (and (> x 0) (< x 14))) tzolkin-count append calendar-mayan-tzolkin-names-array nil tzolkin-name-list assoc capitalize completing-read "Tzolkin uinal: " mapcar list calendar-make-alist 1 tzolkin-name] 7 (#$ . 7964)])
#@107 Move cursor to next instance of Mayan HAAB-DATE TZOKLIN-DATE combination.
Echo Mayan date if NOECHO is t.
(defalias 'calendar-next-calendar-round-date #[(tzolkin-date haab-date &optional noecho) "À	\nÃ ‰‰AA@)S\f‰‰@)\f‰A@)\f‰AA@)SÉ_\\\nËVƒl \nÌ_Í\\Î¥Z\n‰Ì¦ÏU…c Ð¦ÏU?†c Ñ¦ÏU)ƒl \nT\n\n-Ò_Ì¥Ð¥[Ñ¥\\\\\\\\*Ó\\#‰„• ÔÕÖ	!×\n!#‚¢ ØÙ\f!!ˆ†¢ Û )‡" [calendar-mayan-tzolkin-haab-on-or-before tzolkin-date haab-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 18980 error "%s, %s does not exist in the Mayan calendar round" calendar-mayan-tzolkin-to-string calendar-mayan-haab-to-string calendar-goto-date calendar-gregorian-from-absolute noecho calendar-print-mayan-date] 11 (#$ . 8395) (list (calendar-read-mayan-tzolkin-date) (calendar-read-mayan-haab-date))])
#@104 Move to previous instance of Mayan TZOKLIN-DATE HAAB-DATE combination.
Echo Mayan date if NOECHO is t.
(defalias 'calendar-previous-calendar-round-date #[(tzolkin-date haab-date &optional noecho) "À	\nÃ ‰‰AA@)S\f‰‰@)\f‰A@)\f‰AA@)SÉ_\\\nËVƒl \nÌ_Í\\Î¥Z\n‰Ì¦ÏU…c Ð¦ÏU?†c Ñ¦ÏU)ƒl \nT\n\n-Ò_Ì¥Ð¥[Ñ¥\\\\\\\\*S#‰„” ÓÔÕ	!Ö\n!#‚¡ ×Ø\f!!ˆ†¡ Ú )‡" [calendar-mayan-tzolkin-haab-on-or-before tzolkin-date haab-date calendar-cursor-to-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 error "%s, %s does not exist in the Mayan calendar round" calendar-mayan-tzolkin-to-string calendar-mayan-haab-to-string calendar-goto-date calendar-gregorian-from-absolute noecho calendar-print-mayan-date] 11 (#$ . 9247) (list (calendar-read-mayan-tzolkin-date) (calendar-read-mayan-haab-date))])
#@118 Compute the absolute date corresponding to the Mayan Long Count C.
Long count is a list (baktun katun tun uinal kin)
(defalias 'calendar-absolute-from-mayan-long-count #[(c) "@Á_A@Â_Ã8Ä_Å8Æ_Ç8[\\\\\\\\\\‡" [c 144000 7200 2 360 3 20 4 calendar-mayan-days-before-absolute-zero] 6 (#$ . 10092)])
#@88 String of Mayan date of Gregorian DATE.
Defaults to today's date if DATE is not given.
(defalias 'calendar-mayan-date-string #[(&optional date) "† Á ‰‰AA@)S‰‰@)‰A@)‰AA@)\fSÆ_\\ÈVƒb É_Ê\\Ë¥Z‰É¦ÌU…Y Í¦ÌU?†Y Î¦ÌU)ƒb T-\nÏ_\nÉ¥\nÍ¥[\nÎ¥\\\\\\\\*Ñ!Ó!Õ!×ØÙ!Ú!Û!$,‡" [date calendar-current-date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 d calendar-mayan-tzolkin-from-absolute tzolkin calendar-mayan-haab-from-absolute haab calendar-mayan-long-count-from-absolute long-count format "Long count = %s; tzolkin = %s; haab = %s" calendar-mayan-long-count-to-string calendar-mayan-tzolkin-to-string calendar-mayan-haab-to-string] 8 (#$ . 10398)])
#@67 Show the Mayan long count, tzolkin, and haab equivalents of date.
(defalias 'calendar-print-mayan-date #[nil "ÀÁÂÃÄ!!\"‡" [message "Mayan date: %s" calendar-mayan-date-string calendar-cursor-to-date t] 5 (#$ . 11116) nil])
#@76 Move cursor to Mayan long count DATE.  Echo Mayan date unless NOECHO is t.
(defalias 'calendar-goto-mayan-long-count-date #[(date &optional noecho) "ÀÁÂ!!!ˆ\f† Å ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-absolute-from-mayan-long-count date noecho calendar-print-mayan-date] 4 (#$ . 11345) (byte-code "À	„« ÂÃÄÅÆÇ ‰‰AA@)S	‰‰@)\n‰A@)‰AA@)\f\nSÍ_\\\nÏVƒ~ \nÐ_Ñ\\Ò¥Z\f‰\fÐ¦ÓU…u \fÔ¦ÓU?†u \fÕ¦ÓU)ƒ~ T-	Ö_	Ð¥	Ô¥[	Õ¥\\\\\\\\*!!\"!Ø!ƒ§ )‚ 	)C‡" [nil lc calendar-string-to-mayan-long-count read-string "Mayan long count (baktun.katun.tun.uinal.kin): " calendar-mayan-long-count-to-string calendar-mayan-long-count-from-absolute calendar-current-date date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 datum calendar-mayan-long-count-common-era] 13)])
#@52 T if long count represents date in the Common Era.
(defalias 'calendar-mayan-long-count-common-era #[(lc) "ÀÁ!‰ƒ @\n@Uƒ A\nA‰„ ?†$ @\n@V)‡" [calendar-mayan-long-count-from-absolute 1 base lc] 3 (#$ . 12195)])
#@70 Show the Mayan long count, haab, and tzolkin dates as a diary entry.
(defalias 'diary-mayan-date #[nil "ÀÁÂ!\"‡" [format "Mayan date: %s" calendar-mayan-date-string date] 4 (#$ . 12420)])
(provide (quote cal-mayan))
