Mercurial > emacs
annotate lisp/calendar/cal-hebrew.el @ 92817:1b8224570e5f
(list-yahrzeit-dates): Use cal-hebrew-yahrzeit-buffer.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Thu, 13 Mar 2008 03:50:40 +0000 |
parents | 6a990f964e22 |
children | 669faa35f924 |
rev | line source |
---|---|
38422
7a94f1c588c4
Some fixes to follow coding conventions.
Pavel Janík <Pavel@Janik.cz>
parents:
24187
diff
changeset
|
1 ;;; cal-hebrew.el --- calendar functions for the Hebrew calendar |
13050 | 2 |
92611
297952467e34
(mark-hebrew-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents:
92583
diff
changeset
|
3 ;; Copyright (C) 1995, 1997, 2001, 2002, 2003, 2004, 2005, 2006, 2007, |
297952467e34
(mark-hebrew-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents:
92583
diff
changeset
|
4 ;; 2008 Free Software Foundation, Inc. |
13050 | 5 |
13051
0351b3061992
*** empty log message ***
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
13050
diff
changeset
|
6 ;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu> |
13050 | 7 ;; Edward M. Reingold <reingold@cs.uiuc.edu> |
67465
a55ee709ec8d
Update copyright pending Emacs 22.
Glenn Morris <rgm@gnu.org>
parents:
65143
diff
changeset
|
8 ;; Maintainer: Glenn Morris <rgm@gnu.org> |
13050 | 9 ;; Keywords: calendar |
10 ;; Human-Keywords: Hebrew calendar, calendar, diary | |
11 | |
12 ;; This file is part of GNU Emacs. | |
13 | |
14 ;; GNU Emacs is free software; you can redistribute it and/or modify | |
15 ;; it under the terms of the GNU General Public License as published by | |
78216
93e11478c954
Switch license to GPLv3 or later.
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
16 ;; the Free Software Foundation; either version 3, or (at your option) |
13050 | 17 ;; any later version. |
18 | |
19 ;; GNU Emacs is distributed in the hope that it will be useful, | |
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of | |
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
22 ;; GNU General Public License for more details. | |
23 | |
24 ;; You should have received a copy of the GNU General Public License | |
14169 | 25 ;; along with GNU Emacs; see the file COPYING. If not, write to the |
64085 | 26 ;; Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, |
27 ;; Boston, MA 02110-1301, USA. | |
13050 | 28 |
29 ;;; Commentary: | |
30 | |
31 ;; This collection of functions implements the features of calendar.el and | |
32 ;; diary.el that deal with the Hebrew calendar. | |
33 | |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20267
diff
changeset
|
34 ;; Technical details of all the calendrical calculations can be found in |
61148
7f7db25577d9
Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents:
54074
diff
changeset
|
35 ;; ``Calendrical Calculations: The Millennium Edition'' by Edward M. Reingold |
7f7db25577d9
Update reference to "Calendrical Calculations" book; there's a new edition.
Paul Eggert <eggert@twinsun.com>
parents:
54074
diff
changeset
|
36 ;; and Nachum Dershowitz, Cambridge University Press (2001). |
20462
d179de7ad92e
Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents:
20267
diff
changeset
|
37 |
13050 | 38 ;;; Code: |
39 | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
40 (defvar displayed-month) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
41 (defvar displayed-year) |
65143
e461582f967a
(date, entry, number, original-date): Add defvars.
Juanma Barranquero <lekktu@gmail.com>
parents:
64085
diff
changeset
|
42 (defvar original-date) |
13050 | 43 |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
44 (require 'calendar) |
13050 | 45 |
46 (defun hebrew-calendar-leap-year-p (year) | |
92667 | 47 "Non-nil if YEAR is a Hebrew calendar leap year." |
13050 | 48 (< (% (1+ (* 7 year)) 19) 7)) |
49 | |
50 (defun hebrew-calendar-last-month-of-year (year) | |
51 "The last month of the Hebrew calendar YEAR." | |
52 (if (hebrew-calendar-leap-year-p year) | |
53 13 | |
54 12)) | |
55 | |
56 (defun hebrew-calendar-elapsed-days (year) | |
92667 | 57 "Days from Sunday before start of Hebrew calendar to mean conjunction of Tishri of Hebrew YEAR." |
13050 | 58 (let* ((months-elapsed |
92658 | 59 (+ (* 235 (/ (1- year) 19)) ; months in complete cycles so far |
60 (* 12 (% (1- year) 19)) ; regular months in this cycle | |
61 (/ (1+ (* 7 (% (1- year) 19))) 19))) ; leap months this cycle | |
13050 | 62 (parts-elapsed (+ 204 (* 793 (% months-elapsed 1080)))) |
63 (hours-elapsed (+ 5 | |
64 (* 12 months-elapsed) | |
65 (* 793 (/ months-elapsed 1080)) | |
66 (/ parts-elapsed 1080))) | |
92658 | 67 (parts ; conjunction parts |
13050 | 68 (+ (* 1080 (% hours-elapsed 24)) (% parts-elapsed 1080))) |
92658 | 69 (day ; conjunction day |
13050 | 70 (+ 1 (* 29 months-elapsed) (/ hours-elapsed 24))) |
71 (alternative-day | |
92658 | 72 (if (or (>= parts 19440) ; if the new moon is at or after midday |
73 (and (= (% day 7) 2) ; ...or is on a Tuesday... | |
74 (>= parts 9924) ; at 9 hours, 204 parts or later... | |
75 ;; of a common year... | |
76 (not (hebrew-calendar-leap-year-p year))) | |
77 (and (= (% day 7) 1) ; ...or is on a Monday... | |
78 (>= parts 16789) ; at 15 hours, 589 parts or later... | |
79 ;; at the end of a leap year. | |
80 (hebrew-calendar-leap-year-p (1- year)))) | |
81 ;; Then postpone Rosh HaShanah one day. | |
13050 | 82 (1+ day) |
92658 | 83 ;; Else: |
13050 | 84 day))) |
92658 | 85 ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday |
86 (if (memq (% alternative-day 7) (list 0 3 5)) | |
87 ;; Then postpone it one (more) day and return. | |
13050 | 88 (1+ alternative-day) |
92658 | 89 ;; Else return. |
13050 | 90 alternative-day))) |
91 | |
92 (defun hebrew-calendar-days-in-year (year) | |
93 "Number of days in Hebrew YEAR." | |
94 (- (hebrew-calendar-elapsed-days (1+ year)) | |
95 (hebrew-calendar-elapsed-days year))) | |
96 | |
97 (defun hebrew-calendar-long-heshvan-p (year) | |
92667 | 98 "Non-nil if Heshvan is long in Hebrew YEAR." |
13050 | 99 (= (% (hebrew-calendar-days-in-year year) 10) 5)) |
100 | |
101 (defun hebrew-calendar-short-kislev-p (year) | |
92667 | 102 "Non-nil if Kislev is short in Hebrew YEAR." |
13050 | 103 (= (% (hebrew-calendar-days-in-year year) 10) 3)) |
104 | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
105 (defun hebrew-calendar-last-day-of-month (month year) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
106 "The last day of MONTH in YEAR." |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
107 (if (or (memq month (list 2 4 6 10 13)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
108 (and (= month 12) (not (hebrew-calendar-leap-year-p year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
109 (and (= month 8) (not (hebrew-calendar-long-heshvan-p year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
110 (and (= month 9) (hebrew-calendar-short-kislev-p year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
111 29 |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
112 30)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
113 |
13050 | 114 (defun calendar-absolute-from-hebrew (date) |
115 "Absolute date of Hebrew DATE. | |
116 The absolute date is the number of days elapsed since the (imaginary) | |
117 Gregorian date Sunday, December 31, 1 BC." | |
118 (let* ((month (extract-calendar-month date)) | |
119 (day (extract-calendar-day date)) | |
120 (year (extract-calendar-year date))) | |
92658 | 121 (+ day ; days so far this month |
122 (if (< month 7) ; before Tishri | |
123 ;; Then add days in prior months this year before and after Nisan. | |
13050 | 124 (+ (calendar-sum |
125 m 7 (<= m (hebrew-calendar-last-month-of-year year)) | |
126 (hebrew-calendar-last-day-of-month m year)) | |
127 (calendar-sum | |
128 m 1 (< m month) | |
129 (hebrew-calendar-last-day-of-month m year))) | |
92658 | 130 ;; Else add days in prior months this year. |
13050 | 131 (calendar-sum |
132 m 7 (< m month) | |
133 (hebrew-calendar-last-day-of-month m year))) | |
92658 | 134 (hebrew-calendar-elapsed-days year) ; days in prior years |
135 -1373429))) ; days elapsed before absolute date 1 | |
13050 | 136 |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
137 (defun calendar-hebrew-from-absolute (date) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
138 "Compute the Hebrew date (month day year) corresponding to absolute DATE. |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
139 The absolute date is the number of days elapsed since the (imaginary) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
140 Gregorian date Sunday, December 31, 1 BC." |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
141 (let* ((greg-date (calendar-gregorian-from-absolute date)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
142 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8] |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
143 (1- (extract-calendar-month greg-date)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
144 (day) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
145 (year (+ 3760 (extract-calendar-year greg-date)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
146 (while (>= date (calendar-absolute-from-hebrew (list 7 1 (1+ year)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
147 (setq year (1+ year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
148 (let ((length (hebrew-calendar-last-month-of-year year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
149 (while (> date |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
150 (calendar-absolute-from-hebrew |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
151 (list month |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
152 (hebrew-calendar-last-day-of-month month year) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
153 year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
154 (setq month (1+ (% month length))))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
155 (setq day (1+ |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
156 (- date (calendar-absolute-from-hebrew (list month 1 year))))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
157 (list month day year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
158 |
13050 | 159 (defvar calendar-hebrew-month-name-array-common-year |
160 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
161 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"] |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
162 "Array of strings giving the names of the Hebrew months in a common year.") |
13050 | 163 |
164 (defvar calendar-hebrew-month-name-array-leap-year | |
165 ["Nisan" "Iyar" "Sivan" "Tammuz" "Av" "Elul" "Tishri" | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
166 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"] |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
167 "Array of strings giving the names of the Hebrew months in a leap year.") |
13050 | 168 |
169 (defun calendar-hebrew-date-string (&optional date) | |
170 "String of Hebrew date before sunset of Gregorian DATE. | |
171 Defaults to today's date if DATE is not given. | |
172 Driven by the variable `calendar-date-display-form'." | |
173 (let* ((hebrew-date (calendar-hebrew-from-absolute | |
174 (calendar-absolute-from-gregorian | |
175 (or date (calendar-current-date))))) | |
176 (calendar-month-name-array | |
177 (if (hebrew-calendar-leap-year-p (extract-calendar-year hebrew-date)) | |
178 calendar-hebrew-month-name-array-leap-year | |
179 calendar-hebrew-month-name-array-common-year))) | |
180 (calendar-date-string hebrew-date nil t))) | |
181 | |
182 (defun calendar-print-hebrew-date () | |
183 "Show the Hebrew calendar equivalent of the date under the cursor." | |
184 (interactive) | |
185 (message "Hebrew date (until sunset): %s" | |
186 (calendar-hebrew-date-string (calendar-cursor-to-date t)))) | |
187 | |
188 (defun hebrew-calendar-yahrzeit (death-date year) | |
189 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR." | |
190 (let* ((death-day (extract-calendar-day death-date)) | |
191 (death-month (extract-calendar-month death-date)) | |
192 (death-year (extract-calendar-year death-date))) | |
193 (cond | |
194 ;; If it's Heshvan 30 it depends on the first anniversary; if | |
195 ;; that was not Heshvan 30, use the day before Kislev 1. | |
196 ((and (= death-month 8) | |
197 (= death-day 30) | |
198 (not (hebrew-calendar-long-heshvan-p (1+ death-year)))) | |
199 (1- (calendar-absolute-from-hebrew (list 9 1 year)))) | |
92658 | 200 ;; If it's Kislev 30 it depends on the first anniversary; if that |
201 ;; was not Kislev 30, use the day before Teveth 1. | |
13050 | 202 ((and (= death-month 9) |
203 (= death-day 30) | |
204 (hebrew-calendar-short-kislev-p (1+ death-year))) | |
205 (1- (calendar-absolute-from-hebrew (list 10 1 year)))) | |
92658 | 206 ;; If it's Adar II, use the same day in last month of year (Adar |
207 ;; or Adar II). | |
13050 | 208 ((= death-month 13) |
209 (calendar-absolute-from-hebrew | |
210 (list (hebrew-calendar-last-month-of-year year) death-day year))) | |
92658 | 211 ;; If it's the 30th in Adar I and year is not a leap year (so |
212 ;; Adar has only 29 days), use the last day in Shevat. | |
13050 | 213 ((and (= death-day 30) |
214 (= death-month 12) | |
215 (not (hebrew-calendar-leap-year-p year))) | |
216 (calendar-absolute-from-hebrew (list 11 30 year))) | |
217 ;; In all other cases, use the normal anniversary of the date of death. | |
218 (t (calendar-absolute-from-hebrew | |
219 (list death-month death-day year)))))) | |
220 | |
221 (defun calendar-goto-hebrew-date (date &optional noecho) | |
222 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is t." | |
223 (interactive | |
224 (let* ((today (calendar-current-date)) | |
225 (year (calendar-read | |
226 "Hebrew calendar year (>3760): " | |
92583 | 227 (lambda (x) (> x 3760)) |
13050 | 228 (int-to-string |
229 (extract-calendar-year | |
230 (calendar-hebrew-from-absolute | |
231 (calendar-absolute-from-gregorian today)))))) | |
232 (month-array (if (hebrew-calendar-leap-year-p year) | |
233 calendar-hebrew-month-name-array-leap-year | |
234 calendar-hebrew-month-name-array-common-year)) | |
235 (completion-ignore-case t) | |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
236 (month (cdr (assoc-string |
24187
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
237 (completing-read |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
238 "Hebrew calendar month name: " |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
239 (mapcar 'list (append month-array nil)) |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
240 (if (= year 3761) |
92583 | 241 (lambda (x) |
24187
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
242 (let ((m (cdr |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
243 (assoc-string |
24187
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
244 (car x) |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
245 (calendar-make-alist month-array) |
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
246 t)))) |
24187
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
247 (< 0 |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
248 (calendar-absolute-from-hebrew |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
249 (list m |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
250 (hebrew-calendar-last-day-of-month |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
251 m year) |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
252 year)))))) |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
253 t) |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
254 (calendar-make-alist month-array 1) t))) |
13050 | 255 (last (hebrew-calendar-last-day-of-month month year)) |
256 (first (if (and (= year 3761) (= month 10)) | |
257 18 1)) | |
258 (day (calendar-read | |
259 (format "Hebrew calendar day (%d-%d): " | |
260 first last) | |
92583 | 261 (lambda (x) (and (<= first x) (<= x last)))))) |
13050 | 262 (list (list month day year)))) |
263 (calendar-goto-date (calendar-gregorian-from-absolute | |
264 (calendar-absolute-from-hebrew date))) | |
265 (or noecho (calendar-print-hebrew-date))) | |
266 | |
267 (defun holiday-hebrew (month day string) | |
268 "Holiday on MONTH, DAY (Hebrew) called STRING. | |
269 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding | |
270 Gregorian date in the form of the list (((month day year) STRING)). Returns | |
271 nil if it is not visible in the current calendar window." | |
92658 | 272 ;; This test is only to speed things up a bit; it works fine without it. |
273 (if (memq displayed-month | |
274 (list | |
13050 | 275 (if (< 11 month) (- month 11) (+ month 1)) |
276 (if (< 10 month) (- month 10) (+ month 2)) | |
277 (if (< 9 month) (- month 9) (+ month 3)) | |
278 (if (< 8 month) (- month 8) (+ month 4)) | |
279 (if (< 7 month) (- month 7) (+ month 5)))) | |
280 (let ((m1 displayed-month) | |
281 (y1 displayed-year) | |
282 (m2 displayed-month) | |
283 (y2 displayed-year) | |
284 (year)) | |
285 (increment-calendar-month m1 y1 -1) | |
286 (increment-calendar-month m2 y2 1) | |
287 (let* ((start-date (calendar-absolute-from-gregorian | |
288 (list m1 1 y1))) | |
289 (end-date (calendar-absolute-from-gregorian | |
290 (list m2 (calendar-last-day-of-month m2 y2) y2))) | |
291 (hebrew-start (calendar-hebrew-from-absolute start-date)) | |
292 (hebrew-end (calendar-hebrew-from-absolute end-date)) | |
293 (hebrew-y1 (extract-calendar-year hebrew-start)) | |
294 (hebrew-y2 (extract-calendar-year hebrew-end))) | |
295 (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) | |
296 (let ((date (calendar-gregorian-from-absolute | |
297 (calendar-absolute-from-hebrew | |
298 (list month day year))))) | |
299 (if (calendar-date-is-visible-p date) | |
300 (list (list date string)))))))) | |
301 | |
86489
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
302 ;; h-r-h-e should be called from holidays code. |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
303 (declare-function holiday-filter-visible-calendar "holidays" (l)) |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
304 |
13050 | 305 (defun holiday-rosh-hashanah-etc () |
306 "List of dates related to Rosh Hashanah, as visible in calendar window." | |
307 (if (or (< displayed-month 8) | |
308 (> displayed-month 11)) | |
92658 | 309 nil ; none of the dates is visible |
13050 | 310 (let* ((abs-r-h (calendar-absolute-from-hebrew |
311 (list 7 1 (+ displayed-year 3761)))) | |
312 (mandatory | |
313 (list | |
314 (list (calendar-gregorian-from-absolute abs-r-h) | |
315 (format "Rosh HaShanah %d" (+ 3761 displayed-year))) | |
316 (list (calendar-gregorian-from-absolute (+ abs-r-h 9)) | |
317 "Yom Kippur") | |
318 (list (calendar-gregorian-from-absolute (+ abs-r-h 14)) | |
319 "Sukkot") | |
320 (list (calendar-gregorian-from-absolute (+ abs-r-h 21)) | |
321 "Shemini Atzeret") | |
322 (list (calendar-gregorian-from-absolute (+ abs-r-h 22)) | |
323 "Simchat Torah"))) | |
324 (optional | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
325 (list |
13050 | 326 (list (calendar-gregorian-from-absolute |
327 (calendar-dayname-on-or-before 6 (- abs-r-h 4))) | |
328 "Selichot (night)") | |
329 (list (calendar-gregorian-from-absolute (1- abs-r-h)) | |
13674
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
330 "Erev Rosh HaShanah") |
13050 | 331 (list (calendar-gregorian-from-absolute (1+ abs-r-h)) |
332 "Rosh HaShanah (second day)") | |
333 (list (calendar-gregorian-from-absolute | |
334 (if (= (% abs-r-h 7) 4) (+ abs-r-h 3) (+ abs-r-h 2))) | |
335 "Tzom Gedaliah") | |
336 (list (calendar-gregorian-from-absolute | |
337 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h))) | |
338 "Shabbat Shuvah") | |
339 (list (calendar-gregorian-from-absolute (+ abs-r-h 8)) | |
340 "Erev Yom Kippur") | |
341 (list (calendar-gregorian-from-absolute (+ abs-r-h 13)) | |
342 "Erev Sukkot") | |
343 (list (calendar-gregorian-from-absolute (+ abs-r-h 15)) | |
344 "Sukkot (second day)") | |
345 (list (calendar-gregorian-from-absolute (+ abs-r-h 16)) | |
346 "Hol Hamoed Sukkot (first day)") | |
347 (list (calendar-gregorian-from-absolute (+ abs-r-h 17)) | |
348 "Hol Hamoed Sukkot (second day)") | |
349 (list (calendar-gregorian-from-absolute (+ abs-r-h 18)) | |
350 "Hol Hamoed Sukkot (third day)") | |
351 (list (calendar-gregorian-from-absolute (+ abs-r-h 19)) | |
352 "Hol Hamoed Sukkot (fourth day)") | |
353 (list (calendar-gregorian-from-absolute (+ abs-r-h 20)) | |
44366
3ade5e9efe68
(holiday-rosh-hashanah-etc): Spelling correction.
Richard M. Stallman <rms@gnu.org>
parents:
38422
diff
changeset
|
354 "Hoshanah Rabbah"))) |
13050 | 355 (output-list |
84552
eb2c7d456b7a
Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
356 (holiday-filter-visible-calendar mandatory))) |
13050 | 357 (if all-hebrew-calendar-holidays |
358 (setq output-list | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
359 (append |
84552
eb2c7d456b7a
Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
360 (holiday-filter-visible-calendar optional) |
13050 | 361 output-list))) |
362 output-list))) | |
363 | |
364 (defun holiday-hanukkah () | |
365 "List of dates related to Hanukkah, as visible in calendar window." | |
92658 | 366 ;; This test is only to speed things up a bit, it works fine without it. |
367 (if (memq displayed-month | |
368 '(10 11 12 1 2)) | |
369 (let ((m displayed-month) | |
370 (y displayed-year)) | |
371 (increment-calendar-month m y 1) | |
372 (let* ((h-y (extract-calendar-year | |
373 (calendar-hebrew-from-absolute | |
374 (calendar-absolute-from-gregorian | |
375 (list m (calendar-last-day-of-month m y) y))))) | |
376 (abs-h (calendar-absolute-from-hebrew (list 9 25 h-y)))) | |
377 (holiday-filter-visible-calendar | |
378 (list | |
379 (list (calendar-gregorian-from-absolute (1- abs-h)) | |
380 "Erev Hanukkah") | |
381 (list (calendar-gregorian-from-absolute abs-h) | |
382 "Hanukkah (first day)") | |
383 (list (calendar-gregorian-from-absolute (1+ abs-h)) | |
384 "Hanukkah (second day)") | |
385 (list (calendar-gregorian-from-absolute (+ abs-h 2)) | |
386 "Hanukkah (third day)") | |
387 (list (calendar-gregorian-from-absolute (+ abs-h 3)) | |
388 "Hanukkah (fourth day)") | |
389 (list (calendar-gregorian-from-absolute (+ abs-h 4)) | |
390 "Hanukkah (fifth day)") | |
391 (list (calendar-gregorian-from-absolute (+ abs-h 5)) | |
392 "Hanukkah (sixth day)") | |
393 (list (calendar-gregorian-from-absolute (+ abs-h 6)) | |
394 "Hanukkah (seventh day)") | |
395 (list (calendar-gregorian-from-absolute (+ abs-h 7)) | |
396 "Hanukkah (eighth day)"))))))) | |
13050 | 397 |
398 (defun holiday-passover-etc () | |
399 "List of dates related to Passover, as visible in calendar window." | |
400 (if (< 7 displayed-month) | |
92658 | 401 nil ; none of the dates is visible |
13050 | 402 (let* ((abs-p (calendar-absolute-from-hebrew |
403 (list 1 15 (+ displayed-year 3760)))) | |
404 (mandatory | |
405 (list | |
406 (list (calendar-gregorian-from-absolute abs-p) | |
407 "Passover") | |
408 (list (calendar-gregorian-from-absolute (+ abs-p 50)) | |
409 "Shavuot"))) | |
410 (optional | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
411 (list |
13050 | 412 (list (calendar-gregorian-from-absolute |
413 (calendar-dayname-on-or-before 6 (- abs-p 43))) | |
414 "Shabbat Shekalim") | |
415 (list (calendar-gregorian-from-absolute | |
416 (calendar-dayname-on-or-before 6 (- abs-p 30))) | |
417 "Shabbat Zachor") | |
418 (list (calendar-gregorian-from-absolute | |
419 (if (= (% abs-p 7) 2) (- abs-p 33) (- abs-p 31))) | |
420 "Fast of Esther") | |
421 (list (calendar-gregorian-from-absolute (- abs-p 31)) | |
422 "Erev Purim") | |
423 (list (calendar-gregorian-from-absolute (- abs-p 30)) | |
424 "Purim") | |
425 (list (calendar-gregorian-from-absolute | |
426 (if (zerop (% abs-p 7)) (- abs-p 28) (- abs-p 29))) | |
427 "Shushan Purim") | |
428 (list (calendar-gregorian-from-absolute | |
429 (- (calendar-dayname-on-or-before 6 (- abs-p 14)) 7)) | |
430 "Shabbat Parah") | |
431 (list (calendar-gregorian-from-absolute | |
432 (calendar-dayname-on-or-before 6 (- abs-p 14))) | |
433 "Shabbat HaHodesh") | |
434 (list (calendar-gregorian-from-absolute | |
435 (calendar-dayname-on-or-before 6 (1- abs-p))) | |
436 "Shabbat HaGadol") | |
437 (list (calendar-gregorian-from-absolute (1- abs-p)) | |
438 "Erev Passover") | |
439 (list (calendar-gregorian-from-absolute (1+ abs-p)) | |
440 "Passover (second day)") | |
441 (list (calendar-gregorian-from-absolute (+ abs-p 2)) | |
442 "Hol Hamoed Passover (first day)") | |
443 (list (calendar-gregorian-from-absolute (+ abs-p 3)) | |
444 "Hol Hamoed Passover (second day)") | |
445 (list (calendar-gregorian-from-absolute (+ abs-p 4)) | |
446 "Hol Hamoed Passover (third day)") | |
447 (list (calendar-gregorian-from-absolute (+ abs-p 5)) | |
448 "Hol Hamoed Passover (fourth day)") | |
449 (list (calendar-gregorian-from-absolute (+ abs-p 6)) | |
450 "Passover (seventh day)") | |
451 (list (calendar-gregorian-from-absolute (+ abs-p 7)) | |
452 "Passover (eighth day)") | |
17694
c9fd662941e3
(holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
453 (list (calendar-gregorian-from-absolute |
c9fd662941e3
(holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
454 (if (zerop (% (+ abs-p 12) 7)) |
c9fd662941e3
(holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
455 (+ abs-p 13) |
c9fd662941e3
(holiday-passover-etc): Postpone date of Yom
Richard M. Stallman <rms@gnu.org>
parents:
14169
diff
changeset
|
456 (+ abs-p 12))) |
13050 | 457 "Yom HaShoah") |
458 (list (calendar-gregorian-from-absolute | |
459 (if (zerop (% abs-p 7)) | |
460 (+ abs-p 18) | |
461 (if (= (% abs-p 7) 6) | |
462 (+ abs-p 19) | |
463 (+ abs-p 20)))) | |
464 "Yom HaAtzma'ut") | |
465 (list (calendar-gregorian-from-absolute (+ abs-p 33)) | |
466 "Lag BaOmer") | |
467 (list (calendar-gregorian-from-absolute (+ abs-p 43)) | |
22063
bf477b03b470
Fix mispelling.
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
20462
diff
changeset
|
468 "Yom Yerushalaim") |
13050 | 469 (list (calendar-gregorian-from-absolute (+ abs-p 49)) |
470 "Erev Shavuot") | |
471 (list (calendar-gregorian-from-absolute (+ abs-p 51)) | |
472 "Shavuot (second day)"))) | |
473 (output-list | |
84552
eb2c7d456b7a
Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
474 (holiday-filter-visible-calendar mandatory))) |
13050 | 475 (if all-hebrew-calendar-holidays |
476 (setq output-list | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
477 (append |
84552
eb2c7d456b7a
Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
478 (holiday-filter-visible-calendar optional) |
13050 | 479 output-list))) |
480 output-list))) | |
481 | |
482 (defun holiday-tisha-b-av-etc () | |
483 "List of dates around Tisha B'Av, as visible in calendar window." | |
484 (if (or (< displayed-month 5) | |
485 (> displayed-month 9)) | |
92658 | 486 nil ; none of the dates is visible |
13050 | 487 (let* ((abs-t-a (calendar-absolute-from-hebrew |
488 (list 5 9 (+ displayed-year 3760))))) | |
489 | |
84552
eb2c7d456b7a
Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents:
82140
diff
changeset
|
490 (holiday-filter-visible-calendar |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
491 (list |
13050 | 492 (list (calendar-gregorian-from-absolute |
493 (if (= (% abs-t-a 7) 6) (- abs-t-a 20) (- abs-t-a 21))) | |
494 "Tzom Tammuz") | |
495 (list (calendar-gregorian-from-absolute | |
496 (calendar-dayname-on-or-before 6 abs-t-a)) | |
497 "Shabbat Hazon") | |
498 (list (calendar-gregorian-from-absolute | |
499 (if (= (% abs-t-a 7) 6) (1+ abs-t-a) abs-t-a)) | |
500 "Tisha B'Av") | |
501 (list (calendar-gregorian-from-absolute | |
502 (calendar-dayname-on-or-before 6 (+ abs-t-a 7))) | |
503 "Shabbat Nahamu")))))) | |
504 | |
86489
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
505 ;; l-h-d-e should be called from diary code. |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
506 (declare-function add-to-diary-list "diary-lib" |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
507 (date string specifier &optional marker globcolor literal)) |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
508 |
92701
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
509 (defvar number) ; from diary-list-entries |
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
510 |
13050 | 511 (defun list-hebrew-diary-entries () |
512 "Add any Hebrew date entries from the diary file to `diary-entries-list'. | |
513 Hebrew date diary entries must be prefaced by `hebrew-diary-entry-symbol' | |
514 \(normally an `H'). The same diary date forms govern the style of the Hebrew | |
515 calendar entries, except that the Hebrew month names must be spelled in full. | |
516 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being | |
517 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a | |
518 common Hebrew year. If a Hebrew date diary entry begins with a | |
519 `diary-nonmarking-symbol', the entry will appear in the diary listing, but will | |
520 not be marked in the calendar. This function is provided for use with the | |
521 `nongregorian-diary-listing-hook'." | |
522 (if (< 0 number) | |
523 (let ((buffer-read-only nil) | |
524 (diary-modified (buffer-modified-p)) | |
525 (gdate original-date) | |
526 (mark (regexp-quote diary-nonmarking-symbol))) | |
82084
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
527 (dotimes (idummy number) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
528 (let* ((d diary-date-forms) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
529 (hdate (calendar-hebrew-from-absolute |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
530 (calendar-absolute-from-gregorian gdate))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
531 (month (extract-calendar-month hdate)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
532 (day (extract-calendar-day hdate)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
533 (year (extract-calendar-year hdate))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
534 (while d |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
535 (let* |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
536 ((date-form (if (equal (car (car d)) 'backup) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
537 (cdr (car d)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
538 (car d))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
539 (backup (equal (car (car d)) 'backup)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
540 (dayname |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
541 (format "%s\\|%s\\.?" |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
542 (calendar-day-name gdate) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
543 (calendar-day-name gdate 'abbrev))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
544 (calendar-month-name-array |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
545 calendar-hebrew-month-name-array-leap-year) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
546 (monthname |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
547 (concat |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
548 "\\*\\|" |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
549 (calendar-month-name month))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
550 (month (concat "\\*\\|0*" (int-to-string month))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
551 (day (concat "\\*\\|0*" (int-to-string day))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
552 (year |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
553 (concat |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
554 "\\*\\|0*" (int-to-string year) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
555 (if abbreviated-calendar-year |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
556 (concat "\\|" (int-to-string (% year 100))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
557 ""))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
558 (regexp |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
559 (concat |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
560 "\\(\\`\\|\^M\\|\n\\)" mark "?" |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
561 (regexp-quote hebrew-diary-entry-symbol) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
562 "\\(" |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
563 (mapconcat 'eval date-form "\\)\\(") |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
564 "\\)")) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
565 (case-fold-search t)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
566 (goto-char (point-min)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
567 (while (re-search-forward regexp nil t) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
568 (if backup (re-search-backward "\\<" nil t)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
569 (if (and (or (char-equal (preceding-char) ?\^M) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
570 (char-equal (preceding-char) ?\n)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
571 (not (looking-at " \\|\^I"))) |
92658 | 572 ;; Diary entry that consists only of date. |
82084
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
573 (backward-char 1) |
92658 | 574 ;; Found a nonempty diary entry--make it visible and |
575 ;; add it to the list. | |
82084
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
576 (let ((entry-start (point)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
577 (date-start)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
578 (re-search-backward "\^M\\|\n\\|\\`") |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
579 (setq date-start (point)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
580 (re-search-forward "\^M\\|\n" nil t 2) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
581 (while (looking-at " \\|\^I") |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
582 (re-search-forward "\^M\\|\n" nil t)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
583 (backward-char 1) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
584 (subst-char-in-region date-start (point) ?\^M ?\n t) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
585 (add-to-diary-list |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
586 gdate |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
587 (buffer-substring-no-properties entry-start (point)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
588 (buffer-substring-no-properties |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
589 (1+ date-start) (1- entry-start)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
590 (copy-marker entry-start)))))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
591 (setq d (cdr d)))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
592 (setq gdate |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
593 (calendar-gregorian-from-absolute |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
594 (1+ (calendar-absolute-from-gregorian gdate))))) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
595 (set-buffer-modified-p diary-modified)) |
5f23cf0f35b8
(list-hebrew-diary-entries): Use dotimes rather than
Glenn Morris <rgm@gnu.org>
parents:
77279
diff
changeset
|
596 (goto-char (point-min)))) |
13050 | 597 |
598 (defun mark-hebrew-calendar-date-pattern (month day year) | |
599 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR. | |
600 A value of 0 in any position is a wildcard." | |
601 (save-excursion | |
602 (set-buffer calendar-buffer) | |
92611
297952467e34
(mark-hebrew-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents:
92583
diff
changeset
|
603 (if (and (not (zerop month)) (not (zerop day))) |
297952467e34
(mark-hebrew-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents:
92583
diff
changeset
|
604 (if (not (zerop year)) |
13050 | 605 ;; Fully specified Hebrew date. |
606 (let ((date (calendar-gregorian-from-absolute | |
607 (calendar-absolute-from-hebrew | |
608 (list month day year))))) | |
609 (if (calendar-date-is-visible-p date) | |
610 (mark-visible-calendar-date date))) | |
611 ;; Month and day in any year--this taken from the holiday stuff. | |
92658 | 612 ;; This test is only to speed things up a bit, it works |
613 ;; fine without it. | |
614 (if (memq displayed-month | |
615 (list | |
13050 | 616 (if (< 11 month) (- month 11) (+ month 1)) |
617 (if (< 10 month) (- month 10) (+ month 2)) | |
618 (if (< 9 month) (- month 9) (+ month 3)) | |
619 (if (< 8 month) (- month 8) (+ month 4)) | |
620 (if (< 7 month) (- month 7) (+ month 5)))) | |
621 (let ((m1 displayed-month) | |
622 (y1 displayed-year) | |
623 (m2 displayed-month) | |
624 (y2 displayed-year) | |
625 (year)) | |
626 (increment-calendar-month m1 y1 -1) | |
627 (increment-calendar-month m2 y2 1) | |
628 (let* ((start-date (calendar-absolute-from-gregorian | |
629 (list m1 1 y1))) | |
630 (end-date (calendar-absolute-from-gregorian | |
631 (list m2 | |
632 (calendar-last-day-of-month m2 y2) | |
633 y2))) | |
634 (hebrew-start | |
635 (calendar-hebrew-from-absolute start-date)) | |
636 (hebrew-end (calendar-hebrew-from-absolute end-date)) | |
637 (hebrew-y1 (extract-calendar-year hebrew-start)) | |
638 (hebrew-y2 (extract-calendar-year hebrew-end))) | |
639 (setq year (if (< 6 month) hebrew-y2 hebrew-y1)) | |
640 (let ((date (calendar-gregorian-from-absolute | |
641 (calendar-absolute-from-hebrew | |
642 (list month day year))))) | |
643 (if (calendar-date-is-visible-p date) | |
644 (mark-visible-calendar-date date))))))) | |
645 ;; Not one of the simple cases--check all visible dates for match. | |
646 ;; Actually, the following code takes care of ALL of the cases, but | |
647 ;; it's much too slow to be used for the simple (common) cases. | |
648 (let ((m displayed-month) | |
649 (y displayed-year) | |
650 (first-date) | |
651 (last-date)) | |
652 (increment-calendar-month m y -1) | |
653 (setq first-date | |
654 (calendar-absolute-from-gregorian | |
655 (list m 1 y))) | |
656 (increment-calendar-month m y 2) | |
657 (setq last-date | |
658 (calendar-absolute-from-gregorian | |
659 (list m (calendar-last-day-of-month m y) y))) | |
660 (calendar-for-loop date from first-date to last-date do | |
661 (let* ((h-date (calendar-hebrew-from-absolute date)) | |
662 (h-month (extract-calendar-month h-date)) | |
663 (h-day (extract-calendar-day h-date)) | |
664 (h-year (extract-calendar-year h-date))) | |
665 (and (or (zerop month) | |
666 (= month h-month)) | |
667 (or (zerop day) | |
668 (= day h-day)) | |
669 (or (zerop year) | |
670 (= year h-year)) | |
671 (mark-visible-calendar-date | |
672 (calendar-gregorian-from-absolute date))))))))) | |
673 | |
86489
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
674 (declare-function diary-name-pattern "diary-lib" |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
675 (string-array &optional abbrev-array paren)) |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
676 |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
677 (declare-function mark-calendar-days-named "diary-lib" |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
678 (dayname &optional color)) |
997f6a0ad183
(holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents:
85510
diff
changeset
|
679 |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
680 (defun mark-hebrew-diary-entries () |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
681 "Mark days in the calendar window that have Hebrew date diary entries. |
92667 | 682 Each entry in `diary-file' (or included files) visible in the calendar window |
683 is marked. Hebrew date entries are prefaced by `hebrew-diary-entry-symbol' | |
684 \(normally an `H'). The same `diary-date-forms' govern the style of the Hebrew | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
685 calendar entries, except that the Hebrew month names must be spelled in full. |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
686 The Hebrew months are numbered from 1 to 13 with Nisan being 1, 12 being |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
687 Adar I and 13 being Adar II; you must use `Adar I' if you want Adar of a |
92667 | 688 common Hebrew year. Hebrew date diary entries that begin with |
689 `diary-nonmarking-symbol' will not be marked in the calendar. This function | |
690 is provided for use as part of `nongregorian-diary-marking-hook'." | |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
691 (let ((d diary-date-forms)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
692 (while d |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
693 (let* |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
694 ((date-form (if (equal (car (car d)) 'backup) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
695 (cdr (car d)) |
92658 | 696 (car d))) ; ignore 'backup directive |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
697 (dayname (diary-name-pattern calendar-day-name-array |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
698 calendar-day-abbrev-array)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
699 (monthname |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
700 (format "%s\\|\\*" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
701 (diary-name-pattern |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
702 calendar-hebrew-month-name-array-leap-year))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
703 (month "[0-9]+\\|\\*") |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
704 (day "[0-9]+\\|\\*") |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
705 (year "[0-9]+\\|\\*") |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
706 (l (length date-form)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
707 (d-name-pos (- l (length (memq 'dayname date-form)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
708 (d-name-pos (if (/= l d-name-pos) (+ 2 d-name-pos))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
709 (m-name-pos (- l (length (memq 'monthname date-form)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
710 (m-name-pos (if (/= l m-name-pos) (+ 2 m-name-pos))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
711 (d-pos (- l (length (memq 'day date-form)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
712 (d-pos (if (/= l d-pos) (+ 2 d-pos))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
713 (m-pos (- l (length (memq 'month date-form)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
714 (m-pos (if (/= l m-pos) (+ 2 m-pos))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
715 (y-pos (- l (length (memq 'year date-form)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
716 (y-pos (if (/= l y-pos) (+ 2 y-pos))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
717 (regexp |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
718 (concat |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
719 "\\(\\`\\|\^M\\|\n\\)" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
720 (regexp-quote hebrew-diary-entry-symbol) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
721 "\\(" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
722 (mapconcat 'eval date-form "\\)\\(") |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
723 "\\)")) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
724 (case-fold-search t)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
725 (goto-char (point-min)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
726 (while (re-search-forward regexp nil t) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
727 (let* ((dd-name |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
728 (if d-name-pos |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
729 (buffer-substring |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
730 (match-beginning d-name-pos) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
731 (match-end d-name-pos)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
732 (mm-name |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
733 (if m-name-pos |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
734 (buffer-substring |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
735 (match-beginning m-name-pos) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
736 (match-end m-name-pos)))) |
62402
a7e02ef1e3d6
Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents:
61148
diff
changeset
|
737 (mm (string-to-number |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
738 (if m-pos |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
739 (buffer-substring |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
740 (match-beginning m-pos) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
741 (match-end m-pos)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
742 ""))) |
62402
a7e02ef1e3d6
Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents:
61148
diff
changeset
|
743 (dd (string-to-number |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
744 (if d-pos |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
745 (buffer-substring |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
746 (match-beginning d-pos) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
747 (match-end d-pos)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
748 ""))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
749 (y-str (if y-pos |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
750 (buffer-substring |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
751 (match-beginning y-pos) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
752 (match-end y-pos)))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
753 (yy (if (not y-str) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
754 0 |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
755 (if (and (= (length y-str) 2) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
756 abbreviated-calendar-year) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
757 (let* ((current-y |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
758 (extract-calendar-year |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
759 (calendar-hebrew-from-absolute |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
760 (calendar-absolute-from-gregorian |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
761 (calendar-current-date))))) |
62402
a7e02ef1e3d6
Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents:
61148
diff
changeset
|
762 (y (+ (string-to-number y-str) |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
763 (* 100 (/ current-y 100))))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
764 (if (> (- y current-y) 50) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
765 (- y 100) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
766 (if (> (- current-y y) 50) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
767 (+ y 100) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
768 y))) |
62402
a7e02ef1e3d6
Replace `string-to-int' by `string-to-number'.
Juanma Barranquero <lekktu@gmail.com>
parents:
61148
diff
changeset
|
769 (string-to-number y-str))))) |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
770 (if dd-name |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
771 (mark-calendar-days-named |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
772 (cdr (assoc-string dd-name |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
773 (calendar-make-alist |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
774 calendar-day-name-array |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
775 0 nil calendar-day-abbrev-array) t))) |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
776 (if mm-name |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
777 (setq mm |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
778 (if (string-equal mm-name "*") 0 |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
779 (cdr |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
780 (assoc-string |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
781 mm-name |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
782 (calendar-make-alist |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
783 calendar-hebrew-month-name-array-leap-year) t))))) |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
784 (mark-hebrew-calendar-date-pattern mm dd yy))))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
785 (setq d (cdr d))))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
786 |
13050 | 787 (defun insert-hebrew-diary-entry (arg) |
788 "Insert a diary entry. | |
789 For the Hebrew date corresponding to the date indicated by point. | |
92667 | 790 Prefix argument ARG makes the entry nonmarking." |
13050 | 791 (interactive "P") |
792 (let* ((calendar-month-name-array | |
793 calendar-hebrew-month-name-array-leap-year)) | |
794 (make-diary-entry | |
795 (concat | |
796 hebrew-diary-entry-symbol | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
797 (calendar-date-string |
13050 | 798 (calendar-hebrew-from-absolute |
799 (calendar-absolute-from-gregorian | |
800 (calendar-cursor-to-date t))) | |
801 nil t)) | |
802 arg))) | |
803 | |
804 (defun insert-monthly-hebrew-diary-entry (arg) | |
805 "Insert a monthly diary entry. | |
806 For the day of the Hebrew month corresponding to the date indicated by point. | |
92667 | 807 Prefix argument ARG makes the entry nonmarking." |
13050 | 808 (interactive "P") |
809 (let* ((calendar-date-display-form | |
810 (if european-calendar-style '(day " * ") '("* " day ))) | |
811 (calendar-month-name-array | |
812 calendar-hebrew-month-name-array-leap-year)) | |
813 (make-diary-entry | |
814 (concat | |
815 hebrew-diary-entry-symbol | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
816 (calendar-date-string |
13050 | 817 (calendar-hebrew-from-absolute |
818 (calendar-absolute-from-gregorian | |
819 (calendar-cursor-to-date t))))) | |
820 arg))) | |
821 | |
822 (defun insert-yearly-hebrew-diary-entry (arg) | |
823 "Insert an annual diary entry. | |
824 For the day of the Hebrew year corresponding to the date indicated by point. | |
92667 | 825 Prefix argument ARG makes the entry nonmarking." |
13050 | 826 (interactive "P") |
827 (let* ((calendar-date-display-form | |
828 (if european-calendar-style | |
829 '(day " " monthname) | |
830 '(monthname " " day))) | |
831 (calendar-month-name-array | |
832 calendar-hebrew-month-name-array-leap-year)) | |
833 (make-diary-entry | |
834 (concat | |
835 hebrew-diary-entry-symbol | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
836 (calendar-date-string |
13050 | 837 (calendar-hebrew-from-absolute |
838 (calendar-absolute-from-gregorian | |
839 (calendar-cursor-to-date t))))) | |
840 arg))) | |
841 | |
842 ;;;###autoload | |
843 (defun list-yahrzeit-dates (death-date start-year end-year) | |
844 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR. | |
845 When called interactively from the calendar window, the date of death is taken | |
846 from the cursor position." | |
847 (interactive | |
848 (let* ((death-date | |
849 (if (equal (current-buffer) (get-buffer calendar-buffer)) | |
850 (calendar-cursor-to-date) | |
851 (let* ((today (calendar-current-date)) | |
852 (year (calendar-read | |
853 "Year of death (>0): " | |
92583 | 854 (lambda (x) (> x 0)) |
13050 | 855 (int-to-string (extract-calendar-year today)))) |
856 (month-array calendar-month-name-array) | |
857 (completion-ignore-case t) | |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
858 (month (cdr (assoc-string |
24187
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
859 (completing-read |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
860 "Month of death (name): " |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
861 (mapcar 'list (append month-array nil)) |
cc07d0f935d4
(calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents:
22063
diff
changeset
|
862 nil t) |
54074
ae72e69df10d
(calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents:
52401
diff
changeset
|
863 (calendar-make-alist month-array 1) t))) |
13050 | 864 (last (calendar-last-day-of-month month year)) |
865 (day (calendar-read | |
866 (format "Day of death (1-%d): " last) | |
92583 | 867 (lambda (x) (and (< 0 x) (<= x last)))))) |
13050 | 868 (list month day year)))) |
869 (death-year (extract-calendar-year death-date)) | |
870 (start-year (calendar-read | |
871 (format "Starting year of Yahrzeit table (>%d): " | |
872 death-year) | |
92583 | 873 (lambda (x) (> x death-year)) |
13050 | 874 (int-to-string (1+ death-year)))) |
875 (end-year (calendar-read | |
876 (format "Ending year of Yahrzeit table (>=%d): " | |
877 start-year) | |
92583 | 878 (lambda (x) (>= x start-year))))) |
13050 | 879 (list death-date start-year end-year))) |
92667 | 880 (message "Computing Yahrzeits...") |
92817
1b8224570e5f
(list-yahrzeit-dates): Use cal-hebrew-yahrzeit-buffer.
Glenn Morris <rgm@gnu.org>
parents:
92701
diff
changeset
|
881 (let* ((h-date (calendar-hebrew-from-absolute |
13050 | 882 (calendar-absolute-from-gregorian death-date))) |
883 (h-month (extract-calendar-month h-date)) | |
884 (h-day (extract-calendar-day h-date)) | |
885 (h-year (extract-calendar-year h-date))) | |
92817
1b8224570e5f
(list-yahrzeit-dates): Use cal-hebrew-yahrzeit-buffer.
Glenn Morris <rgm@gnu.org>
parents:
92701
diff
changeset
|
886 (set-buffer (get-buffer-create cal-hebrew-yahrzeit-buffer)) |
13050 | 887 (setq buffer-read-only nil) |
888 (calendar-set-mode-line | |
889 (format "Yahrzeit dates for %s = %s" | |
890 (calendar-date-string death-date) | |
891 (let ((calendar-month-name-array | |
892 (if (hebrew-calendar-leap-year-p h-year) | |
893 calendar-hebrew-month-name-array-leap-year | |
894 calendar-hebrew-month-name-array-common-year))) | |
895 (calendar-date-string h-date nil t)))) | |
896 (erase-buffer) | |
897 (goto-char (point-min)) | |
898 (calendar-for-loop i from start-year to end-year do | |
899 (insert | |
900 (calendar-date-string | |
901 (calendar-gregorian-from-absolute | |
902 (hebrew-calendar-yahrzeit | |
903 h-date | |
904 (extract-calendar-year | |
905 (calendar-hebrew-from-absolute | |
906 (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n")) | |
907 (goto-char (point-min)) | |
908 (set-buffer-modified-p nil) | |
909 (setq buffer-read-only t) | |
92817
1b8224570e5f
(list-yahrzeit-dates): Use cal-hebrew-yahrzeit-buffer.
Glenn Morris <rgm@gnu.org>
parents:
92701
diff
changeset
|
910 (display-buffer cal-hebrew-yahrzeit-buffer) |
92667 | 911 (message "Computing Yahrzeits...done"))) |
13050 | 912 |
92701
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
913 (defvar date) |
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
914 |
13050 | 915 (defun diary-hebrew-date () |
916 "Hebrew calendar equivalent of date diary entry." | |
917 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date))) | |
918 | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
919 (defun diary-omer (&optional mark) |
13050 | 920 "Omer count diary entry. |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
921 Entry applies if date is within 50 days after Passover. |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
922 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
923 An optional parameter MARK specifies a face or single-character string to |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
924 use when highlighting the day in the calendar." |
13050 | 925 (let* ((passover |
926 (calendar-absolute-from-hebrew | |
927 (list 1 15 (+ (extract-calendar-year date) 3760)))) | |
928 (omer (- (calendar-absolute-from-gregorian date) passover)) | |
929 (week (/ omer 7)) | |
930 (day (% omer 7))) | |
931 (if (and (> omer 0) (< omer 50)) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
932 (cons mark |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
933 (format "Day %d%s of the omer (until sunset)" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
934 omer |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
935 (if (zerop week) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
936 "" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
937 (format ", that is, %d week%s%s" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
938 week |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
939 (if (= week 1) "" "s") |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
940 (if (zerop day) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
941 "" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
942 (format " and %d day%s" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
943 day (if (= day 1) "" "s")))))))))) |
13050 | 944 |
92701
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
945 (defvar entry) |
6a990f964e22
(date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents:
92667
diff
changeset
|
946 |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
947 (defun diary-yahrzeit (death-month death-day death-year &optional mark) |
92667 | 948 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before. |
13050 | 949 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary entry is assumed |
950 to be the name of the person. Date of death is on the *civil* calendar; | |
951 although the date of death is specified by the civil calendar, the proper | |
92667 | 952 Hebrew calendar Yahrzeit is determined. If `european-calendar-style' is t, the |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
953 order of the parameters is changed to DEATH-DAY, DEATH-MONTH, DEATH-YEAR. |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
954 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
955 An optional parameter MARK specifies a face or single-character string to |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
956 use when highlighting the day in the calendar." |
13050 | 957 (let* ((h-date (calendar-hebrew-from-absolute |
958 (calendar-absolute-from-gregorian | |
959 (if european-calendar-style | |
960 (list death-day death-month death-year) | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
961 (list death-month death-day death-year))))) |
13050 | 962 (h-month (extract-calendar-month h-date)) |
963 (h-day (extract-calendar-day h-date)) | |
964 (h-year (extract-calendar-year h-date)) | |
965 (d (calendar-absolute-from-gregorian date)) | |
966 (yr (extract-calendar-year (calendar-hebrew-from-absolute d))) | |
967 (diff (- yr h-year)) | |
968 (y (hebrew-calendar-yahrzeit h-date yr))) | |
969 (if (and (> diff 0) (or (= y d) (= y (1+ d)))) | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
970 (cons mark |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
971 (format "Yahrzeit of %s%s: %d%s anniversary" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
972 entry |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
973 (if (= y d) "" " (evening)") |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
974 diff |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
975 (cond ((= (% diff 10) 1) "st") |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
976 ((= (% diff 10) 2) "nd") |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
977 ((= (% diff 10) 3) "rd") |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
978 (t "th"))))))) |
13050 | 979 |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
980 (defun diary-rosh-hodesh (&optional mark) |
13050 | 981 "Rosh Hodesh diary entry. |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
982 Entry applies if date is Rosh Hodesh, the day before, or the Saturday before. |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
983 |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
984 An optional parameter MARK specifies a face or single-character string to |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
985 use when highlighting the day in the calendar." |
13050 | 986 (let* ((d (calendar-absolute-from-gregorian date)) |
987 (h-date (calendar-hebrew-from-absolute d)) | |
988 (h-month (extract-calendar-month h-date)) | |
989 (h-day (extract-calendar-day h-date)) | |
990 (h-year (extract-calendar-year h-date)) | |
991 (leap-year (hebrew-calendar-leap-year-p h-year)) | |
992 (last-day (hebrew-calendar-last-day-of-month h-month h-year)) | |
993 (h-month-names | |
994 (if leap-year | |
995 calendar-hebrew-month-name-array-leap-year | |
996 calendar-hebrew-month-name-array-common-year)) | |
997 (this-month (aref h-month-names (1- h-month))) | |
998 (h-yesterday (extract-calendar-day | |
999 (calendar-hebrew-from-absolute (1- d))))) | |
1000 (if (or (= h-day 30) (and (= h-day 1) (/= h-month 7))) | |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
1001 (cons mark |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1002 (format |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1003 "Rosh Hodesh %s" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1004 (if (= h-day 30) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1005 (format |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1006 "%s (first day)" |
92658 | 1007 ;; Next month must be in the same year since this |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1008 ;; month can't be the last month of the year since |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1009 ;; it has 30 days |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1010 (aref h-month-names h-month)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1011 (if (= h-yesterday 30) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1012 (format "%s (second day)" this-month) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1013 this-month)))) |
92658 | 1014 (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
1015 (cons mark |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1016 (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1017 (format "Mevarchim Rosh Hodesh %s (%s)" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1018 (aref h-month-names |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1019 (if (= h-month |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1020 (hebrew-calendar-last-month-of-year |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1021 h-year)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1022 0 h-month)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1023 (aref calendar-day-name-array (- 29 h-day)))) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1024 ((and (< h-day 30) (> h-day 22) (= 30 last-day)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1025 (format "Mevarchim Rosh Hodesh %s (%s-%s)" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1026 (aref h-month-names h-month) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1027 (if (= h-day 29) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1028 "tomorrow" |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1029 (aref calendar-day-name-array (- 29 h-day))) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1030 (aref calendar-day-name-array |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1031 (% (- 30 h-day) 7)))))) |
13050 | 1032 (if (and (= h-day 29) (/= h-month 6)) |
46708
e82d42ccd30b
(diary-rosh-hodesh): Cons MARK on in the third case.
Richard M. Stallman <rms@gnu.org>
parents:
46619
diff
changeset
|
1033 (cons mark |
e82d42ccd30b
(diary-rosh-hodesh): Cons MARK on in the third case.
Richard M. Stallman <rms@gnu.org>
parents:
46619
diff
changeset
|
1034 (format "Erev Rosh Hodesh %s" |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1035 (aref h-month-names |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1036 (if (= h-month |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1037 (hebrew-calendar-last-month-of-year |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1038 h-year)) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1039 0 h-month))))))))) |
13050 | 1040 |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1041 (defvar hebrew-calendar-parashiot-names |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1042 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1043 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1044 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1045 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1046 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1047 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1048 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1049 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1050 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"] |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1051 "The names of the parashiot in the Torah.") |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1052 |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1053 (defun hebrew-calendar-parasha-name (p) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1054 "Name(s) corresponding to parasha P." |
92658 | 1055 (if (arrayp p) ; combined parasha |
52118
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1056 (format "%s/%s" |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1057 (aref hebrew-calendar-parashiot-names (aref p 0)) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1058 (aref hebrew-calendar-parashiot-names (aref p 1))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1059 (aref hebrew-calendar-parashiot-names p))) |
af8f4ec2f255
Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents:
49598
diff
changeset
|
1060 |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1061 (defun diary-parasha (&optional mark) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1062 "Parasha diary entry--entry applies if date is a Saturday. |
49598
0d8b17d428b5
Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents:
46708
diff
changeset
|
1063 An optional parameter MARK specifies a face or single-character string to |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1064 use when highlighting the day in the calendar." |
13050 | 1065 (let ((d (calendar-absolute-from-gregorian date))) |
92658 | 1066 (if (= (% d 7) 6) ; Saturday |
13050 | 1067 (let* |
1068 ((h-year (extract-calendar-year | |
1069 (calendar-hebrew-from-absolute d))) | |
13674
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
1070 (rosh-hashanah |
13050 | 1071 (calendar-absolute-from-hebrew (list 7 1 h-year))) |
1072 (passover | |
1073 (calendar-absolute-from-hebrew (list 1 15 h-year))) | |
13674
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
1074 (rosh-hashanah-day |
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
1075 (aref calendar-day-name-array (% rosh-hashanah 7))) |
13050 | 1076 (passover-day |
1077 (aref calendar-day-name-array (% passover 7))) | |
1078 (long-h (hebrew-calendar-long-heshvan-p h-year)) | |
1079 (short-k (hebrew-calendar-short-kislev-p h-year)) | |
1080 (type (cond ((and long-h (not short-k)) "complete") | |
1081 ((and (not long-h) short-k) "incomplete") | |
1082 (t "regular"))) | |
1083 (year-format | |
1084 (symbol-value | |
92658 | 1085 (intern (format "hebrew-calendar-year-%s-%s-%s" ; keviah |
13674
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
1086 rosh-hashanah-day type passover-day)))) |
92658 | 1087 (first-saturday ; of Hebrew year |
13674
67da41b74267
(holiday-rosh-hashanah-etc): Fix misspelled var.
Paul Eggert <eggert@twinsun.com>
parents:
13052
diff
changeset
|
1088 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah))) |
92658 | 1089 (saturday ; which Saturday of the Hebrew year |
13050 | 1090 (/ (- d first-saturday) 7)) |
1091 (parasha (aref year-format saturday))) | |
1092 (if parasha | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1093 (cons mark |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1094 (format |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1095 "Parashat %s" |
92658 | 1096 (if (listp parasha) ; Israel differs from diaspora |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1097 (if (car parasha) |
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1098 (format "%s (diaspora), %s (Israel)" |
92658 | 1099 (hebrew-calendar-parasha-name |
1100 (car parasha)) | |
1101 (hebrew-calendar-parasha-name | |
1102 (cdr parasha))) | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1103 (format "%s (Israel)" |
92658 | 1104 (hebrew-calendar-parasha-name |
1105 (cdr parasha)))) | |
46619
5d2941da3ed1
(diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents:
44366
diff
changeset
|
1106 (hebrew-calendar-parasha-name parasha))))))))) |
13050 | 1107 |
92658 | 1108 ;; The seven ordinary year types (keviot). |
13050 | 1109 (defconst hebrew-calendar-year-Saturday-incomplete-Sunday |
1110 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] | |
1111 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42] | |
1112 43 44 45 46 47 48 49 50] | |
1113 "The structure of the parashiot. | |
1114 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have | |
1115 29 days), and has Passover start on Sunday.") | |
1116 | |
1117 (defconst hebrew-calendar-year-Saturday-complete-Tuesday | |
1118 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] | |
1119 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42] | |
1120 43 44 45 46 47 48 49 [50 51]] | |
1121 "The structure of the parashiot. | |
1122 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each | |
1123 have 30 days), and has Passover start on Tuesday.") | |
1124 | |
1125 (defconst hebrew-calendar-year-Monday-incomplete-Tuesday | |
1126 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] | |
1127 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42] | |
1128 43 44 45 46 47 48 49 [50 51]] | |
1129 "The structure of the parashiot. | |
1130 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each | |
1131 have 29 days), and has Passover start on Tuesday.") | |
1132 | |
1133 (defconst hebrew-calendar-year-Monday-complete-Thursday | |
1134 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] | |
1135 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36) | |
1136 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]] | |
1137 "The structure of the parashiot. | |
1138 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have | |
1139 30 days), and has Passover start on Thursday.") | |
1140 | |
1141 (defconst hebrew-calendar-year-Tuesday-regular-Thursday | |
1142 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] | |
1143 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36) | |
1144 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]] | |
1145 "The structure of the parashiot. | |
1146 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and | |
1147 Kislev has 30 days), and has Passover start on Thursday.") | |
1148 | |
1149 (defconst hebrew-calendar-year-Thursday-regular-Saturday | |
1150 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 [21 22] 23 | |
1151 24 nil (nil . 25) (25 . [26 27]) ([26 27] . [28 29]) ([28 29] . 30) | |
1152 (30 . 31) ([31 32] . 32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48 | |
1153 49 50] | |
1154 "The structure of the parashiot. | |
1155 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and | |
1156 Kislev has 30 days), and has Passover start on Saturday.") | |
1157 | |
1158 (defconst hebrew-calendar-year-Thursday-complete-Sunday | |
1159 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1160 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42] | |
1161 43 44 45 46 47 48 49 50] | |
1162 "The structure of the parashiot. | |
1163 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each | |
1164 have 30 days), and has Passover start on Sunday.") | |
1165 | |
92658 | 1166 ;; The seven leap year types (keviot). |
13050 | 1167 (defconst hebrew-calendar-year-Saturday-incomplete-Tuesday |
1168 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1169 23 24 25 26 27 nil 28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42] | |
1170 43 44 45 46 47 48 49 [50 51]] | |
1171 "The structure of the parashiot. | |
1172 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each | |
1173 have 29 days), and has Passover start on Tuesday.") | |
1174 | |
1175 (defconst hebrew-calendar-year-Saturday-complete-Thursday | |
1176 [nil 52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1177 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36) | |
1178 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]] | |
1179 "The structure of the parashiot. | |
1180 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each | |
1181 have 30 days), and has Passover start on Thursday.") | |
1182 | |
1183 (defconst hebrew-calendar-year-Monday-incomplete-Thursday | |
1184 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1185 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36) | |
1186 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]] | |
1187 "The structure of the parashiot. | |
1188 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each | |
1189 have 29 days), and has Passover start on Thursday.") | |
1190 | |
1191 (defconst hebrew-calendar-year-Monday-complete-Saturday | |
1192 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1193 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32) | |
1194 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39) | |
1195 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50] | |
1196 "The structure of the parashiot. | |
1197 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have | |
1198 30 days), and has Passover start on Saturday.") | |
1199 | |
1200 (defconst hebrew-calendar-year-Tuesday-regular-Saturday | |
1201 [51 52 nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1202 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32) | |
1203 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39) | |
1204 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50] | |
1205 "The structure of the parashiot. | |
1206 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and | |
1207 Kislev has 30 days), and has Passover start on Saturday.") | |
1208 | |
1209 (defconst hebrew-calendar-year-Thursday-incomplete-Sunday | |
1210 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1211 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
1212 43 44 45 46 47 48 49 50] | |
1213 "The structure of the parashiot. | |
1214 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both | |
1215 have 29 days), and has Passover start on Sunday.") | |
1216 | |
1217 (defconst hebrew-calendar-year-Thursday-complete-Tuesday | |
1218 [52 nil nil 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | |
1219 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
1220 43 44 45 46 47 48 49 [50 51]] | |
1221 "The structure of the parashiot. | |
1222 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both | |
1223 have 30 days), and has Passover start on Tuesday.") | |
1224 | |
1225 (provide 'cal-hebrew) | |
1226 | |
92583 | 1227 ;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c |
13050 | 1228 ;;; cal-hebrew.el ends here |