aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-04-11 03:47:38 +0000
committerGlenn Morris2008-04-11 03:47:38 +0000
commitb106af42c3d341a8436b8221b9eb030d27b8858c (patch)
tree81cb4c29c17c58a3b825de5737086d7bf628e0fa
parentfe5ffe0b8428746bbb727d5e2c6f9d5dcb930e25 (diff)
downloademacs-b106af42c3d341a8436b8221b9eb030d27b8858c.tar.gz
emacs-b106af42c3d341a8436b8221b9eb030d27b8858c.zip
(diary, holidays): Move custom groups to other files.
(holiday-general-holidays, holiday-oriental-holidays) (holiday-local-holidays, holiday-other-holidays, hebrew-holidays-1) (hebrew-holidays-2, hebrew-holidays-3, hebrew-holidays-4) (holiday-hebrew-holidays, holiday-christian-holidays) (holiday-islamic-holidays, holiday-bahai-holidays) (holiday-solar-holidays, calendar-holidays): Move to holidays.el.
-rw-r--r--lisp/calendar/calendar.el404
1 files changed, 1 insertions, 403 deletions
diff --git a/lisp/calendar/calendar.el b/lisp/calendar/calendar.el
index 01c36bf3c5e..ffac70de5e5 100644
--- a/lisp/calendar/calendar.el
+++ b/lisp/calendar/calendar.el
@@ -122,7 +122,6 @@
122(provide 'calendar) 122(provide 'calendar)
123(require 'cal-menu) 123(require 'cal-menu)
124 124
125
126(defgroup calendar nil 125(defgroup calendar nil
127 "Calendar and time management support." 126 "Calendar and time management support."
128 :prefix "calendar-" 127 :prefix "calendar-"
@@ -133,18 +132,6 @@
133 :prefix "calendar-" 132 :prefix "calendar-"
134 :group 'calendar) 133 :group 'calendar)
135 134
136(defgroup diary nil
137 "Emacs diary."
138 :prefix "diary-"
139 :group 'calendar)
140
141(defgroup holidays nil
142 "Holidays support in calendar."
143 :group 'calendar
144 :prefix "holidays-"
145 :group 'local)
146
147
148(defcustom calendar-offset 0 135(defcustom calendar-offset 0
149 "The offset of the principal month from the center of the calendar window. 136 "The offset of the principal month from the center of the calendar window.
1500 means the principal month is in the center (default), -1 means on the left, 1370 means the principal month is in the center (default), -1 means on the left,
@@ -522,6 +509,7 @@ calendar package is already loaded). Rather, use either
522 :group 'calendar) 509 :group 'calendar)
523 510
524;; Next three are provided to aid in setting diary-date-forms. 511;; Next three are provided to aid in setting diary-date-forms.
512;; FIXME move to diary-lib?
525(defcustom diary-iso-date-forms 513(defcustom diary-iso-date-forms
526 '((month "[-/]" day "[^-/0-9]") 514 '((month "[-/]" day "[^-/0-9]")
527 (year "[-/]" month "[-/]" day "[^0-9]") 515 (year "[-/]" month "[-/]" day "[^0-9]")
@@ -751,76 +739,6 @@ somewhat; setting it to nil makes the diary display faster."
751 :type 'boolean 739 :type 'boolean
752 :group 'calendar) 740 :group 'calendar)
753 741
754;; The various holiday variables are autoloaded because people
755;; are used to using them to set calendar-holidays without having to
756;; explicitly load this file.
757
758;; FIXME move to holidays.el?
759
760;;;###autoload
761(defcustom holiday-general-holidays
762 '((holiday-fixed 1 1 "New Year's Day")
763 (holiday-float 1 1 3 "Martin Luther King Day")
764 (holiday-fixed 2 2 "Groundhog Day")
765 (holiday-fixed 2 14 "Valentine's Day")
766 (holiday-float 2 1 3 "President's Day")
767 (holiday-fixed 3 17 "St. Patrick's Day")
768 (holiday-fixed 4 1 "April Fools' Day")
769 (holiday-float 5 0 2 "Mother's Day")
770 (holiday-float 5 1 -1 "Memorial Day")
771 (holiday-fixed 6 14 "Flag Day")
772 (holiday-float 6 0 3 "Father's Day")
773 (holiday-fixed 7 4 "Independence Day")
774 (holiday-float 9 1 1 "Labor Day")
775 (holiday-float 10 1 2 "Columbus Day")
776 (holiday-fixed 10 31 "Halloween")
777 (holiday-fixed 11 11 "Veteran's Day")
778 (holiday-float 11 4 4 "Thanksgiving"))
779 "General holidays. Default value is for the United States.
780See the documentation for `calendar-holidays' for details."
781 :type 'sexp
782 :group 'holidays)
783;;;###autoload
784(put 'holiday-general-holidays 'risky-local-variable t)
785;;;###autoload
786(define-obsolete-variable-alias 'general-holidays
787 'holiday-general-holidays "23.1")
788
789;;;###autoload
790(defcustom holiday-oriental-holidays
791 '((holiday-chinese-new-year))
792 "Oriental holidays.
793See the documentation for `calendar-holidays' for details."
794 :type 'sexp
795 :group 'holidays)
796;;;###autoload
797(put 'holiday-oriental-holidays 'risky-local-variable t)
798;;;###autoload
799(define-obsolete-variable-alias 'oriental-holidays
800 'holiday-oriental-holidays "23.1")
801
802;;;###autoload
803(defcustom holiday-local-holidays nil
804 "Local holidays.
805See the documentation for `calendar-holidays' for details."
806 :type 'sexp
807 :group 'holidays)
808;;;###autoload
809(put 'holiday-local-holidays 'risky-local-variable t)
810;;;###autoload
811(define-obsolete-variable-alias 'local-holidays 'holiday-local-holidays "23.1")
812
813;;;###autoload
814(defcustom holiday-other-holidays nil
815 "User defined holidays.
816See the documentation for `calendar-holidays' for details."
817 :type 'sexp
818 :group 'holidays)
819;;;###autoload
820(put 'holiday-other-holidays 'risky-local-variable t)
821;;;###autoload
822(define-obsolete-variable-alias 'other-holidays 'holiday-other-holidays "23.1")
823
824(defcustom calendar-hebrew-all-holidays-flag nil 742(defcustom calendar-hebrew-all-holidays-flag nil
825 "If nil, show only major holidays from the Hebrew calendar. 743 "If nil, show only major holidays from the Hebrew calendar.
826This means only those Jewish holidays that appear on secular calendars. 744This means only those Jewish holidays that appear on secular calendars.
@@ -832,121 +750,6 @@ calendar."
832(define-obsolete-variable-alias 'all-hebrew-calendar-holidays 750(define-obsolete-variable-alias 'all-hebrew-calendar-holidays
833 'calendar-hebrew-all-holidays-flag "23.1") 751 'calendar-hebrew-all-holidays-flag "23.1")
834 752
835;;;###autoload
836(defvar hebrew-holidays-1
837 '((holiday-hebrew-rosh-hashanah)
838 (if calendar-hebrew-all-holidays-flag
839 (holiday-julian
840 11
841 (let ((m displayed-month)
842 (y displayed-year)
843 year)
844 (calendar-increment-month m y -1)
845 (setq year (calendar-extract-year
846 (calendar-julian-from-absolute
847 (calendar-absolute-from-gregorian (list m 1 y)))))
848 (if (zerop (% (1+ year) 4))
849 22
850 21)) "\"Tal Umatar\" (evening)")))
851 "Component of the old default value of `holiday-hebrew-holidays'.")
852;;;###autoload
853(put 'hebrew-holidays-1 'risky-local-variable t)
854(make-obsolete-variable 'hebrew-holidays-1 'hebrew-holidays "23.1")
855
856;;;###autoload
857(defvar hebrew-holidays-2
858 '((holiday-hebrew-hanukkah) ; respects calendar-hebrew-all-holidays-flag
859 (if calendar-hebrew-all-holidays-flag
860 (holiday-hebrew
861 10
862 (let ((h-year (calendar-extract-year
863 (calendar-hebrew-from-absolute
864 (calendar-absolute-from-gregorian
865 (list displayed-month 28 displayed-year))))))
866 (if (= 6 (% (calendar-hebrew-to-absolute (list 10 10 h-year))
867 7))
868 11 10))
869 "Tzom Teveth"))
870 (if calendar-hebrew-all-holidays-flag
871 (holiday-hebrew 11 15 "Tu B'Shevat")))
872 "Component of the old default value of `holiday-hebrew-holidays'.")
873;;;###autoload
874(put 'hebrew-holidays-2 'risky-local-variable t)
875(make-obsolete-variable 'hebrew-holidays-2 'hebrew-holidays "23.1")
876
877;;;###autoload
878(defvar hebrew-holidays-3
879 '((if calendar-hebrew-all-holidays-flag
880 (holiday-hebrew
881 11
882 (let* ((m displayed-month)
883 (y displayed-year)
884 (h-year (progn
885 (calendar-increment-month m y 1)
886 (calendar-extract-year
887 (calendar-hebrew-from-absolute
888 (calendar-absolute-from-gregorian
889 (list m (calendar-last-day-of-month m y) y))))))
890 (s-s
891 (calendar-hebrew-from-absolute
892 (if (= 6
893 (% (calendar-hebrew-to-absolute
894 (list 7 1 h-year))
895 7))
896 (calendar-dayname-on-or-before
897 6 (calendar-hebrew-to-absolute
898 (list 11 17 h-year)))
899 (calendar-dayname-on-or-before
900 6 (calendar-hebrew-to-absolute
901 (list 11 16 h-year))))))
902 (day (calendar-extract-day s-s)))
903 day)
904 "Shabbat Shirah")))
905 "Component of the old default value of `holiday-hebrew-holidays'.")
906;;;###autoload
907(put 'hebrew-holidays-3 'risky-local-variable t)
908(make-obsolete-variable 'hebrew-holidays-3 'hebrew-holidays "23.1")
909
910;;;###autoload
911(defvar hebrew-holidays-4
912 '((holiday-hebrew-passover)
913 (and calendar-hebrew-all-holidays-flag
914 (let* ((m displayed-month)
915 (y displayed-year)
916 (year (progn
917 (calendar-increment-month m y -1)
918 (calendar-extract-year
919 (calendar-julian-from-absolute
920 (calendar-absolute-from-gregorian (list m 1 y)))))))
921 (= 21 (% year 28)))
922 (holiday-julian 3 26 "Kiddush HaHamah"))
923 (if calendar-hebrew-all-holidays-flag
924 (holiday-hebrew-tisha-b-av)))
925 "Component of the old default value of `holiday-hebrew-holidays'.")
926;;;###autoload
927(put 'hebrew-holidays-4 'risky-local-variable t)
928(make-obsolete-variable 'hebrew-holidays-4 'hebrew-holidays "23.1")
929
930;;;###autoload
931(defcustom holiday-hebrew-holidays
932 '((holiday-hebrew-passover)
933 (holiday-hebrew-rosh-hashanah)
934 (holiday-hebrew-hanukkah)
935 (if calendar-hebrew-all-holidays-flag
936 (append
937 (holiday-hebrew-tisha-b-av)
938 (holiday-hebrew-misc))))
939 "Jewish holidays.
940See the documentation for `calendar-holidays' for details."
941 :type 'sexp
942 :version "23.1" ; removed dependency on hebrew-holidays-N
943 :group 'holidays)
944;;;###autoload
945(put 'holiday-hebrew-holidays 'risky-local-variable t)
946;;;###autoload
947(define-obsolete-variable-alias 'hebrew-holidays
948 'holiday-hebrew-holidays "23.1")
949
950(defcustom calendar-christian-all-holidays-flag nil 753(defcustom calendar-christian-all-holidays-flag nil
951 "If nil, show only major holidays from the Christian calendar. 754 "If nil, show only major holidays from the Christian calendar.
952This means only those Christian holidays that appear on secular calendars. 755This means only those Christian holidays that appear on secular calendars.
@@ -958,27 +761,6 @@ calendar."
958(define-obsolete-variable-alias 'all-christian-calendar-holidays 761(define-obsolete-variable-alias 'all-christian-calendar-holidays
959 'calendar-christian-all-holidays-flag "23.1") 762 'calendar-christian-all-holidays-flag "23.1")
960 763
961;;;###autoload
962(defcustom holiday-christian-holidays
963 '((holiday-easter-etc) ; respects calendar-christian-all-holidays-flag
964 (holiday-fixed 12 25 "Christmas")
965 (if calendar-christian-all-holidays-flag
966 (append
967 (holiday-fixed 1 6 "Epiphany")
968 (holiday-julian 12 25 "Eastern Orthodox Christmas")
969 (holiday-greek-orthodox-easter)
970 (holiday-fixed 8 15 "Assumption")
971 (holiday-advent 0 "Advent"))))
972 "Christian holidays.
973See the documentation for `calendar-holidays' for details."
974 :type 'sexp
975 :group 'holidays)
976;;;###autoload
977(put 'holiday-christian-holidays 'risky-local-variable t)
978;;;###autoload
979(define-obsolete-variable-alias 'christian-holidays
980 'holiday-christian-holidays "23.1")
981
982(defcustom calendar-islamic-all-holidays-flag nil 764(defcustom calendar-islamic-all-holidays-flag nil
983 "If nil, show only major holidays from the Islamic calendar. 765 "If nil, show only major holidays from the Islamic calendar.
984This means only those Islamic holidays that appear on secular calendars. 766This means only those Islamic holidays that appear on secular calendars.
@@ -990,29 +772,6 @@ calendar."
990(define-obsolete-variable-alias 'all-islamic-calendar-holidays 772(define-obsolete-variable-alias 'all-islamic-calendar-holidays
991 'calendar-islamic-all-holidays-flag "23.1") 773 'calendar-islamic-all-holidays-flag "23.1")
992 774
993;;;###autoload
994(defcustom holiday-islamic-holidays
995 '((holiday-islamic-new-year)
996 (holiday-islamic 9 1 "Ramadan Begins")
997 (if calendar-islamic-all-holidays-flag
998 (append
999 (holiday-islamic 1 10 "Ashura")
1000 (holiday-islamic 3 12 "Mulad-al-Nabi")
1001 (holiday-islamic 7 26 "Shab-e-Mi'raj")
1002 (holiday-islamic 8 15 "Shab-e-Bara't")
1003 (holiday-islamic 9 27 "Shab-e Qadr")
1004 (holiday-islamic 10 1 "Id-al-Fitr")
1005 (holiday-islamic 12 10 "Id-al-Adha"))))
1006 "Islamic holidays.
1007See the documentation for `calendar-holidays' for details."
1008 :type 'sexp
1009 :group 'holidays)
1010;;;###autoload
1011(put 'holiday-islamic-holidays 'risky-local-variable t)
1012;;;###autoload
1013(define-obsolete-variable-alias 'islamic-holidays
1014 'holiday-islamic-holidays "23.1")
1015
1016(defcustom calendar-bahai-all-holidays-flag nil 775(defcustom calendar-bahai-all-holidays-flag nil
1017 "If nil, show only major holidays from the Baha'i calendar. 776 "If nil, show only major holidays from the Baha'i calendar.
1018These are the days on which work and school must be suspended. 777These are the days on which work and school must be suspended.
@@ -1024,167 +783,6 @@ calendar."
1024(define-obsolete-variable-alias 'all-bahai-calendar-holidays 783(define-obsolete-variable-alias 'all-bahai-calendar-holidays
1025 'calendar-bahai-all-holidays-flag "23.1") 784 'calendar-bahai-all-holidays-flag "23.1")
1026 785
1027;;;###autoload
1028(defcustom holiday-bahai-holidays
1029 '((holiday-bahai-new-year)
1030 (holiday-bahai-ridvan) ; respects calendar-bahai-all-holidays-flag
1031 (holiday-fixed 5 23 "Declaration of the Bab")
1032 (holiday-fixed 5 29 "Ascension of Baha'u'llah")
1033 (holiday-fixed 7 9 "Martyrdom of the Bab")
1034 (holiday-fixed 10 20 "Birth of the Bab")
1035 (holiday-fixed 11 12 "Birth of Baha'u'llah")
1036 (if calendar-bahai-all-holidays-flag
1037 (append
1038 (holiday-fixed 11 26 "Day of the Covenant")
1039 (holiday-fixed 11 28 "Ascension of `Abdu'l-Baha"))))
1040 "Baha'i holidays.
1041See the documentation for `calendar-holidays' for details."
1042 :type 'sexp
1043 :group 'holidays)
1044;;;###autoload
1045(put 'holiday-bahai-holidays 'risky-local-variable t)
1046;;;###autoload
1047(define-obsolete-variable-alias 'bahai-holidays 'holiday-bahai-holidays "23.1")
1048
1049;;;###autoload
1050(defcustom holiday-solar-holidays
1051 '((solar-equinoxes-solstices)
1052 (holiday-sexp calendar-daylight-savings-starts
1053 (format "Daylight Saving Time Begins %s"
1054 (solar-time-string
1055 (/ calendar-daylight-savings-starts-time (float 60))
1056 calendar-standard-time-zone-name)))
1057 (holiday-sexp calendar-daylight-savings-ends
1058 (format "Daylight Saving Time Ends %s"
1059 (solar-time-string
1060 (/ calendar-daylight-savings-ends-time (float 60))
1061 calendar-daylight-time-zone-name))))
1062 "Sun-related holidays.
1063See the documentation for `calendar-holidays' for details."
1064 :type 'sexp
1065 :group 'holidays)
1066;;;###autoload
1067(put 'holiday-solar-holidays 'risky-local-variable t)
1068;;;###autoload
1069(define-obsolete-variable-alias 'solar-holidays 'holiday-solar-holidays "23.1")
1070
1071;;;###autoload
1072(defcustom calendar-holidays
1073 (append holiday-general-holidays holiday-local-holidays
1074 holiday-other-holidays holiday-christian-holidays
1075 holiday-hebrew-holidays holiday-islamic-holidays
1076 holiday-bahai-holidays holiday-oriental-holidays
1077 holiday-solar-holidays)
1078 "List of notable days for the command \\[holidays].
1079
1080Additional holidays are easy to add to the list, just put them in the
1081list `holiday-other-holidays' in your .emacs file. Similarly, by setting
1082any of `holiday-general-holidays', `holiday-local-holidays',
1083`holiday-christian-holidays', `holiday-hebrew-holidays',
1084`holiday-islamic-holidays', `holiday-bahai-holidays',
1085`holiday-oriental-holidays', or `holiday-solar-holidays' to nil in your
1086.emacs file, you can eliminate unwanted categories of holidays.
1087
1088The aforementioned variables control the holiday choices offered
1089by the function `holiday-list' when it is called interactively.
1090
1091They also initialize the default value of `calendar-holidays',
1092which is the default list of holidays used by the function
1093`holiday-list' in the non-interactive case. Note that these
1094variables have no effect on `calendar-holidays' after it has been
1095set (e.g. after the calendar is loaded). In that case, customize
1096`calendar-holidays' directly.
1097
1098The intention is that (in the US) `holiday-local-holidays' be set in
1099site-init.el and `holiday-other-holidays' be set by the user.
1100
1101Entries on the list are expressions that return (possibly empty) lists of
1102items of the form ((month day year) string) of a holiday in the
1103three-month period centered around `displayed-month' of `displayed-year'.
1104Several basic functions are provided for this purpose:
1105
1106 (holiday-fixed MONTH DAY STRING) is a fixed date on the Gregorian calendar
1107 (holiday-float MONTH DAYNAME K STRING &optional day) is the Kth DAYNAME in
1108 MONTH on the Gregorian calendar (0 for Sunday,
1109 etc.); K<0 means count back from the end of the
1110 month. An optional parameter DAY means the Kth
1111 DAYNAME after/before MONTH DAY.
1112 (holiday-hebrew MONTH DAY STRING) a fixed date on the Hebrew calendar
1113 (holiday-islamic MONTH DAY STRING) a fixed date on the Islamic calendar
1114 (holiday-bahai MONTH DAY STRING) a fixed date on the Baha'i calendar
1115 (holiday-julian MONTH DAY STRING) a fixed date on the Julian calendar
1116 (holiday-sexp SEXP STRING) SEXP is a Gregorian-date-valued expression
1117 in the variable `year'; if it evaluates to
1118 a visible date, that's the holiday; if it
1119 evaluates to nil, there's no holiday. STRING
1120 is an expression in the variable `date'.
1121
1122For example, to add Bastille Day, celebrated in France on July 14, add
1123
1124 (holiday-fixed 7 14 \"Bastille Day\")
1125
1126to the list. To add Hurricane Supplication Day, celebrated in the Virgin
1127Islands on the fourth Monday in August, add
1128
1129 (holiday-float 8 1 4 \"Hurricane Supplication Day\")
1130
1131to the list (the last Monday would be specified with `-1' instead of `4').
1132To add the last day of Hanukkah to the list, use
1133
1134 (holiday-hebrew 10 2 \"Last day of Hanukkah\")
1135
1136since the Hebrew months are numbered with 1 starting from Nisan.
1137To add the Islamic feast celebrating Mohammed's birthday, use
1138
1139 (holiday-islamic 3 12 \"Mohammed's Birthday\")
1140
1141since the Islamic months are numbered from 1 starting with Muharram.
1142To add an entry for the Baha'i festival of Ridvan, use
1143
1144 (holiday-bahai 2 13 \"Festival of Ridvan\")
1145
1146since the Baha'i months are numbered from 1 starting with Baha.
1147To add Thomas Jefferson's birthday, April 2, 1743 (Julian), use
1148
1149 (holiday-julian 4 2 \"Jefferson's Birthday\")
1150
1151To include a holiday conditionally, use the sexp form or a conditional. For
1152example, to include American presidential elections, which occur on the first
1153Tuesday after the first Monday in November of years divisible by 4, add
1154
1155 (holiday-sexp
1156 '(if (zerop (% year 4))
1157 (calendar-gregorian-from-absolute
1158 (1+ (calendar-dayname-on-or-before
1159 1 (+ 6 (calendar-absolute-from-gregorian
1160 (list 11 1 year)))))))
1161 \"US Presidential Election\")
1162
1163or
1164
1165 (if (zerop (% displayed-year 4))
1166 (holiday-fixed 11
1167 (calendar-extract-day
1168 (calendar-gregorian-from-absolute
1169 (1+ (calendar-dayname-on-or-before
1170 1 (+ 6 (calendar-absolute-from-gregorian
1171 (list 11 1 displayed-year)))))))
1172 \"US Presidential Election\"))
1173
1174to the list. To include the phases of the moon, add
1175
1176 (lunar-phases)
1177
1178to the holiday list, where `lunar-phases' is an Emacs-Lisp function that
1179you've written to return a (possibly empty) list of the relevant VISIBLE dates
1180with descriptive strings such as
1181
1182 (((2 6 1989) \"New Moon\") ((2 12 1989) \"First Quarter Moon\") ... )."
1183 :type 'sexp
1184 :group 'holidays)
1185;;;###autoload
1186(put 'calendar-holidays 'risky-local-variable t)
1187
1188;;; End of user options. 786;;; End of user options.
1189 787
1190(defconst calendar-buffer "*Calendar*" 788(defconst calendar-buffer "*Calendar*"