;ELC ;;; compiled by rms@mole.gnu.ai.mit.edu on Tue Feb 27 23:40:19 1996 ;;; from file /home/fsf/rms/e19/lisp/cal-china.el ;;; emacs version 19.30.92.1. ;;; 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.29"))) (error "`cal-china.el' was compiled for Emacs 19.29 or later")) (byte-code "ÀÁ!ˆÂÃ!„\fÄà BÂÆ!„ÇÆ BÀ‡" [require lunar boundp chinese-calendar-celestial-stem ["Jia" "Yi" "Bing" "Ding" "Wu" "Ji" "Geng" "Xin" "Ren" "Gui"] current-load-list chinese-calendar-terrestrial-branch ["Zi" "Chou" "Yin" "Mao" "Chen" "Si" "Wu" "Wei" "Shen" "You" "Xu" "Hai"]] 2) #@246 *Number of minutes difference between local standard time for Chinese calendar and Coordinated Universal (Greenwich) Time. Default is for Beijing. This is an expression in `year' since it changed at 1928-01-01 00:00:00 from UT+7:45:40 to UT+8. (defvar chinese-calendar-time-zone (quote (if (< year 1928) (+ 465 (/ 40.0 60.0)) 480)) (#$ . -770)) #@61 *Name of location used for calculation of Chinese calendar. (defvar chinese-calendar-location-name "Beijing" (#$ . -1122)) #@138 *Number of minutes difference between daylight savings and standard time for Chinese calendar. Default is for no daylight savings time. (defvar chinese-calendar-daylight-time-offset 0 (#$ . -1252)) #@68 *Abbreviated name of standard time zone used for Chinese calendar. (defvar chinese-calendar-standard-time-zone-name (quote (if (< year 1928) "PMT" "CST")) (#$ . -1457)) #@76 *Abbreviated name of daylight-savings time zone used for Chinese calendar. (defvar chinese-calendar-daylight-time-zone-name "CDT" (#$ . -1632)) #@183 *Sexp giving the date on which daylight savings time starts for Chinese calendar. Default is for no daylight savings time. See documentation of `calendar-daylight-savings-starts'. (defvar chinese-calendar-daylight-savings-starts nil (#$ . -1783)) #@179 *Sexp giving the date on which daylight savings time ends for Chinese calendar. Default is for no daylight savings time. See documentation of `calendar-daylight-savings-ends'. (defvar chinese-calendar-daylight-savings-ends nil (#$ . -2039)) #@133 *Number of minutes after midnight that daylight savings time starts for Chinese calendar. Default is for no daylight savings time. (defvar chinese-calendar-daylight-savings-starts-time 0 (#$ . -2289)) #@131 *Number of minutes after midnight that daylight savings time ends for Chinese calendar. Default is for no daylight savings time. (defvar chinese-calendar-daylight-savings-ends-time 0 (#$ . -2498)) #@146 Absolute date of first new Zodiac sign on or after absolute date d. The Zodiac signs begin when the sun's longitude is a multiple of 30 degrees. (defalias 'chinese-zodiac-sign-on-or-after #[(d) "À !‰AA@)Ä ! \n \f ÕÖר !Ù\"!!. ‡" [calendar-gregorian-from-absolute d date year eval chinese-calendar-time-zone calendar-time-zone chinese-calendar-daylight-time-offset calendar-daylight-time-offset chinese-calendar-standard-time-zone-name calendar-standard-time-zone-name chinese-calendar-daylight-time-zone-name calendar-daylight-time-zone-name chinese-calendar-daylight-savings-starts calendar-calendar-daylight-savings-starts chinese-calendar-daylight-savings-ends calendar-daylight-savings-ends chinese-calendar-daylight-savings-starts-time calendar-daylight-savings-starts-time chinese-calendar-daylight-savings-ends-time calendar-daylight-savings-ends-time floor calendar-absolute-from-astro solar-date-next-longitude calendar-astro-from-absolute 30] 6 (#$ . 2703)]) #@62 Absolute date of first new moon on or after absolute date d. (defalias 'chinese-new-moon-on-or-after #[(d) "À !‰AA@)Ä ! \n \f ÕÖר !!!!. ‡" [calendar-gregorian-from-absolute d date year eval chinese-calendar-time-zone calendar-time-zone chinese-calendar-daylight-time-offset calendar-daylight-time-offset chinese-calendar-standard-time-zone-name calendar-standard-time-zone-name chinese-calendar-daylight-time-zone-name calendar-daylight-time-zone-name chinese-calendar-daylight-savings-starts calendar-calendar-daylight-savings-starts chinese-calendar-daylight-savings-ends calendar-daylight-savings-ends chinese-calendar-daylight-savings-starts-time calendar-daylight-savings-starts-time chinese-calendar-daylight-savings-ends-time calendar-daylight-savings-ends-time floor calendar-absolute-from-astro lunar-new-moon-on-or-after calendar-astro-from-absolute] 6 (#$ . 3705)]) #@301 An assoc list of Chinese year structures as determined by `chinese-year'. Values are computed as needed, but to save time, the initial value consists of the precomputed years 1989-2000. The code works just as well with this set to nil initially (which is how the value for 1989-2000 was computed). (defvar chinese-year-cache (quote ((1989 (12 726110) (1 726139) (2 726169) (3 726198) (4 726227) (5 726257) (6 726286) (7 726316) (8 726345) (9 726375) (10 726404) (11 726434)) (1990 (12 726464) (1 726494) (2 726523) (3 726553) (4 726582) (5 726611) (5.5 726641) (6 726670) (7 726699) (8 726729) (9 726758) (10 726788) (11 726818)) (1991 (12 726848) (1 726878) (2 726907) (3 726937) (4 726966) (5 726995) (6 727025) (7 727054) (8 727083) (9 727113) (10 727142) (11 727172)) (1992 (12 727202) (1 727232) (2 727261) (3 727291) (4 727321) (5 727350) (6 727379) (7 727409) (8 727438) (9 727467) (10 727497) (11 727526)) (1993 (12 727556) (1 727586) (2 727615) (3 727645) (3.5 727675) (4 727704) (5 727734) (6 727763) (7 727793) (8 727822) (9 727851) (10 727881) (11 727910)) (1994 (12 727940) (1 727969) (2 727999) (3 728029) (4 728059) (5 728088) (6 728118) (7 728147) (8 728177) (9 728206) (10 728235) (11 728265)) (1995 (12 728294) (1 728324) (2 728353) (3 728383) (4 728413) (5 728442) (6 728472) (7 728501) (8 728531) (8.5 728561) (9 728590) (10 728619) (11 728649)) (1996 (12 728678) (1 728708) (2 728737) (3 728767) (4 728796) (5 728826) (6 728856) (7 728885) (8 728915) (9 728944) (10 728974) (11 729004)) (1997 (12 729033) (1 729062) (2 729092) (3 729121) (4 729151) (5 729180) (6 729210) (7 729239) (8 729269) (9 729299) (10 729328) (11 729358)) (1998 (12 729388) (1 729417) (2 729447) (3 729476) (4 729505) (5 729535) (5.5 729564) (6 729593) (7 729623) (8 729653) (9 729682) (10 729712) (11 729742)) (1999 (12 729771) (1 729801) (2 729831) (3 729860) (4 729889) (5 729919) (6 729948) (7 729977) (8 730007) (9 730036) (10 730066) (11 730096)) (2000 (12 730126) (1 730155) (2 730185) (3 730215) (4 730244) (5 730273) (6 730303) (7 730332) (8 730361) (9 730391) (10 730420) (11 730450)))) (#$ . 4617)) #@320 The structure of the Chinese year for Gregorian year Y. The result is a list of pairs (i d), where month i begins on absolute date d, of the Chinese months from the Chinese month following the solstice in Gregorian year Y-1 to the Chinese month of the solstice of Gregorian year Y. The list is cached for further use. (defalias 'chinese-year #[(y) "À \n\"A‰„Ä !Å\n BC\" )‡" [assoc y chinese-year-cache list compute-chinese-year append] 5 (#$ . 6730)]) #@240 Assign month numbers to the lunar months in LIST, starting with START. Numbers are assigned sequentially, START, START+1, ..., 11, with half numbers used for leap months. First month of list will never be a leap month, nor will the last. (defalias 'number-chinese-months #[(list start) "…KÁ\nZGZÃUƒ\n@DÄA\nT\"B‡\n@DAAƒDAA@ÅA@!XƒD\nÆ\\A@DÄAA\nT\"B‚JÄA\nT\"B‡" [list 12 start 0 number-chinese-months chinese-zodiac-sign-on-or-after .5] 5 (#$ . 7196)]) #@61 List of starting dates of Chinese months from START to END. (defalias 'chinese-month-list #[(start end) " X…Â!‰ X… Ä T \"B)‡" [start end chinese-new-moon-on-or-after new-moon chinese-month-list] 5 (#$ . 7670)]) #@291 Compute the structure of the Chinese year for Gregorian year Y. The result is a list of pairs (i d), where month i begins on absolute date d, of the Chinese months from the Chinese month following the solstice in Gregorian year Y-1 to the Chinese month of the solstice of Gregorian year Y. (defalias 'compute-chinese-year #[(y) "ÀÁ E‰‰AA@)S\f‰‰@)\f‰A@)\f‰AA@)SÉ_\\\nËVƒl\nÌ_Í\\Î¥Z\n‰̦ÏU…cЦÏU?†cѦÏU)ƒl\nT\n\n- Ò_\\ Ì¥\\ Ð¥[\\ Ñ¥\\*!ÔÀÁ SE‰‰AA@)S\f‰‰@)\f‰A@)\f‰AA@)SÉ_\\\nËVƒò\nÌ_Í\\Î¥Z\n‰̦ÏU…éЦÏU?†éѦÏU)ƒò\nT\n\n- Ò_\\ Ì¥\\ Ð¥[\\ Ñ¥\\*!T\"À@!GÁUƒ,Á@D×AØ\"B‚…@V„?A@YƒWÙÚ@DÁA@DD×AAØ\"\"‚…ÙÁ@DCÀA@!AA@Yƒ~ÛA@D×AAØ\"B‚„×AØ\"\"+‡" [chinese-zodiac-sign-on-or-after 12 15 y date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 next-solstice chinese-month-list list next-sign number-chinese-months 1 append 11.5 12.5] 8 (#$ . 7895)]) #@135 The number of days elapsed between the Gregorian date 12/31/1 BC and DATE. The Gregorian date Sunday, December 31, 1 BC is imaginary. (defalias 'calendar-absolute-from-chinese #[(date) "@A@AA@AAA@ SÅ_\nS\\Æ\\\fSÈ ÉÈÊË!\"Ë!>ËT!\"\"A@\\-‡" [date cycle year month day 60 -2636 g-year assoc append 1 chinese-year] 8 (#$ . 8879)]) #@189 Compute Chinese date (cycle year month day) corresponding to absolute DATE. The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC. (defalias 'calendar-chinese-from-absolute #[(date) "À !‰AA@)‰Ã\\ÅÆ\nS!Æ\n!Æ\nT!#‰A@A@ Xƒ=A@@ÈUƒ4\fTA‰‚\fSÉ¥Ê\fÉ\"@@ @A@ZTF+‡" [calendar-gregorian-from-absolute date g-year 2695 c-year append chinese-year list 1 60 calendar-mod] 6 (#$ . 9228)]) #@27 Date of Chinese New Year. (defalias 'holiday-chinese-new-year #[nil " \nÄ_ \\Å\\Æ\\‰ĦTÄ¥) ÈW…@ÉÊÆË\n!\"A@!\fÍ\f!…?\fÎÏÐ\nÑ\\!\"DC)*‡" [displayed-month displayed-year y m 12 -1 1 macro-y 5 calendar-gregorian-from-absolute assoc chinese-year chinese-new-year calendar-date-is-visible-p format "Chinese New Year (%s)" calendar-chinese-sexagesimal-name 57] 7 (#$ . 9686)]) #@90 String of Chinese date of Gregorian DATE. Defaults to today's date if DATE is not given. (defalias 'calendar-chinese-date-string #[(&optional date) "†Á ‰‰AA@)S‰‰@)‰A@)‰AA@)\f SÆ_\\ ÈVƒb É_Ê\\Ë¥Z ‰ɦÌU…Y ͦÌU?†Y ΦÌU)ƒbT-\nÏ_\\\nÉ¥\\\nÍ¥[\\\nÎ¥\\*Ñ!‰@A@AA@AAA@Ô ÕF!Ô ×Uƒ¬T‚®Ø !ÙUƒ» T‚¼ ÚØ !TÙ\"ÕF! Ü_Ø !\\צÞß à ! ¨„äá‚óâZWƒòã‚óäØ ! ¨ƒ\nÞåà Ü_ \\æ\\!\"‚ ä\fàç\\!& . ‡" [date calendar-current-date prior-years month day year 31 day-of-year 2 4 23 10 0 100 400 365 a-date calendar-chinese-from-absolute c-date cycle calendar-absolute-from-chinese 1 this-month 60 floor 12 calendar-mod next-month 5 m-cycle format "Cycle %s, year %s (%s), %smonth %s%s, day %s (%s)" calendar-chinese-sexagesimal-name "second " 30 "first " "" " (%s)" 44 15] 13 (#$ . 10076)]) #@176 The N-th name of the Chinese sexagesimal cycle. N congruent to 1 gives the first name, N congruent to 2 gives the second name, ..., N congruent to 60 gives the sixtieth name. (defalias 'calendar-chinese-sexagesimal-name #[(n) "ÀÁ\n SĦH SƦH#‡" [format "%s-%s" chinese-calendar-celestial-stem n 10 chinese-calendar-terrestrial-branch 12] 6 (#$ . 10918)]) #@44 Show the Chinese date equivalents of date. (defalias 'calendar-print-chinese-date #[nil "ÀÁ!ˆÀÂÃÄÅ!!\"‡" [message "Computing Chinese date..." "Chinese date: %s" calendar-chinese-date-string calendar-cursor-to-date t] 5 (#$ . 11280) nil]) #@73 Move cursor to Chinese date DATE. Echo Chinese date unless NOECHO is t. (defalias 'calendar-goto-chinese-date #[(date &optional noecho) "ÀÁ !!!ˆ\f†Å ‡" [calendar-goto-date calendar-gregorian-from-absolute calendar-absolute-from-chinese date noecho calendar-print-chinese-date] 4 (#$ . 11524) (let* ((c (calendar-chinese-from-absolute (calendar-absolute-from-gregorian (calendar-current-date)))) (cycle (calendar-read "Chinese calendar cycle number (>44): " (quote (lambda (x) (> x 44))) (int-to-string (car c)))) (year (calendar-read "Year in Chinese cycle (1..60): " (quote (lambda (x) (and (<= 1 x) (<= x 60)))) (int-to-string (car (cdr c))))) (month-list (make-chinese-month-assoc-list (chinese-months cycle year))) (month (cdr (assoc (completing-read "Chinese calendar month: " month-list nil t) month-list))) (last (if (= month (car (cdr (cdr (calendar-chinese-from-absolute (+ 29 (calendar-absolute-from-chinese (list cycle year month 1)))))))) 30 29)) (day (calendar-read (format "Chinese calendar day (1-%d): " last) (quote (lambda (x) (and (<= 1 x) (<= x last))))))) (list (list cycle year month day)))]) #@66 A list of the months in cycle C, year Y of the Chinese calendar. (defalias 'chinese-months #[(c y) "ÀÁÂÃÄÅÆÀ‰F!!‰ AA@)!\"ÂÊÄÅÆËUƒ+T‚-ËUƒ8À‚:À‰F!!‰ AA@)!\"\">‡" [1 append mapcar #[(x) "@‡" [x] 1] chinese-year calendar-gregorian-from-absolute calendar-absolute-from-chinese c y date #[(x) "@ÁV… @‡" [x 11] 2] 60] 13 (#$ . 12647)]) #@43 Make list of months L into an assoc list. (defalias 'make-chinese-month-assoc-list #[(l) "…P@…PAƒHA@ƒH@ÁA@!Uƒ9ÂÃÄ@\"@BÃÅ@\"A@BDÆAA!\"‡ÂÇ@!@BCÆA!\"‡Ç@!@BC‡" [l floor append format "%s (first)" "%s (second)" make-chinese-month-assoc-list int-to-string] 5 (#$ . 13006)]) #@50 Chinese calendar equivalent of date diary entry. (defalias 'diary-chinese-date #[nil "ÀÁ !\"‡" [format "Chinese date: %s" calendar-chinese-date-string date] 4 (#$ . 13301)]) (provide (quote cal-china))