annotate lisp/calendar/cal-hebrew.el @ 107782:2acfb2283cec

* help.el (describe-mode): Return nil (for IELM's sake).
author Juanma Barranquero <lekktu@gmail.com>
date Mon, 05 Apr 2010 12:36:45 +0200
parents 893db3292264
children 280c8ae2476d 376148b31b5e
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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,
106815
1d1d5d9bd884 Add 2010 to copyright years.
Glenn Morris <rgm@gnu.org>
parents: 105829
diff changeset
4 ;; 2008, 2009, 2010 Free Software Foundation, Inc.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
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>
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
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
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
9 ;; Keywords: calendar
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
10 ;; Human-Keywords: Hebrew calendar, calendar, diary
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
11
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
12 ;; This file is part of GNU Emacs.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
13
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94022
diff changeset
14 ;; GNU Emacs is free software: you can redistribute it and/or modify
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
15 ;; it under the terms of the GNU General Public License as published by
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94022
diff changeset
16 ;; the Free Software Foundation, either version 3 of the License, or
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94022
diff changeset
17 ;; (at your option) any later version.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
18
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
19 ;; GNU Emacs is distributed in the hope that it will be useful,
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
20 ;; but WITHOUT ANY WARRANTY; without even the implied warranty of
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
21 ;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
22 ;; GNU General Public License for more details.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
23
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
24 ;; You should have received a copy of the GNU General Public License
94653
e49abd957e81 Switch to recommended form of GPLv3 permissions notice.
Glenn Morris <rgm@gnu.org>
parents: 94022
diff changeset
25 ;; along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
26
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
27 ;;; Commentary:
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
28
93469
777bad4c4617 (Commentary): Replace with pointer to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93448
diff changeset
29 ;; See calendar.el.
20462
d179de7ad92e Add reference to new Calendrical Calculations book.
Paul Eggert <eggert@twinsun.com>
parents: 20267
diff changeset
30
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
31 ;;; Code:
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
32
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
33 (require 'calendar)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
34
94022
0f09322aedec Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents: 93870
diff changeset
35 (define-obsolete-variable-alias 'diary-sabbath-candles-minutes
0f09322aedec Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents: 93870
diff changeset
36 'diary-hebrew-sabbath-candles-minutes "23.1")
0f09322aedec Move non-autoloaded define-obsolete-variable-alias calls for
Glenn Morris <rgm@gnu.org>
parents: 93870
diff changeset
37
93750
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
38 (defcustom diary-hebrew-sabbath-candles-minutes 18
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
39 "Number of minutes before sunset for sabbath candle lighting.
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
40 Used by `diary-hebrew-sabbath-candles'."
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
41 :group 'diary
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
42 :type 'integer
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
43 :version "21.1")
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
44
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
45 ;; End of user options.
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
46
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
47 (defun calendar-hebrew-leap-year-p (year)
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
48 "Non-nil if YEAR is a Hebrew calendar leap year."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
49 (< (% (1+ (* 7 year)) 19) 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
50
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
51 (defun calendar-hebrew-last-month-of-year (year)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
52 "The last month of the Hebrew calendar YEAR."
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
53 (if (calendar-hebrew-leap-year-p year)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
54 13
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
55 12))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
56
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
57 (defun calendar-hebrew-elapsed-days (year)
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
58 "Days to mean conjunction of Tishri of Hebrew YEAR.
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
59 Measured from Sunday before start of Hebrew calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
60 (let* ((months-elapsed
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
61 (+ (* 235 (/ (1- year) 19)) ; months in complete cycles so far
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
62 (* 12 (% (1- year) 19)) ; regular months in this cycle
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
63 (/ (1+ (* 7 (% (1- year) 19))) 19))) ; leap months this cycle
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
64 (parts-elapsed (+ 204 (* 793 (% months-elapsed 1080))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
65 (hours-elapsed (+ 5
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
66 (* 12 months-elapsed)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
67 (* 793 (/ months-elapsed 1080))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
68 (/ parts-elapsed 1080)))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
69 (parts ; conjunction parts
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
70 (+ (* 1080 (% hours-elapsed 24)) (% parts-elapsed 1080)))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
71 (day ; conjunction day
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
72 (+ 1 (* 29 months-elapsed) (/ hours-elapsed 24)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
73 (alternative-day
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
74 (if (or (>= parts 19440) ; if the new moon is at or after midday
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
75 (and (= (% day 7) 2) ; ...or is on a Tuesday...
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
76 (>= parts 9924) ; at 9 hours, 204 parts or later...
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
77 ;; of a common year...
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
78 (not (calendar-hebrew-leap-year-p year)))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
79 (and (= (% day 7) 1) ; ...or is on a Monday...
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
80 (>= parts 16789) ; at 15 hours, 589 parts or later...
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
81 ;; at the end of a leap year.
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
82 (calendar-hebrew-leap-year-p (1- year))))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
83 ;; Then postpone Rosh HaShanah one day.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
84 (1+ day)
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
85 ;; Else:
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
86 day)))
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
87 ;; If Rosh HaShanah would occur on Sunday, Wednesday, or Friday
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
88 (if (memq (% alternative-day 7) (list 0 3 5))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
89 ;; Then postpone it one (more) day and return.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
90 (1+ alternative-day)
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
91 ;; Else return.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
92 alternative-day)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
93
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
94 (defun calendar-hebrew-days-in-year (year)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
95 "Number of days in Hebrew YEAR."
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
96 (- (calendar-hebrew-elapsed-days (1+ year))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
97 (calendar-hebrew-elapsed-days year)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
98
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
99 (defun calendar-hebrew-long-heshvan-p (year)
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
100 "Non-nil if Heshvan is long in Hebrew YEAR."
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
101 (= (% (calendar-hebrew-days-in-year year) 10) 5))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
102
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
103 (defun calendar-hebrew-short-kislev-p (year)
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
104 "Non-nil if Kislev is short in Hebrew YEAR."
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
105 (= (% (calendar-hebrew-days-in-year year) 10) 3))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
106
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
107 (defun calendar-hebrew-last-day-of-month (month year)
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
108 "The last day of MONTH in YEAR."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
109 (if (or (memq month (list 2 4 6 10 13))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
110 (and (= month 12) (not (calendar-hebrew-leap-year-p year)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
111 (and (= month 8) (not (calendar-hebrew-long-heshvan-p year)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
112 (and (= month 9) (calendar-hebrew-short-kislev-p year)))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
113 29
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
114 30))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
115
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
116 (defun calendar-hebrew-to-absolute (date)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
117 "Absolute date of Hebrew DATE.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
118 The absolute date is the number of days elapsed since the (imaginary)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
119 Gregorian date Sunday, December 31, 1 BC."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
120 (let ((month (calendar-extract-month date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
121 (day (calendar-extract-day date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
122 (year (calendar-extract-year date)))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
123 (+ day ; days so far this month
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
124 (if (< month 7) ; before Tishri
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
125 ;; Then add days in prior months this year before and after Nisan.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
126 (+ (calendar-sum
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
127 m 7 (<= m (calendar-hebrew-last-month-of-year year))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
128 (calendar-hebrew-last-day-of-month m year))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
129 (calendar-sum
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
130 m 1 (< m month)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
131 (calendar-hebrew-last-day-of-month m year)))
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
132 ;; Else add days in prior months this year.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
133 (calendar-sum
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
134 m 7 (< m month)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
135 (calendar-hebrew-last-day-of-month m year)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
136 (calendar-hebrew-elapsed-days year) ; days in prior years
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
137 -1373429))) ; days elapsed before absolute date 1
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
138
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
139 (define-obsolete-function-alias 'calendar-absolute-from-hebrew
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
140 'calendar-hebrew-to-absolute "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
141
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
142 (defun calendar-hebrew-from-absolute (date)
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
143 "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
144 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
145 Gregorian date Sunday, December 31, 1 BC."
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
146 (let* ((greg-date (calendar-gregorian-from-absolute date))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
147 (year (+ 3760 (calendar-extract-year greg-date)))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
148 (month (aref [9 10 11 12 1 2 3 4 7 7 7 8]
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
149 (1- (calendar-extract-month greg-date))))
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
150 (length (progn
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
151 (while (>= date (calendar-hebrew-to-absolute
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
152 (list 7 1 (1+ year))))
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
153 (setq year (1+ year)))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
154 (calendar-hebrew-last-month-of-year year)))
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
155 day)
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
156 (while (> date
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
157 (calendar-hebrew-to-absolute
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
158 (list month
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
159 (calendar-hebrew-last-day-of-month month year)
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
160 year)))
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
161 (setq month (1+ (% month length))))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
162 (setq day (1+
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
163 (- date (calendar-hebrew-to-absolute (list month 1 year)))))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
164 (list month day year)))
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
165
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
166 (defconst calendar-hebrew-month-name-array-common-year
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
167 ["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
168 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar"]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
169 "Array of strings giving the names of the Hebrew months in a common year.")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
170
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
171 (defconst calendar-hebrew-month-name-array-leap-year
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
172 ["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
173 "Heshvan" "Kislev" "Teveth" "Shevat" "Adar I" "Adar II"]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
174 "Array of strings giving the names of the Hebrew months in a leap year.")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
175
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
176 ;;;###cal-autoload
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
177 (defun calendar-hebrew-date-string (&optional date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
178 "String of Hebrew date before sunset of Gregorian DATE.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
179 Defaults to today's date if DATE is not given.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
180 Driven by the variable `calendar-date-display-form'."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
181 (let* ((hebrew-date (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
182 (calendar-absolute-from-gregorian
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
183 (or date (calendar-current-date)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
184 (calendar-month-name-array
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
185 (if (calendar-hebrew-leap-year-p (calendar-extract-year hebrew-date))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
186 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
187 calendar-hebrew-month-name-array-common-year)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
188 (calendar-date-string hebrew-date nil t)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
189
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
190 ;;;###cal-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
191 (defun calendar-hebrew-print-date ()
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
192 "Show the Hebrew calendar equivalent of the date under the cursor."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
193 (interactive)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
194 (message "Hebrew date (until sunset): %s"
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
195 (calendar-hebrew-date-string (calendar-cursor-to-date t))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
196
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
197 (define-obsolete-function-alias 'calendar-print-hebrew-date
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
198 'calendar-hebrew-print-date "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
199
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
200 (defun calendar-hebrew-yahrzeit (death-date year)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
201 "Absolute date of the anniversary of Hebrew DEATH-DATE in Hebrew YEAR."
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
202 (let ((death-day (calendar-extract-day death-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
203 (death-month (calendar-extract-month death-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
204 (death-year (calendar-extract-year death-date)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
205 (cond
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
206 ;; If it's Heshvan 30 it depends on the first anniversary; if
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
207 ;; that was not Heshvan 30, use the day before Kislev 1.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
208 ((and (= death-month 8)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
209 (= death-day 30)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
210 (not (calendar-hebrew-long-heshvan-p (1+ death-year))))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
211 (1- (calendar-hebrew-to-absolute (list 9 1 year))))
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
212 ;; If it's Kislev 30 it depends on the first anniversary; if that
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
213 ;; was not Kislev 30, use the day before Teveth 1.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
214 ((and (= death-month 9)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
215 (= death-day 30)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
216 (calendar-hebrew-short-kislev-p (1+ death-year)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
217 (1- (calendar-hebrew-to-absolute (list 10 1 year))))
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
218 ;; If it's Adar II, use the same day in last month of year (Adar
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
219 ;; or Adar II).
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
220 ((= death-month 13)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
221 (calendar-hebrew-to-absolute
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
222 (list (calendar-hebrew-last-month-of-year year) death-day year)))
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
223 ;; If it's the 30th in Adar I and year is not a leap year (so
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
224 ;; Adar has only 29 days), use the last day in Shevat.
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
225 ((and (= death-day 30)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
226 (= death-month 12)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
227 (not (calendar-hebrew-leap-year-p year)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
228 (calendar-hebrew-to-absolute (list 11 30 year)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
229 ;; In all other cases, use the normal anniversary of the date of death.
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
230 (t (calendar-hebrew-to-absolute
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
231 (list death-month death-day year))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
232
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
233 (define-obsolete-function-alias 'hebrew-calendar-yahrzeit
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
234 'calendar-hebrew-yahrzeit "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
235
93183
6f66ef366e35 (calendar-hebrew-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents: 93025
diff changeset
236 (defun calendar-hebrew-read-date ()
6f66ef366e35 (calendar-hebrew-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents: 93025
diff changeset
237 "Interactively read the arguments for a Hebrew date command.
6f66ef366e35 (calendar-hebrew-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents: 93025
diff changeset
238 Reads a year, month, and day."
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
239 (let* ((today (calendar-current-date))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
240 (year (calendar-read
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
241 "Hebrew calendar year (>3760): "
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
242 (lambda (x) (> x 3760))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
243 (number-to-string
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
244 (calendar-extract-year
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
245 (calendar-hebrew-from-absolute
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
246 (calendar-absolute-from-gregorian today))))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
247 (month-array (if (calendar-hebrew-leap-year-p year)
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
248 calendar-hebrew-month-name-array-leap-year
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
249 calendar-hebrew-month-name-array-common-year))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
250 (completion-ignore-case t)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
251 (month (cdr (assoc-string
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
252 (completing-read
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
253 "Hebrew calendar month name: "
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
254 (mapcar 'list (append month-array nil))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
255 (if (= year 3761)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
256 (lambda (x)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
257 (let ((m (cdr
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
258 (assoc-string
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
259 (car x)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
260 (calendar-make-alist month-array)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
261 t))))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
262 (< 0
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
263 (calendar-hebrew-to-absolute
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
264 (list m
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
265 (calendar-hebrew-last-day-of-month
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
266 m year)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
267 year))))))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
268 t)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
269 (calendar-make-alist month-array 1) t)))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
270 (last (calendar-hebrew-last-day-of-month month year))
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
271 (first (if (and (= year 3761) (= month 10))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
272 18 1))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
273 (day (calendar-read
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
274 (format "Hebrew calendar day (%d-%d): "
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
275 first last)
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
276 (lambda (x) (and (<= first x) (<= x last))))))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
277 (list (list month day year))))
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
278
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
279 ;;;###cal-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
280 (defun calendar-hebrew-goto-date (date &optional noecho)
92918
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
281 "Move cursor to Hebrew DATE; echo Hebrew date unless NOECHO is non-nil."
93183
6f66ef366e35 (calendar-hebrew-read-date): New name for
Glenn Morris <rgm@gnu.org>
parents: 93025
diff changeset
282 (interactive (calendar-hebrew-read-date))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
283 (calendar-goto-date (calendar-gregorian-from-absolute
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
284 (calendar-hebrew-to-absolute date)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
285 (or noecho (calendar-hebrew-print-date)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
286
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
287 (define-obsolete-function-alias 'calendar-goto-hebrew-date
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
288 'calendar-hebrew-goto-date "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
289
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
290 (defvar displayed-month) ; from calendar-generate
92918
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
291
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
292 (defun calendar-hebrew-date-is-visible-p (month day)
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
293 "Return non-nil if Hebrew MONTH DAY is visible in the calendar window.
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
294 Returns the corresponding Gregorian date."
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
295 ;; This test is only to speed things up a bit; it works fine without it.
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
296 (if (memq displayed-month
93448
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
297 ;; What this is doing is equivalent to +1,2,3,4,5 modulo 12, ie:
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
298 ;; (mapcar (lambda (n) (let ((x (mod n 12)))
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
299 ;; (if (zerop x) 12
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
300 ;; x)))
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
301 ;; (number-sequence (1+ month) (+ 5 month)))
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
302 ;; Ie it makes a list:
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
303 ;; 2 3 4 5 6 when month = 1
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
304 ;; 3 4 5 6 7 when month = 2
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
305 ;; ...
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
306 ;; 8 9 10 11 12 when month = 7
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
307 ;; 9 10 11 12 1 when month = 8
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
308 ;; ...
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
309 ;; 12 1 2 3 4 when month = 11
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
310 ;; 1 2 3 4 5 when month = 12
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
311 ;; This implies that hebrew month N cannot occur outside
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
312 ;; Gregorian months N:N+6 (the calendar shows
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
313 ;; displayed-month +/- 1 at any time).
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
314 ;; So to put it another way:
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
315 ;; (calendar-interval month 1 displayed-month
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
316 ;; (if (> month displayed-month) 2 1))
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
317 ;; must be >= 1 and <= 5. This could be expanded to:
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
318 ;; (if (> month displayed-month) (+ 12 (- displayed-month month))
9d52e0832665 Comment.
Glenn Morris <rgm@gnu.org>
parents: 93409
diff changeset
319 ;; (- displayed-month month)
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
320 (list
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
321 (if (< 11 month) (- month 11) (+ month 1))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
322 (if (< 10 month) (- month 10) (+ month 2))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
323 (if (< 9 month) (- month 9) (+ month 3))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
324 (if (< 8 month) (- month 8) (+ month 4))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
325 (if (< 7 month) (- month 7) (+ month 5))))
93495
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
326 (calendar-nongregorian-visible-p
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
327 month day 'calendar-hebrew-to-absolute
93495
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
328 'calendar-hebrew-from-absolute
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
329 ;; Hebrew new year is start of month 7.
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
330 ;; If hmonth >= 7, choose the higher year.
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
331 (lambda (m) (> m 6)))))
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
332
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
333 ;;;###holiday-autoload
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
334 (defun holiday-hebrew (month day string)
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
335 "Holiday on MONTH, DAY (Hebrew) called STRING.
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
336 If MONTH, DAY (Hebrew) is visible, the value returned is corresponding
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
337 Gregorian date in the form of the list (((month day year) STRING)). Returns
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
338 nil if it is not visible in the current calendar window."
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
339 (let ((gdate (calendar-hebrew-date-is-visible-p month day)))
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
340 (if gdate (list (list gdate string)))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
341
86489
997f6a0ad183 (holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
342 ;; h-r-h-e should be called from holidays code.
997f6a0ad183 (holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
343 (declare-function holiday-filter-visible-calendar "holidays" (l))
997f6a0ad183 (holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
344
93495
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
345 (defvar displayed-year)
3851465fdd03 (calendar-hebrew-date-is-visible-p): Use calendar-nongregorian-visible-p.
Glenn Morris <rgm@gnu.org>
parents: 93491
diff changeset
346
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
347 ;;;###holiday-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
348 (defun holiday-hebrew-rosh-hashanah (&optional all)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
349 "List of dates related to Rosh Hashanah, as visible in calendar window.
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
350 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
351 or ALL is non-nil."
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
352 (when (memq displayed-month '(8 9 10 11))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
353 (let ((abs-r-h (calendar-hebrew-to-absolute
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
354 (list 7 1 (+ displayed-year 3761)))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
355 (holiday-filter-visible-calendar
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
356 (append
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
357 (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
358 (list (calendar-gregorian-from-absolute abs-r-h)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
359 (format "Rosh HaShanah %d" (+ 3761 displayed-year)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
360 (list (calendar-gregorian-from-absolute (+ abs-r-h 9))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
361 "Yom Kippur")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
362 (list (calendar-gregorian-from-absolute (+ abs-r-h 14))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
363 "Sukkot")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
364 (list (calendar-gregorian-from-absolute (+ abs-r-h 21))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
365 "Shemini Atzeret")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
366 (list (calendar-gregorian-from-absolute (+ abs-r-h 22))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
367 "Simchat Torah"))
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
368 (when (or all calendar-hebrew-all-holidays-flag)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
369 (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
370 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
371 (calendar-dayname-on-or-before 6 (- abs-r-h 4)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
372 "Selichot (night)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
373 (list (calendar-gregorian-from-absolute (1- abs-r-h))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
374 "Erev Rosh HaShanah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
375 (list (calendar-gregorian-from-absolute (1+ abs-r-h))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
376 "Rosh HaShanah (second day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
377 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
378 (if (= (% abs-r-h 7) 4) (+ abs-r-h 3) (+ abs-r-h 2)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
379 "Tzom Gedaliah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
380 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
381 (calendar-dayname-on-or-before 6 (+ 7 abs-r-h)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
382 "Shabbat Shuvah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
383 (list (calendar-gregorian-from-absolute (+ abs-r-h 8))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
384 "Erev Yom Kippur")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
385 (list (calendar-gregorian-from-absolute (+ abs-r-h 13))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
386 "Erev Sukkot")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
387 (list (calendar-gregorian-from-absolute (+ abs-r-h 15))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
388 "Sukkot (second day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
389 (list (calendar-gregorian-from-absolute (+ abs-r-h 16))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
390 "Hol Hamoed Sukkot (first day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
391 (list (calendar-gregorian-from-absolute (+ abs-r-h 17))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
392 "Hol Hamoed Sukkot (second day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
393 (list (calendar-gregorian-from-absolute (+ abs-r-h 18))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
394 "Hol Hamoed Sukkot (third day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
395 (list (calendar-gregorian-from-absolute (+ abs-r-h 19))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
396 "Hol Hamoed Sukkot (fourth day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
397 (list (calendar-gregorian-from-absolute (+ abs-r-h 20))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
398 "Hoshanah Rabbah"))))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
399
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
400 ;;;###holiday-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
401 (define-obsolete-function-alias 'holiday-rosh-hashanah-etc
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
402 'holiday-hebrew-rosh-hashanah "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
403
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
404 ;;;###holiday-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
405 (defun holiday-hebrew-hanukkah (&optional all)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
406 "List of dates related to Hanukkah, as visible in calendar window.
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
407 Shows only Hanukkah, unless `calendar-hebrew-all-holidays-flag' or ALL
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
408 is non-nil."
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
409 ;; This test is only to speed things up a bit, it works fine without it.
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
410 (when (memq displayed-month '(10 11 12 1 2))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
411 (let* ((m displayed-month)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
412 (y displayed-year)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
413 (h-y (progn
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
414 (calendar-increment-month m y 1)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
415 (calendar-extract-year
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
416 (calendar-hebrew-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
417 (calendar-absolute-from-gregorian
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
418 (list m (calendar-last-day-of-month m y) y))))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
419 (abs-h (calendar-hebrew-to-absolute (list 9 25 h-y)))
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
420 (ord ["first" "second" "third" "fourth" "fifth" "sixth"
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
421 "seventh" "eighth"])
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
422 han)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
423 (holiday-filter-visible-calendar
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
424 (if (or all calendar-hebrew-all-holidays-flag)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
425 (append
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
426 (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
427 (list (calendar-gregorian-from-absolute (1- abs-h))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
428 "Erev Hanukkah"))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
429 (dotimes (i 8 (nreverse han))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
430 (push (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
431 (calendar-gregorian-from-absolute (+ abs-h i))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
432 (format "Hanukkah (%s day)" (aref ord i)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
433 han)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
434 (list (list (calendar-gregorian-from-absolute abs-h) "Hanukkah")))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
435
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
436 ;;;###holiday-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
437 (define-obsolete-function-alias 'holiday-hanukkah
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
438 'holiday-hebrew-hanukkah "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
439
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
440 ;;;###holiday-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
441 (defun holiday-hebrew-passover (&optional all)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
442 "List of dates related to Passover, as visible in calendar window.
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
443 Shows only the major holidays, unless `calendar-hebrew-all-holidays-flag'
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
444 or ALL is non-nil."
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
445 (when (< displayed-month 8)
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
446 (let ((abs-p (calendar-hebrew-to-absolute
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
447 (list 1 15 (+ displayed-year 3760)))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
448 (holiday-filter-visible-calendar
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
449 ;; The first two are out of order when the others are added.
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
450 (append
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
451 (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
452 (list (calendar-gregorian-from-absolute abs-p) "Passover")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
453 (list (calendar-gregorian-from-absolute (+ abs-p 50))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
454 "Shavuot"))
93632
d772031482b8 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93575
diff changeset
455 (when (or all calendar-hebrew-all-holidays-flag)
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
456 (list
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
457 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
458 (calendar-dayname-on-or-before 6 (- abs-p 43)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
459 "Shabbat Shekalim")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
460 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
461 (calendar-dayname-on-or-before 6 (- abs-p 30)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
462 "Shabbat Zachor")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
463 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
464 (if (= (% abs-p 7) 2) (- abs-p 33) (- abs-p 31)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
465 "Fast of Esther")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
466 (list (calendar-gregorian-from-absolute (- abs-p 31))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
467 "Erev Purim")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
468 (list (calendar-gregorian-from-absolute (- abs-p 30))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
469 "Purim")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
470 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
471 (if (zerop (% abs-p 7)) (- abs-p 28) (- abs-p 29)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
472 "Shushan Purim")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
473 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
474 (- (calendar-dayname-on-or-before 6 (- abs-p 14)) 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
475 "Shabbat Parah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
476 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
477 (calendar-dayname-on-or-before 6 (- abs-p 14)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
478 "Shabbat HaHodesh")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
479 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
480 (calendar-dayname-on-or-before 6 (1- abs-p)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
481 "Shabbat HaGadol")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
482 (list (calendar-gregorian-from-absolute (1- abs-p))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
483 "Erev Passover")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
484 (list (calendar-gregorian-from-absolute (1+ abs-p))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
485 "Passover (second day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
486 (list (calendar-gregorian-from-absolute (+ abs-p 2))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
487 "Hol Hamoed Passover (first day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
488 (list (calendar-gregorian-from-absolute (+ abs-p 3))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
489 "Hol Hamoed Passover (second day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
490 (list (calendar-gregorian-from-absolute (+ abs-p 4))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
491 "Hol Hamoed Passover (third day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
492 (list (calendar-gregorian-from-absolute (+ abs-p 5))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
493 "Hol Hamoed Passover (fourth day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
494 (list (calendar-gregorian-from-absolute (+ abs-p 6))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
495 "Passover (seventh day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
496 (list (calendar-gregorian-from-absolute (+ abs-p 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
497 "Passover (eighth day)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
498 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
499 (if (zerop (% (+ abs-p 12) 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
500 (+ abs-p 13)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
501 (+ abs-p 12)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
502 "Yom HaShoah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
503 (list (calendar-gregorian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
504 (if (zerop (% abs-p 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
505 (+ abs-p 18)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
506 (if (= (% abs-p 7) 6)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
507 (+ abs-p 19)
107315
893db3292264 Fix date of Yom HaAtzma'ut holiday.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
508 (if (= (% abs-p 7) 2)
893db3292264 Fix date of Yom HaAtzma'ut holiday.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
509 (+ abs-p 21)
893db3292264 Fix date of Yom HaAtzma'ut holiday.
Glenn Morris <rgm@gnu.org>
parents: 106815
diff changeset
510 (+ abs-p 20)))))
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
511 "Yom HaAtzma'ut")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
512 (list (calendar-gregorian-from-absolute (+ abs-p 33))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
513 "Lag BaOmer")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
514 (list (calendar-gregorian-from-absolute (+ abs-p 43))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
515 "Yom Yerushalaim")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
516 (list (calendar-gregorian-from-absolute (+ abs-p 49))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
517 "Erev Shavuot")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
518 (list (calendar-gregorian-from-absolute (+ abs-p 51))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
519 "Shavuot (second day)"))))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
520
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
521 ;;;###holiday-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
522 (define-obsolete-function-alias 'holiday-passover-etc
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
523 'holiday-hebrew-passover "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
524
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
525 ;;;###holiday-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
526 (defun holiday-hebrew-tisha-b-av ()
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
527 "List of dates around Tisha B'Av, as visible in calendar window."
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
528 (when (memq displayed-month '(5 6 7 8 9))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
529 (let ((abs-t-a (calendar-hebrew-to-absolute
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
530 (list 5 9 (+ displayed-year 3760)))))
84552
eb2c7d456b7a Rename all filter-visible-calendar-holidays callers to
Glenn Morris <rgm@gnu.org>
parents: 82140
diff changeset
531 (holiday-filter-visible-calendar
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
532 (list
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
533 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
534 (if (= (% abs-t-a 7) 6) (- abs-t-a 20) (- abs-t-a 21)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
535 "Tzom Tammuz")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
536 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
537 (calendar-dayname-on-or-before 6 abs-t-a))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
538 "Shabbat Hazon")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
539 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
540 (if (= (% abs-t-a 7) 6) (1+ abs-t-a) abs-t-a))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
541 "Tisha B'Av")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
542 (list (calendar-gregorian-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
543 (calendar-dayname-on-or-before 6 (+ abs-t-a 7)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
544 "Shabbat Nahamu"))))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
545
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
546 ;;;###holiday-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
547 (define-obsolete-function-alias 'holiday-tisha-b-av-etc
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
548 'holiday-hebrew-tisha-b-av "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
549
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
550 (autoload 'holiday-julian "cal-julian")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
551
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
552 ;;;###holiday-autoload
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
553 (defun holiday-hebrew-misc ()
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
554 "Miscellaneous Hebrew holidays, if visible in calendar window.
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
555 Includes: Tal Umatar, Tzom Teveth, Tu B'Shevat, Shabbat Shirah, and
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
556 Kiddush HaHamah."
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
557 (let ((m displayed-month)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
558 (y displayed-year)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
559 year h-year s-s)
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
560 (append
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
561 (holiday-julian
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
562 11
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
563 (progn
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
564 (calendar-increment-month m y -1)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
565 (setq year (calendar-extract-year
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
566 (calendar-julian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
567 (calendar-absolute-from-gregorian (list m 1 y)))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
568 (if (zerop (% (1+ year) 4))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
569 22
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
570 21)) "\"Tal Umatar\" (evening)")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
571 (holiday-hebrew
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
572 10
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
573 (progn
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
574 (setq h-year (calendar-extract-year
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
575 (calendar-hebrew-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
576 (calendar-absolute-from-gregorian
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
577 (list displayed-month 28 displayed-year)))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
578 (if (= 6 (% (calendar-hebrew-to-absolute (list 10 10 h-year))
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
579 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
580 11 10))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
581 "Tzom Teveth")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
582 (holiday-hebrew 11 15 "Tu B'Shevat")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
583 (holiday-hebrew
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
584 11
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
585 (progn
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
586 (setq m displayed-month
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
587 y displayed-year
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
588 h-year (progn
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
589 (calendar-increment-month m y 1)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
590 (calendar-extract-year
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
591 (calendar-hebrew-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
592 (calendar-absolute-from-gregorian
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
593 (list m (calendar-last-day-of-month m y) y)))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
594 s-s
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
595 (calendar-hebrew-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
596 (if (= 6
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
597 (% (calendar-hebrew-to-absolute
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
598 (list 7 1 h-year))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
599 7))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
600 (calendar-dayname-on-or-before
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
601 6 (calendar-hebrew-to-absolute
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
602 (list 11 17 h-year)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
603 (calendar-dayname-on-or-before
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
604 6 (calendar-hebrew-to-absolute
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
605 (list 11 16 h-year))))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
606 (calendar-extract-day s-s))
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
607 "Shabbat Shirah")
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
608 (and (progn
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
609 (setq m displayed-month
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
610 y displayed-year
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
611 year (progn
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
612 (calendar-increment-month m y -1)
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
613 (calendar-extract-year
93575
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
614 (calendar-julian-from-absolute
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
615 (calendar-absolute-from-gregorian (list m 1 y))))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
616 (= 21 (% year 28)))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
617 (holiday-julian 3 26 "Kiddush HaHamah")))))
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
618
7303db4cd998 (holiday-rosh-hashanah-etc, holiday-passover-etc, holiday-hanukkah):
Glenn Morris <rgm@gnu.org>
parents: 93525
diff changeset
619
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
620 (autoload 'diary-list-entries-1 "diary-lib")
92701
6a990f964e22 (date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents: 92667
diff changeset
621
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
622 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
623 (defun diary-hebrew-list-entries ()
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
624 "Add any Hebrew date entries from the diary file to `diary-entries-list'.
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
625 Hebrew date diary entries must be prefaced by `diary-hebrew-entry-symbol'
92918
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
626 \(normally an `H'). The same diary date forms govern the style
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
627 of the Hebrew calendar entries, except that the Hebrew month
93269
da37495d5c85 (list-hebrew-diary-entries): Doc fix.
Glenn Morris <rgm@gnu.org>
parents: 93183
diff changeset
628 names cannot be abbreviated. The Hebrew months are numbered
92918
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
629 from 1 to 13 with Nisan being 1, 12 being Adar I and 13 being
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
630 Adar II; you must use `Adar I' if you want Adar of a common
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
631 Hebrew year. If a Hebrew date diary entry begins with
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
632 `diary-nonmarking-symbol', the entry will appear in the diary
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
633 listing, but will not be marked in the calendar. This function
93795
a047f634bd60 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93753
diff changeset
634 is provided for use with `diary-nongregorian-listing-hook'."
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
635 (diary-list-entries-1 calendar-hebrew-month-name-array-leap-year
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
636 diary-hebrew-entry-symbol
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
637 'calendar-hebrew-from-absolute))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
638 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
639 (define-obsolete-function-alias 'list-hebrew-diary-entries
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
640 'diary-hebrew-list-entries "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
641
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
642 (autoload 'calendar-mark-complex "diary-lib")
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
643
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
644 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
645 (defun calendar-hebrew-mark-date-pattern (month day year &optional color)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
646 "Mark dates in calendar window that conform to Hebrew date MONTH/DAY/YEAR.
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
647 A value of 0 in any position is a wildcard. Optional argument COLOR is
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
648 passed to `calendar-mark-visible-date' as MARK."
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
649 ;; FIXME not the same as the Bahai and Islamic cases, so can't use
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
650 ;; calendar-mark-1.
105829
328150f0cf76 * url-util.el (url-insert-entities-in-string):
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 100908
diff changeset
651 (with-current-buffer calendar-buffer
92611
297952467e34 (mark-hebrew-calendar-date-pattern): Use zerop.
Glenn Morris <rgm@gnu.org>
parents: 92583
diff changeset
652 (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
653 (if (not (zerop year))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
654 ;; Fully specified Hebrew date.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
655 (let ((date (calendar-gregorian-from-absolute
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
656 (calendar-hebrew-to-absolute
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
657 (list month day year)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
658 (if (calendar-date-is-visible-p date)
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
659 (calendar-mark-visible-date date color)))
93491
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
660 ;; Month and day in any year.
15b2492faf63 (hebrew-calendar-elapsed-days): Dox fix.
Glenn Morris <rgm@gnu.org>
parents: 93469
diff changeset
661 (let ((gdate (calendar-hebrew-date-is-visible-p month day)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
662 (if gdate (calendar-mark-visible-date gdate color))))
92993
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
663 (calendar-mark-complex month day year
61c2483cb400 (calendar-mark-complex): Autoload it.
Glenn Morris <rgm@gnu.org>
parents: 92972
diff changeset
664 'calendar-hebrew-from-absolute color))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
665
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
666 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
667 (define-obsolete-function-alias 'mark-hebrew-calendar-date-pattern
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
668 'calendar-hebrew-mark-date-pattern "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
669
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
670 (autoload 'diary-mark-entries-1 "diary-lib")
86489
997f6a0ad183 (holiday-filter-visible-calendar)
Glenn Morris <rgm@gnu.org>
parents: 85510
diff changeset
671
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
672 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
673 (defun diary-hebrew-mark-entries ()
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
674 "Mark days in the calendar window that have Hebrew date diary entries.
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
675 Marks each entry in `diary-file' (or included files) visible in the calendar
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
676 window. See `list-hebrew-diary-entries' for more information."
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
677 (diary-mark-entries-1 'calendar-hebrew-mark-date-pattern
93469
777bad4c4617 (Commentary): Replace with pointer to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93448
diff changeset
678 calendar-hebrew-month-name-array-leap-year
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
679 diary-hebrew-entry-symbol
93469
777bad4c4617 (Commentary): Replace with pointer to calendar.el.
Glenn Morris <rgm@gnu.org>
parents: 93448
diff changeset
680 'calendar-hebrew-from-absolute))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
681
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
682 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
683 (define-obsolete-function-alias 'mark-hebrew-diary-entries
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
684 'diary-hebrew-mark-entries "23.1")
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
685
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
686 (autoload 'diary-insert-entry-1 "diary-lib")
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
687
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
688 ;;;###cal-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
689 (defun diary-hebrew-insert-entry (arg)
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
690 "Insert a diary entry for the Hebrew date at point.
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
691 Prefix argument ARG makes the entry nonmarking."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
692 (interactive "P")
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
693 (diary-insert-entry-1 nil arg calendar-hebrew-month-name-array-leap-year
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
694 diary-hebrew-entry-symbol
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
695 'calendar-hebrew-from-absolute))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
696
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
697 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
698 (define-obsolete-function-alias 'insert-hebrew-diary-entry
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
699 'diary-hebrew-insert-entry "23.1")
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
700
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
701 ;;;###cal-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
702 (defun diary-hebrew-insert-monthly-entry (arg)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
703 "Insert a monthly diary entry.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
704 For the day of the Hebrew month corresponding to the date indicated by point.
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
705 Prefix argument ARG makes the entry nonmarking."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
706 (interactive "P")
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
707 (diary-insert-entry-1 'monthly arg calendar-hebrew-month-name-array-leap-year
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
708 diary-hebrew-entry-symbol
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
709 'calendar-hebrew-from-absolute))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
710 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
711 (define-obsolete-function-alias 'insert-monthly-hebrew-diary-entry
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
712 'diary-hebrew-insert-monthly-entry "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
713
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
714 ;;;###cal-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
715 (defun diary-hebrew-insert-yearly-entry (arg)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
716 "Insert an annual diary entry.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
717 For the day of the Hebrew year corresponding to the date indicated by point.
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
718 Prefix argument ARG makes the entry nonmarking."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
719 (interactive "P")
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
720 (diary-insert-entry-1 'yearly arg calendar-hebrew-month-name-array-leap-year
93734
0a5160e7009f Update for rename hebrew-diary-entry-symbol to diary-hebrew-entry-symbol.
Glenn Morris <rgm@gnu.org>
parents: 93632
diff changeset
721 diary-hebrew-entry-symbol
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
722 'calendar-hebrew-from-absolute))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
723 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
724 (define-obsolete-function-alias 'insert-yearly-hebrew-diary-entry
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
725 'diary-hebrew-insert-yearly-entry "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
726
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
727 ;;;###autoload
93870
eaab2dd34967 (calendar-hebrew-list-yahrzeits): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93844
diff changeset
728 (defun calendar-hebrew-list-yahrzeits (death-date start-year end-year)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
729 "List Yahrzeit dates for *Gregorian* DEATH-DATE from START-YEAR to END-YEAR.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
730 When called interactively from the calendar window, the date of death is taken
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
731 from the cursor position."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
732 (interactive
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
733 (let* ((death-date
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
734 (if (equal (current-buffer) (get-buffer calendar-buffer))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
735 (calendar-cursor-to-date)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
736 (let* ((today (calendar-current-date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
737 (year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
738 "Year of death (>0): "
92583
f82da83f1b8a Unquote lambda functions.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
739 (lambda (x) (> x 0))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
740 (number-to-string (calendar-extract-year today))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
741 (month-array calendar-month-name-array)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
742 (completion-ignore-case t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
743 (month (cdr (assoc-string
24187
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
744 (completing-read
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
745 "Month of death (name): "
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
746 (mapcar 'list (append month-array nil))
cc07d0f935d4 (calendar-goto-hebrew-date)
Richard M. Stallman <rms@gnu.org>
parents: 22063
diff changeset
747 nil t)
54074
ae72e69df10d (calendar-goto-hebrew-date, mark-hebrew-diary-entries)
Glenn Morris <rgm@gnu.org>
parents: 52401
diff changeset
748 (calendar-make-alist month-array 1) t)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
749 (last (calendar-last-day-of-month month year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
750 (day (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
751 (format "Day of death (1-%d): " last)
92583
f82da83f1b8a Unquote lambda functions.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
752 (lambda (x) (and (< 0 x) (<= x last))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
753 (list month day year))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
754 (death-year (calendar-extract-year death-date))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
755 (start-year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
756 (format "Starting year of Yahrzeit table (>%d): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
757 death-year)
92583
f82da83f1b8a Unquote lambda functions.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
758 (lambda (x) (> x death-year))
93844
bf9ef749c23e Replace int-to-string with number-to-string.
Glenn Morris <rgm@gnu.org>
parents: 93809
diff changeset
759 (number-to-string (1+ death-year))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
760 (end-year (calendar-read
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
761 (format "Ending year of Yahrzeit table (>=%d): "
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
762 start-year)
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
763 (lambda (x) (>= x start-year)))))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
764 (list death-date start-year end-year)))
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
765 (message "Computing Yahrzeits...")
92817
1b8224570e5f (list-yahrzeit-dates): Use cal-hebrew-yahrzeit-buffer.
Glenn Morris <rgm@gnu.org>
parents: 92701
diff changeset
766 (let* ((h-date (calendar-hebrew-from-absolute
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
767 (calendar-absolute-from-gregorian death-date)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
768 (h-month (calendar-extract-month h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
769 (h-day (calendar-extract-day h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
770 (h-year (calendar-extract-year h-date))
93525
26506821c407 (list-yahrzeit-dates): Expand calendar-for-loop call.
Glenn Morris <rgm@gnu.org>
parents: 93495
diff changeset
771 (i (1- start-year)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
772 (calendar-in-read-only-buffer calendar-hebrew-yahrzeit-buffer
93025
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
773 (calendar-set-mode-line
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
774 (format "Yahrzeit dates for %s = %s"
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
775 (calendar-date-string death-date)
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
776 (let ((calendar-month-name-array
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
777 (if (calendar-hebrew-leap-year-p h-year)
93025
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
778 calendar-hebrew-month-name-array-leap-year
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
779 calendar-hebrew-month-name-array-common-year)))
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
780 (calendar-date-string h-date nil t))))
93525
26506821c407 (list-yahrzeit-dates): Expand calendar-for-loop call.
Glenn Morris <rgm@gnu.org>
parents: 93495
diff changeset
781 (while (<= (setq i (1+ i)) end-year)
93025
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
782 (insert
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
783 (calendar-date-string
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
784 (calendar-gregorian-from-absolute
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
785 (calendar-hebrew-yahrzeit
93025
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
786 h-date
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
787 (calendar-extract-year
93025
1e3b2cf969d4 (list-yahrzeit-dates): Use calendar-in-read-only-buffer to replace
Glenn Morris <rgm@gnu.org>
parents: 92993
diff changeset
788 (calendar-hebrew-from-absolute
93525
26506821c407 (list-yahrzeit-dates): Expand calendar-for-loop call.
Glenn Morris <rgm@gnu.org>
parents: 93495
diff changeset
789 (calendar-absolute-from-gregorian (list 1 1 i))))))) "\n"))))
26506821c407 (list-yahrzeit-dates): Expand calendar-for-loop call.
Glenn Morris <rgm@gnu.org>
parents: 93495
diff changeset
790 (message "Computing Yahrzeits...done"))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
791
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
792 ;;;###autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
793 (define-obsolete-function-alias 'list-yahrzeit-dates
93870
eaab2dd34967 (calendar-hebrew-list-yahrzeits): Typo.
Stefan Monnier <monnier@iro.umontreal.ca>
parents: 93844
diff changeset
794 'calendar-hebrew-list-yahrzeits "23.1")
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
795
92701
6a990f964e22 (date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents: 92667
diff changeset
796 (defvar date)
6a990f964e22 (date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents: 92667
diff changeset
797
93795
a047f634bd60 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93753
diff changeset
798 ;; To be called from diary-list-sexp-entries, where DATE is bound.
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
799 ;;;###diary-autoload
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
800 (defun diary-hebrew-date ()
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
801 "Hebrew calendar equivalent of date diary entry."
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
802 (format "Hebrew date (until sunset): %s" (calendar-hebrew-date-string date)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
803
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
804 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
805 (defun diary-hebrew-omer (&optional mark)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
806 "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
807 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
808
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
809 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
810 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
811 (let* ((passover
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
812 (calendar-hebrew-to-absolute
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
813 (list 1 15 (+ (calendar-extract-year date) 3760))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
814 (omer (- (calendar-absolute-from-gregorian date) passover))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
815 (week (/ omer 7))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
816 (day (% omer 7)))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
817 (if (and (> omer 0) (< omer 50))
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
818 (cons mark
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
819 (format "Day %d%s of the omer (until sunset)"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
820 omer
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
821 (if (zerop week)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
822 ""
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
823 (format ", that is, %d week%s%s"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
824 week
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
825 (if (= week 1) "" "s")
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
826 (if (zerop day)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
827 ""
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
828 (format " and %d day%s"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
829 day (if (= day 1) "" "s"))))))))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
830 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
831 (define-obsolete-function-alias 'diary-omer 'diary-hebrew-omer "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
832
92701
6a990f964e22 (date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents: 92667
diff changeset
833 (defvar entry)
6a990f964e22 (date, entry, number): Move declarations to where they are needed.
Glenn Morris <rgm@gnu.org>
parents: 92667
diff changeset
834
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
835 (autoload 'diary-make-date "diary-lib")
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
836
95302
d63199769a1b (diary-ordinal-suffix): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 95298
diff changeset
837 (declare-function diary-ordinal-suffix "diary-lib" (n))
d63199769a1b (diary-ordinal-suffix): Declare for compiler.
Glenn Morris <rgm@gnu.org>
parents: 95298
diff changeset
838
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
839 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
840 (defun diary-hebrew-yahrzeit (death-month death-day death-year &optional mark)
92667
f33b5b5e4c02 (hebrew-calendar-leap-year-p)
Glenn Morris <rgm@gnu.org>
parents: 92658
diff changeset
841 "Yahrzeit diary entry--entry applies if date is Yahrzeit or the day before.
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
842 Parameters are DEATH-MONTH, DEATH-DAY, DEATH-YEAR; the diary
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
843 entry is assumed to be the name of the person. Although the date
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
844 of death is specified by the civil calendar, the proper Hebrew
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
845 calendar Yahrzeit is determined.
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
846
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
847 The order of the input parameters changes according to `calendar-date-style'
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
848 \(e.g. to DEATH-DAY, DEATH-MONTH, DEATH-YEAR in the European style).
46619
5d2941da3ed1 (diary-omer, diary-yahrzeit, diary-rosh-hodesh, diary-parasha, diary-parasha):
Richard M. Stallman <rms@gnu.org>
parents: 44366
diff changeset
849
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
850 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
851 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
852 (let* ((h-date (calendar-hebrew-from-absolute
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
853 (calendar-absolute-from-gregorian
93378
5fce742bc681 Autoload diary-insert-entry-1.
Glenn Morris <rgm@gnu.org>
parents: 93269
diff changeset
854 (diary-make-date death-month death-day death-year))))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
855 (h-month (calendar-extract-month h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
856 (h-day (calendar-extract-day h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
857 (h-year (calendar-extract-year h-date))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
858 (d (calendar-absolute-from-gregorian date))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
859 (yr (calendar-extract-year (calendar-hebrew-from-absolute d)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
860 (diff (- yr h-year))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
861 (y (calendar-hebrew-yahrzeit h-date yr)))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
862 (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
863 (cons mark
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
864 (format "Yahrzeit of %s%s: %d%s anniversary"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
865 entry
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
866 (if (= y d) "" " (evening)")
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
867 diff
95298
e8ffa14b742c Ed Reingold <reingold at emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
868 (diary-ordinal-suffix diff))))))
e8ffa14b742c Ed Reingold <reingold at emr.cs.iit.edu>
Glenn Morris <rgm@gnu.org>
parents: 94653
diff changeset
869
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
870 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
871 (define-obsolete-function-alias 'diary-yahrzeit 'diary-hebrew-yahrzeit "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
872
92830
669faa35f924 Add calendar-specific autoload cookies.
Glenn Morris <rgm@gnu.org>
parents: 92817
diff changeset
873 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
874 (defun diary-hebrew-rosh-hodesh (&optional mark)
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
875 "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
876 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
877
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
878 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
879 use when highlighting the day in the calendar."
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
880 (let* ((d (calendar-absolute-from-gregorian date))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
881 (h-date (calendar-hebrew-from-absolute d))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
882 (h-month (calendar-extract-month h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
883 (h-day (calendar-extract-day h-date))
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
884 (h-year (calendar-extract-year h-date))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
885 (leap-year (calendar-hebrew-leap-year-p h-year))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
886 (last-day (calendar-hebrew-last-day-of-month h-month h-year))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
887 (h-month-names
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
888 (if leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
889 calendar-hebrew-month-name-array-leap-year
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
890 calendar-hebrew-month-name-array-common-year))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
891 (this-month (aref h-month-names (1- h-month)))
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
892 (h-yesterday (calendar-extract-day
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
893 (calendar-hebrew-from-absolute (1- d)))))
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
894 (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
895 (cons mark
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
896 (format
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
897 "Rosh Hodesh %s"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
898 (if (= h-day 30)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
899 (format
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
900 "%s (first day)"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
901 ;; Next month must be in the same year since this
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
902 ;; month can't be the last month of the year since
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
903 ;; it has 30 days
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
904 (aref h-month-names h-month))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
905 (if (= h-yesterday 30)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
906 (format "%s (second day)" this-month)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
907 this-month))))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
908 (if (= (% d 7) 6) ; Saturday--check for Shabbat Mevarchim
49598
0d8b17d428b5 Trailing whitepace deleted.
Juanma Barranquero <lekktu@gmail.com>
parents: 46708
diff changeset
909 (cons mark
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
910 (cond ((and (> h-day 22) (/= h-month 6) (= 29 last-day))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
911 (format "Mevarchim Rosh Hodesh %s (%s)"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
912 (aref h-month-names
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
913 (if (= h-month
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
914 (calendar-hebrew-last-month-of-year
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
915 h-year))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
916 0 h-month))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
917 (aref calendar-day-name-array (- 29 h-day))))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
918 ((and (< h-day 30) (> h-day 22) (= 30 last-day))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
919 (format "Mevarchim Rosh Hodesh %s (%s-%s)"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
920 (aref h-month-names h-month)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
921 (if (= h-day 29)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
922 "tomorrow"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
923 (aref calendar-day-name-array (- 29 h-day)))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
924 (aref calendar-day-name-array
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
925 (% (- 30 h-day) 7))))))
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
926 (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
927 (cons mark
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
928 (format "Erev Rosh Hodesh %s"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
929 (aref h-month-names
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
930 (if (= h-month
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
931 (calendar-hebrew-last-month-of-year
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
932 h-year))
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
933 0 h-month)))))))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
934 ;;;###diary-autoload
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
935 (define-obsolete-function-alias 'diary-rosh-hodesh
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
936 'diary-hebrew-rosh-hodesh "23.1")
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
937
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
938 (defconst calendar-hebrew-parashiot-names
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
939 ["Bereshith" "Noah" "Lech L'cha" "Vayera" "Hayei Sarah" "Toledoth"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
940 "Vayetze" "Vayishlah" "Vayeshev" "Mikketz" "Vayiggash" "Vayhi"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
941 "Shemoth" "Vaera" "Bo" "Beshallah" "Yithro" "Mishpatim"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
942 "Terumah" "Tetzavveh" "Ki Tissa" "Vayakhel" "Pekudei" "Vayikra"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
943 "Tzav" "Shemini" "Tazria" "Metzora" "Aharei Moth" "Kedoshim"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
944 "Emor" "Behar" "Behukkotai" "Bemidbar" "Naso" "Behaalot'cha"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
945 "Shelah L'cha" "Korah" "Hukkath" "Balak" "Pinhas" "Mattoth"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
946 "Masei" "Devarim" "Vaethanan" "Ekev" "Reeh" "Shofetim"
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
947 "Ki Tetze" "Ki Tavo" "Nitzavim" "Vayelech" "Haazinu"]
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
948 "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
949
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
950 (defun calendar-hebrew-parasha-name (p)
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
951 "Name(s) corresponding to parasha P."
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
952 (if (arrayp p) ; combined parasha
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
953 (format "%s/%s"
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
954 (aref calendar-hebrew-parashiot-names (aref p 0))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
955 (aref calendar-hebrew-parashiot-names (aref p 1)))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
956 (aref calendar-hebrew-parashiot-names p)))
52118
af8f4ec2f255 Reposition some code so defined before used.
Glenn Morris <rgm@gnu.org>
parents: 49598
diff changeset
957
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
958 ;; Following 14 constants are used in diary-parasha (intern).
92918
3f05cbe354c1 (displayed-month, displayed-year, original-date): Move declarations
Glenn Morris <rgm@gnu.org>
parents: 92852
diff changeset
959
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
960 ;; The seven ordinary year types (keviot).
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
961 (defconst calendar-hebrew-year-Saturday-incomplete-Sunday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
962 [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]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
963 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
964 43 44 45 46 47 48 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
965 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
966 Hebrew year starts on Saturday, is `incomplete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
967 29 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
968
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
969 (defconst calendar-hebrew-year-Saturday-complete-Tuesday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
970 [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]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
971 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
972 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
973 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
974 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
975 have 30 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
976
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
977 (defconst calendar-hebrew-year-Monday-incomplete-Tuesday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
978 [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]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
979 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
980 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
981 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
982 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
983 have 29 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
984
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
985 (defconst calendar-hebrew-year-Monday-complete-Thursday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
986 [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]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
987 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
988 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
989 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
990 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
991 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
992
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
993 (defconst calendar-hebrew-year-Tuesday-regular-Thursday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
994 [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]
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
995 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 (nil . 34) (34 . 35) (35 . 36)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
996 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
997 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
998 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
999 Kislev has 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1000
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1001 (defconst calendar-hebrew-year-Thursday-regular-Saturday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1002 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1003 24 nil (nil . 25) (25 . [26 27]) ([26 27] . [28 29]) ([28 29] . 30)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1004 (30 . 31) ([31 32] . 32) 33 34 35 36 37 38 39 40 [41 42] 43 44 45 46 47 48
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1005 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1006 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1007 Hebrew year that starts on Thursday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1008 Kislev has 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1009
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1010 (defconst calendar-hebrew-year-Thursday-complete-Sunday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1011 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1012 23 24 nil 25 [26 27] [28 29] 30 [31 32] 33 34 35 36 37 38 39 40 [41 42]
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1013 43 44 45 46 47 48 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1014 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1015 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1016 have 30 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1017
92658
abf9226ae6c9 Formatting changes only.
Glenn Morris <rgm@gnu.org>
parents: 92611
diff changeset
1018 ;; The seven leap year types (keviot).
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1019 (defconst calendar-hebrew-year-Saturday-incomplete-Tuesday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1020 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1021 23 24 25 26 27 nil 28 29 30 31 32 33 34 35 36 37 38 39 40 [41 42]
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1022 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1023 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1024 Hebrew year that starts on Saturday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1025 have 29 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1026
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1027 (defconst calendar-hebrew-year-Saturday-complete-Thursday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1028 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1029 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1030 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1031 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1032 Hebrew year that starts on Saturday, is `complete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1033 have 30 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1034
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1035 (defconst calendar-hebrew-year-Monday-incomplete-Thursday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1036 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1037 23 24 25 26 27 nil 28 29 30 31 32 33 (nil . 34) (34 . 35) (35 . 36)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1038 (36 . 37) (37 . 38) ([38 39] . 39) 40 [41 42] 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1039 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1040 Hebrew year that starts on Monday, is `incomplete' (Heshvan and Kislev each
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1041 have 29 days), and has Passover start on Thursday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1042
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1043 (defconst calendar-hebrew-year-Monday-complete-Saturday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1044 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1045 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1046 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1047 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1048 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1049 Hebrew year that starts on Monday, is `complete' (Heshvan and Kislev each have
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1050 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1051
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1052 (defconst calendar-hebrew-year-Tuesday-regular-Saturday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1053 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1054 23 24 25 26 27 nil (nil . 28) (28 . 29) (29 . 30) (30 . 31) (31 . 32)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1055 (32 . 33) (33 . 34) (34 . 35) (35 . 36) (36 . 37) (37 . 38) (38 . 39)
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1056 (39 . 40) (40 . 41) ([41 42] . 42) 43 44 45 46 47 48 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1057 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1058 Hebrew year that starts on Tuesday, is `regular' (Heshvan has 29 days and
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1059 Kislev has 30 days), and has Passover start on Saturday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1060
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1061 (defconst calendar-hebrew-year-Thursday-incomplete-Sunday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1062 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1063 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1064 43 44 45 46 47 48 49 50]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1065 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1066 Hebrew year that starts on Thursday, is `incomplete' (Heshvan and Kislev both
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1067 have 29 days), and has Passover start on Sunday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1068
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1069 (defconst calendar-hebrew-year-Thursday-complete-Tuesday
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1070 [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
92852
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1071 23 24 25 26 27 28 nil 29 30 31 32 33 34 35 36 37 38 39 40 41 42
0f0bcef8e577 Whitespace only.
Glenn Morris <rgm@gnu.org>
parents: 92830
diff changeset
1072 43 44 45 46 47 48 49 [50 51]]
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1073 "The structure of the parashiot.
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1074 Hebrew year that starts on Thursday, is `complete' (Heshvan and Kislev both
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1075 have 30 days), and has Passover start on Tuesday.")
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1076
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1077 ;;;###diary-autoload
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1078 (defun diary-hebrew-parasha (&optional mark)
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1079 "Parasha diary entry--entry applies if date is a Saturday.
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1080 An optional parameter MARK specifies a face or single-character string to
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1081 use when highlighting the day in the calendar."
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1082 (let ((d (calendar-absolute-from-gregorian date)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1083 (if (= (% d 7) 6) ; Saturday
93809
3ff2b47de8f2 Update for calendar.el name changes.
Glenn Morris <rgm@gnu.org>
parents: 93795
diff changeset
1084 (let* ((h-year (calendar-extract-year
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1085 (calendar-hebrew-from-absolute d)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1086 (rosh-hashanah
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1087 (calendar-hebrew-to-absolute (list 7 1 h-year)))
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1088 (passover
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1089 (calendar-hebrew-to-absolute (list 1 15 h-year)))
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1090 (rosh-hashanah-day
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1091 (aref calendar-day-name-array (% rosh-hashanah 7)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1092 (passover-day
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1093 (aref calendar-day-name-array (% passover 7)))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1094 (long-h (calendar-hebrew-long-heshvan-p h-year))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1095 (short-k (calendar-hebrew-short-kislev-p h-year))
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1096 (type (cond ((and long-h (not short-k)) "complete")
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1097 ((and (not long-h) short-k) "incomplete")
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1098 (t "regular")))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1099 (year-format
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1100 (symbol-value
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1101 (intern (format "calendar-hebrew-year-%s-%s-%s" ; keviah
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1102 rosh-hashanah-day type passover-day))))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1103 (first-saturday ; of Hebrew year
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1104 (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1105 (saturday ; which Saturday of the Hebrew year
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1106 (/ (- d first-saturday) 7))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1107 (parasha (aref year-format saturday)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1108 (if parasha
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1109 (cons mark
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1110 (format
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1111 "Parashat %s"
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1112 (if (listp parasha) ; Israel differs from diaspora
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1113 (if (car parasha)
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1114 (format "%s (diaspora), %s (Israel)"
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1115 (calendar-hebrew-parasha-name
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1116 (car parasha))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1117 (calendar-hebrew-parasha-name
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1118 (cdr parasha)))
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1119 (format "%s (Israel)"
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1120 (calendar-hebrew-parasha-name
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1121 (cdr parasha))))
93738
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1122 (calendar-hebrew-parasha-name parasha)))))))))
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1123
0a604bbef4db (calendar-hebrew-leap-year-p): Rename hebrew-calendar-leap-year-p.
Glenn Morris <rgm@gnu.org>
parents: 93734
diff changeset
1124 (define-obsolete-function-alias 'diary-parasha 'diary-hebrew-parasha "23.1")
92972
81a28241fa57 (number, original-date, add-to-diary-list)
Glenn Morris <rgm@gnu.org>
parents: 92918
diff changeset
1125
93750
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1126
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1127 (declare-function solar-setup "solar" ())
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1128 (declare-function solar-sunrise-sunset "solar" (date))
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1129 (defvar calendar-latitude)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1130 (defvar calendar-longitude)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1131 (defvar calendar-time-zone)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1132
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1133
93795
a047f634bd60 Update for diary-lib name changes.
Glenn Morris <rgm@gnu.org>
parents: 93753
diff changeset
1134 ;; To be called from diary-list-sexp-entries, where DATE is bound.
93750
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1135 ;;;###diary-autoload
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1136 (defun diary-hebrew-sabbath-candles (&optional mark)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1137 "Local time of candle lighting diary entry--applies if date is a Friday.
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1138 No diary entry if there is no sunset on that date. Uses
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1139 `diary-hebrew-sabbath-candles-minutes'.
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1140
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1141 An optional parameter MARK specifies a face or single-character string to
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1142 use when highlighting the day in the calendar."
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1143 (require 'solar)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1144 (or (and calendar-latitude calendar-longitude calendar-time-zone)
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1145 (solar-setup))
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1146 (if (= (% (calendar-absolute-from-gregorian date) 7) 5) ; Friday
93753
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1147 (let ((sunset (cadr (solar-sunrise-sunset date))))
93750
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1148 (if sunset
93753
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1149 (cons mark (format
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1150 "%s Sabbath candle lighting"
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1151 (apply 'solar-time-string
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1152 (cons (- (car sunset)
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1153 (/ diary-hebrew-sabbath-candles-minutes
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1154 60.0))
a0a31b0153ed (diary-hebrew-sabbath-candles): Simplify.
Glenn Morris <rgm@gnu.org>
parents: 93750
diff changeset
1155 (cdr sunset)))))))))
93750
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1156
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1157 ;;;###diary-autoload
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1158 (define-obsolete-function-alias 'diary-sabbath-candles
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1159 'diary-hebrew-sabbath-candles "23.1")
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1160
6b7951a8cc36 (diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Glenn Morris <rgm@gnu.org>
parents: 93738
diff changeset
1161
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1162 (provide 'cal-hebrew)
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1163
92583
f82da83f1b8a Unquote lambda functions.
Glenn Morris <rgm@gnu.org>
parents: 87649
diff changeset
1164 ;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c
13050
477ab7ada6ee Initial revision
Edward M. Reingold <reingold@emr.cs.iit.edu>
parents:
diff changeset
1165 ;;; cal-hebrew.el ends here