
(require (quote calendar))

(provide (quote holidays))

(defun holidays nil "\
Display the holidays for last month, this month, and next month.
This function is suitable for execution in a .emacs file." (interactive) (byte-code "ÃˆŠÄ @AA@Å +)‡" [date displayed-month displayed-year nil calendar-current-date list-calendar-holidays] 3))

(defun check-calendar-holidays (date) "\
Check the list of holidays for any that occur on DATE.
The value returned is a list of strings of relevant holiday descriptions.
The holidays are those in the list calendar-holidays." (byte-code "	@	AA@Æ Å…+ Ç	@@\"…\" È@A\"‰ˆA‰ˆ‚ ˆ,‡" [displayed-month date displayed-year h holiday-list nil calendar-holiday-list calendar-date-equal append] 6))

(defun calendar-cursor-holidays nil "\
Find holidays for the date specified by the cursor in the calendar window." (interactive) (byte-code "ÇˆÊË!ˆÌ Í!Î!ÏÐ
Ñ#ÒÓ	#
?ƒ) ÊÔ	\"‚f GÕ Xƒ7 Ê!‚f Ö!qˆÇ‰ˆÒ×	\"‰ˆØ ˆÏÐ
Ù#cˆebˆÚÇ!ˆÉ‰ˆÛ!ˆÊÜ!-‡" [date date-string holiday-list holiday-string msg holiday-buffer buffer-read-only nil mode-line-format t message "Checking holidays..." calendar-cursor-to-date calendar-date-string check-calendar-holidays mapconcat identity ";  " format "%s:  %s" "No holidays known for %s" screen-width get-buffer-create "--------------------------%s%%-" erase-buffer "
" set-buffer-modified-p display-buffer "Checking holidays...done"] 17))

(defun mark-calendar-holidays nil "\
Mark notable days in the calendar window." (interactive) (byte-code "ÄˆÁ‰ˆÅÆ!ˆÇ 
…  È
@@\"ˆ
A‰ˆ‚ )ˆÅÉ!‡" [mark-holidays-in-calendar t holiday-list calendar-holiday-marker nil message "Marking holidays..." calendar-holiday-list mark-visible-calendar-date "Marking holidays...done"] 6))

(defun list-calendar-holidays nil "\
Create a buffer containing the holidays for the current calendar window.
The holidays are those in the list calendar-notable-days.  Returns t if any
holidays are found, nil if not." (interactive) (byte-code "ÇˆÍÎ!ˆÏ 

?ƒ ÍÐ!ˆÇ‚– Ñ!qˆÇ‰	ˆÒÓÔ\"	ÕÕ$
Ö
Ô\"T‰ˆ×
Ô\"‰)ˆÒÓÔ\"ÕØ$
Ö
Ô\"T‰ˆ×
Ô\"‰)ˆÙÚÛ	!Û!%‰ˆÜ ˆÝÞß#cˆebˆàÇ!ˆÌ‰	ˆá!ˆÍâ!ˆÌ-‡" [holiday-list m1 displayed-month y1 displayed-year m2 y2 nil holiday-buffer buffer-read-only macro-y mode-line-format t message "Looking up holidays..." calendar-holiday-list "Looking up holidays...none found" get-buffer-create + * 12 -1 % / 1 format "-------------Notable Dates from %s, %d to %s, %d%%-" calendar-month-name erase-buffer mapconcat (lambda (x) (concat (calendar-date-string (car x)) ": " (car (cdr x)))) "
" set-buffer-modified-p display-buffer "Looking up holidays...done"] 21))

(defun calendar-holiday-list nil "\
Form the list of holidays that occur on dates in the calendar window.
The holidays are those in the list calendar-holidays." (byte-code "	Ã…8 ÆÇÈ@@\"!@Aƒ  É@A\"‚# É!…. Ê
\"‰*ˆA‰ˆ‚ ˆË
Ì\"‰*‡" [p calendar-holidays holiday-list nil function-name holidays intern format "calendar-holiday-function-%s" funcall append sort calendar-date-compare] 8))

(defun calendar-holiday-function-fixed (x) "\
Returns the corresponding Gregorian date, if visible in the window, to
month, year where month is (car X) and year is (car (cdr X)).  If it is
visible, the value returned is the list (((month day year) string)) where
string is (car (nthcdr 2 X)).  Returns nil if it is not visible in the
current calendar window." (byte-code "É	@!É	A@!ÉÊË	\"@!ÌÍÎ\"ÏÐZ$ÑÎ\"T‰ˆÒÎ\"‰)ˆÓV…H 
EDC-‡" [month x day string m displayed-month y displayed-year macro-y eval nthcdr 2 + * 12 -1 11 % / 9] 11))

(defun calendar-holiday-function-float (x) "\
Returns the corresponding Gregorian date, if visible in the window, to the
n-th occurrence (negative counts from the end of the month) of dayname in
month, year where month is (car X), year is (car (cdr X)), n is
(car (nthcdr 2 X)).  If it is visible, the value returned is the list
(((month day year) string)) where string is (car (nthcdr 3 X)).
Returns nil if it is not visible in the current calendar window." (byte-code "Ê	@!Ê	A@!ÊËÌ	\"@!ÊËÍ	\"@!ÎÏÐ\"ÑÒZ$	Ó	Ð\"T‰ˆÔ	Ð\"‰)ˆÕV…S Ö
$DC.‡" [month x dayname n string m displayed-month y displayed-year macro-y eval nthcdr 2 3 + * 12 -1 11 % / 9 calendar-nth-named-day] 15))

(defun calendar-holiday-function-julian (x) "\
Returns the corresponding Gregorian date, if visible in the window, to the
Julian date month, year where month is (car X) and year is (car (cdr X)).
If it is visible, the value returned is the list (((month day year) string))
where string is (car (nthcdr 2 X)).  Returns nil if it is not visible in the
current calendar window." (byte-code "Ô	@!Ô	A@!ÔÕÖ	\"@!	Ë
×ØÙ\"ÚÚ$ÛÙ\"T‰ˆÜÙ\"‰)ˆ×Ø	Ù\"ÚÝ$ÛÙ\"T‰ˆÜÙ\"‰	)ˆÞÝE!Þß	\"	E!à!à!AA@AA@áWƒ  ‚¢ ‰
ˆâã

E!!ä!…½ DC)..‡" [month x day string m1 displayed-month y1 displayed-year m2 y2 year nil macro-y start-date end-date julian-start julian-end julian-y1 julian-y2 date eval nthcdr 2 + * 12 -1 % / 1 calendar-absolute-from-gregorian calendar-last-day-of-month calendar-julian-from-absolute 10 calendar-gregorian-from-absolute calendar-absolute-from-julian calendar-date-is-visible-p] 22))

(defun calendar-holiday-function-islamic (x) "\
Returns the corresponding Gregorian date, if visible in the window, to the
Islamic date month, day where month is (car X) and day is (car (cdr X)).
If it is visible, the value returned is the list (((month day year) string))
where string is (car (nthcdr 2 X)).  Returns nil if it is not visible in
the current calendar window." (byte-code "Ì	@!Ì	A@!ÌÍÎ	\"@!ÏÐÑE!!@AA@Ê	ÒWƒ5 Ê‚w ÓÔÕ\"Ö×Z$ØÕ\"T‰ˆÙÕ\"‰)ˆÚV…w ÛÜ
E!!	Ý	!…v 	DC).‡" [month x day string islamic-date displayed-month displayed-year m y date nil macro-y eval nthcdr 2 calendar-islamic-from-absolute calendar-absolute-from-gregorian 15 1 + * 12 -1 10 % / 7 calendar-gregorian-from-absolute calendar-absolute-from-islamic calendar-date-is-visible-p] 15))

(defun calendar-holiday-function-hebrew (x) "\
Returns the corresponding Gregorian date, if visible in the window, to the
Hebrew date month, day where month is (car X) and day is (car (cdr X)).
If it is visible, the value returned is the list (((month day year) string))
where string is (car (nthcdr 2 X)).  Returns nil if it is not visible in
the current calendar window." (byte-code "Ô	@!Ô	A@!ÔÕÖ	\"@!×ØWƒ! ØZ‚$ Ù\\ÚWƒ0 ÚZ‚3 Ö\\ÛWƒ? ÛZ‚B Ü\\ÝWƒN ÝZ‚Q Þ\\ßWƒ] ßZ‚` à\\%>…Ë
	áâã\"ää$åã\"T‰ˆæã\"‰)ˆáâ	ã\"äÙ$åã\"T‰ˆæã\"‰	)ˆçÙE!çè	\"	E!é!é!AA@AA@êWƒò ‚ô ‰
ˆëì

E!!í!…DC).-+‡" [month x day string displayed-month m1 y1 displayed-year m2 y2 year nil macro-y start-date end-date hebrew-start hebrew-end hebrew-y1 hebrew-y2 date eval nthcdr 2 list 11 1 10 9 3 8 4 7 5 + * 12 -1 % / calendar-absolute-from-gregorian calendar-last-day-of-month calendar-hebrew-from-absolute 6 calendar-gregorian-from-absolute calendar-absolute-from-hebrew calendar-date-is-visible-p] 23))

(defun calendar-holiday-function-if (x) "\
Conditional holiday for dates in the calendar window.
The boolean condition is (car X).  If t, the holiday (car (cdr X)) is
checked.  If nil, the holiday (car (cdr (cdr X))), if there, is checked." (byte-code "Å	@!ƒ 	A@‚ 	AA@
…3 ÆÇÈ
@\"!
Aƒ- É
A\"‚0 É!**‡" [boolean x h function-name holidays eval intern format "calendar-holiday-function-%s" funcall] 6))

(defun calendar-holiday-function-advent nil "\
Date of Advent, if visible in calendar window." (byte-code "	ÆÇÈ\"
ÉÉ$ÊÈ\"T‰ˆËÈ\"‰)ˆÌÍÎÏÈÐE!\"!Ñ!…4 ÒDC)*‡" [year displayed-year month displayed-month macro-y advent + * 12 -1 % / calendar-gregorian-from-absolute calendar-dayname-on-or-before 0 calendar-absolute-from-gregorian 3 calendar-date-is-visible-p "Advent"] 11))

(defun calendar-holiday-function-easter-etc nil "\
List of dates related to Easter, as visible in calendar window." (byte-code "ÌV… 	?ƒ Â‚ÍÎ\"TÏÐÑÒÓÏÔ\"\"ÍÒÕ\"Ö\"[ÍÌÒ×\"\\Ø\"ÒÙ\"%Ù\"ÚU†J ÛU…J ÜÏÔ\"WƒR T‚S ÝÖÔE!ZÞÚß\\\"à!áDàâZ!ãDàäZ!åDE	æàçZ!èDàéZ!êDàëZ!ìDàíZ!îDàïZ!ðDàÑZ!ñDàßZ!òDàÕZ!óDàô\\!õDàö\\!÷Dàë\\!øDàù\\!úDàé\\!ûDàü\\!ýD&
þ	!	…ÿþ
!\"‰ˆ.‡" [displayed-month all-christian-calendar-holidays nil century displayed-year shifted-epact adjusted-epact paschal-moon abs-easter mandatory optional output-list 5 / 100 % + 14 * 11 19 3 4 8 25 30 0 1 10 calendar-absolute-from-gregorian calendar-dayname-on-or-before 7 calendar-gregorian-from-absolute "Easter Sunday" 2 "Good Friday" 46 "Ash Wednesday" list 63 "Septuagesima Sunday" 56 "Sexagesima Sunday" 49 "Shrove Sunday" 48 "Shrove Monday" 47 "Shrove Tuesday" "Passion Sunday" "Palm Sunday" "Maundy Thursday" 35 "Rogation Sunday" 39 "Ascension Sunday" "Pentecost (Whitsunday)" 50 "Whitmunday" "Trinity Sunday" 60 "Corpus Christi" filter-visible-calendar-holidays append] 46))

(defun calendar-holiday-function-rosh-hashanah-etc nil "\
List of dates related to Rosh Hashanah, as visible in calendar window." (byte-code "ÈW†	 ÉVƒ Á‚Ì ÊËÌÍ\\E!ÎÏ
!ÐÑÍ\\\"DÏ
Ò\\!ÓDÏ
Ô\\!ÕDÏ
Ö\\!×DÏ
Ø\\!ÙD%ÎÏÚÛ
ÜZ\"!ÝDÏ
S!ÞDÏ
T!ßDÏà
Ë\"ÜUƒi 
á\\‚l 
â\\!ãDÏÚÛË
\\\"!äDÏ
È\\!åDÏ
æ\\!çDÏ
è\\!éDÏ
ê\\!ëDÏ
ì\\!íDÏ
î\\!ïDÏ
ð\\!ñDÏ
ò\\!óD&ô!…È õô!\"‰ˆ,‡" [displayed-month nil abs-r-h displayed-year mandatory optional output-list all-hebrew-calendar-holidays 8 11 calendar-absolute-from-hebrew 7 1 3761 list calendar-gregorian-from-absolute format "Rosh HaShanah %d" 9 "Yom Kippur" 14 "Sukkot" 21 "Shemini Atzeret" 22 "Simchat Torah" calendar-dayname-on-or-before 6 4 "Selichot (night)" "Erev Rosh HaShannah" "Rosh HaShanah (second day)" % 3 2 "Tzom Gedaliah" "Shabbat Shuvah" "Erev Yom Kippur" 13 "Erev Sukkot" 15 "Sukkot (second day)" 16 "Hol Hamoed Sukkot (first day)" 17 "Hol Hamoed Sukkot (second day)" 18 "Hol Hamoed Sukkot (third day)" 19 "Hol Hamoed Sukkot (fourth day)" 20 "Hoshannah Rabbah" filter-visible-calendar-holidays append] 39))

(defun calendar-holiday-function-hanukkah nil "\
List of dates related to Hanukkah, as visible in calendar window." (byte-code "Ç>…† ÈÉ
Ê\"	ËÌ$ÍÊ\"T‰ˆÎÊ\"‰)ˆÏÐ	Ñ	
\"
E!!AA@ÒÓÔE!ÕÖ×S!ØD×!ÙD×T!ÚD×Û\\!ÜD×Ý\\!ÞD×ß\\!àD×á\\!âD×ã\\!äD×å\\!æD&	!**‡" [displayed-month m y displayed-year macro-y h-y abs-h (10 11 12 1 2) + * 12 -1 1 % / calendar-hebrew-from-absolute calendar-absolute-from-gregorian calendar-last-day-of-month calendar-absolute-from-hebrew 9 25 filter-visible-calendar-holidays list calendar-gregorian-from-absolute "Erev Hanukkah" "Hanukkah (first day)" "Hanukkah (second day)" 2 "Hanukkah (third day)" 3 "Hanukkah (fourth day)" 4 "Hanukkah (fifth day)" 5 "Hanukkah (sixth day)" 6 "Hanukkah (seventh day)" 7 "Hanukkah (eighth day)"] 29))

(defun calendar-holiday-function-passover-etc nil "\
List of dates related to Passover, as visible in calendar window." (byte-code "ÈWƒ
 Á‚(ÉÊËÌ\\E!Í
!ÎDÍ
Ï\\!ÐDDÑÍÒÓ
ÔZ\"!ÕDÍÒÓ
ÖZ\"!×DÍØ
È\"ÙUƒF 
ÚZ‚I 
ÛZ!ÜDÍ
ÛZ!ÝDÍ
ÖZ!ÞDÍßØ
È\"!ƒj 
àZ‚m 
áZ!âDÍÒÓ
ãZ\"ÈZ!äDÍÒÓ
ãZ\"!åDÍÒÓ
S\"!æDÍ
S!çDÍ
T!èDÍ
Ù\\!éDÍ
ê\\!ëDÍ
ì\\!íDÍ
î\\!ïDÍ
Ó\\!ðDÍ
È\\!ñDÍ
ò\\!óDÍßØ
È\"!ƒÜ 
ô\\‚î Ø
È\"ÓUƒë 
õ\\‚î 
ö\\!÷DÍ
Ú\\!øDÍ
Ô\\!ùDÍ
ú\\!ûDÍ
ü\\!ýD&þ!…$ÿþ!\"‰ˆ,‡" [displayed-month nil abs-p displayed-year mandatory optional output-list all-hebrew-calendar-holidays 7 calendar-absolute-from-hebrew 1 15 3760 calendar-gregorian-from-absolute "Passover" 50 "Shavuot" list calendar-dayname-on-or-before 6 43 "Shabbat Shekalim" 30 "Shabbat Zachor" % 2 33 31 "Fast of Esther" "Erev Purim" "Purim" zerop 28 29 "Shushan Purim" 14 "Shabbat Parah" "Shabbat HaHodesh" "Shabbat HaGadol" "Erev Passover" "Passover (second day)" "Hol Hamoed Passover (first day)" 3 "Hol Hamoed Passover (second day)" 4 "Hol Hamoed Passover (third day)" 5 "Hol Hamoed Passover (fourth day)" "Passover (seventh day)" "Passover (eighth day)" 12 "Yom HaShoah" 18 19 20 "Yom HaAtzma'ut" "Lag BaOmer" "Yom Yerushalim" 49 "Erev Shavuot" 51 "Shavuot (second day)" filter-visible-calendar-holidays append] 62))

(defun calendar-holiday-function-tisha-b-av-etc nil "\
List of dates around Tisha B'Av, as visible in calendar window." (byte-code "ÄW†	 ÅVƒ Á‚X ÆÄÅÇ\\E!ÈÉÊ
Ë\"ÌUƒ* 
ÍZ‚- 
ÎZ!ÏDÉÐÌ
\"!ÑDÉÊ
Ë\"ÌUƒG 
T‚H 
!ÒDÉÐÌ
Ë\\\"!ÓDF!)‡" [displayed-month nil abs-t-a displayed-year 5 9 calendar-absolute-from-hebrew 3760 filter-visible-calendar-holidays calendar-gregorian-from-absolute % 7 6 20 21 "Tzom Tammuz" calendar-dayname-on-or-before "Shabbat Hazon" "Tisha B'Av" "Shabbat Nahamu"] 16))

(defun filter-visible-calendar-holidays (l) "\
Return a list of all visible holidays of those on L." (byte-code "Á
…! Ä
@@!… Å
@C\"‰ˆ
A‰ˆ‚ ˆ*‡" [visible nil p l calendar-date-is-visible-p append] 5))
