]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/cal-hebrew.el
(auto-mode-alist): Add snmp-mode patterns.
[gnu-emacs] / lisp / calendar / cal-hebrew.el
index 2c08b3049c9e4004a81b620c257e21c76f43bffc..16868f7e70398a173671c1ebec85abb22df92869 100644 (file)
@@ -1,8 +1,8 @@
-;;; cal-hebrew.el --- calendar functions for the Islamic calendar.
+;;; cal-hebrew.el --- calendar functions for the Hebrew calendar.
 
-;; Copyright (C) 1995 Free Software Foundation, Inc.
+;; Copyright (C) 1995, 1997 Free Software Foundation, Inc.
 
-;; Author: Nachum Dershowi <nachum@cs.uiuc.edu>
+;; Author: Nachum Dershowitz <nachum@cs.uiuc.edu>
 ;;      Edward M. Reingold <reingold@cs.uiuc.edu>
 ;; Keywords: calendar
 ;; Human-Keywords: Hebrew calendar, calendar, diary
 ;; GNU General Public License for more details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to
-;; the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+;; along with GNU Emacs; see the file COPYING.  If not, write to the
+;; Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+;; Boston, MA 02111-1307, USA.
 
 ;;; Commentary:
 
 ;; This collection of functions implements the features of calendar.el and
 ;; diary.el that deal with the Hebrew calendar.
 
+;; Technical details of all the calendrical calculations can be found in
+;; ``Calendrical Calculations'' by Nachum Dershowitz and Edward M. Reingold,
+;; Cambridge University Press (1997).
+
 ;; Comments, corrections, and improvements should be sent to
 ;;  Edward M. Reingold               Department of Computer Science
 ;;  (217) 333-6733                   University of Illinois at Urbana-Champaign
@@ -318,7 +323,7 @@ nil if it is not visible in the current calendar window."
                     (calendar-dayname-on-or-before 6 (- abs-r-h 4)))
                    "Selichot (night)")
              (list (calendar-gregorian-from-absolute (1- abs-r-h))
-                   "Erev Rosh HaShannah")
+                   "Erev Rosh HaShanah")
              (list (calendar-gregorian-from-absolute (1+ abs-r-h))
                    "Rosh HaShanah (second day)")
              (list (calendar-gregorian-from-absolute
@@ -440,7 +445,10 @@ nil if it is not visible in the current calendar window."
                    "Passover (seventh day)")
              (list (calendar-gregorian-from-absolute (+ abs-p 7))
                    "Passover (eighth day)")
-             (list (calendar-gregorian-from-absolute (+ abs-p 12))
+             (list (calendar-gregorian-from-absolute
+                    (if (zerop (% (+ abs-p 12) 7))
+                        (+ abs-p 13)
+                      (+ abs-p 12)))
                    "Yom HaShoah")
              (list (calendar-gregorian-from-absolute
                     (if (zerop (% abs-p 7))
@@ -452,7 +460,7 @@ nil if it is not visible in the current calendar window."
              (list (calendar-gregorian-from-absolute (+ abs-p 33))
                    "Lag BaOmer")
              (list (calendar-gregorian-from-absolute (+ abs-p 43))
-                   "Yom Yerushalim")
+                   "Yom Yerushalaim")
              (list (calendar-gregorian-from-absolute (+ abs-p 49))
                    "Erev Shavuot")
              (list (calendar-gregorian-from-absolute (+ abs-p 51))
@@ -564,7 +572,10 @@ not be marked in the calendar.  This function is provided for use with the
                        (backward-char 1)
                        (subst-char-in-region date-start (point) ?\^M ?\n t)
                        (add-to-diary-list
-                         gdate (buffer-substring entry-start (point)))))))
+                        gdate
+                        (buffer-substring-no-properties entry-start (point))
+                        (buffer-substring-no-properties
+                         (1+ date-start) (1- entry-start)))))))
                (setq d (cdr d))))
            (setq gdate
                  (calendar-gregorian-from-absolute
@@ -1001,12 +1012,12 @@ Entry applies if date is Rosh Hodesh, the day before, or the Saturday before."
         (let*
             ((h-year (extract-calendar-year
                       (calendar-hebrew-from-absolute d)))
-             (rosh-hashannah
+             (rosh-hashanah
               (calendar-absolute-from-hebrew (list 7 1 h-year)))
              (passover
               (calendar-absolute-from-hebrew (list 1 15 h-year)))
-             (rosh-hashannah-day
-              (aref calendar-day-name-array (% rosh-hashannah 7)))
+             (rosh-hashanah-day
+              (aref calendar-day-name-array (% rosh-hashanah 7)))
              (passover-day
               (aref calendar-day-name-array (% passover 7)))
              (long-h (hebrew-calendar-long-heshvan-p h-year))
@@ -1017,9 +1028,9 @@ Entry applies if date is Rosh Hodesh, the day before, or the Saturday before."
              (year-format
               (symbol-value
                (intern (format "hebrew-calendar-year-%s-%s-%s";; keviah
-                               rosh-hashannah-day type passover-day))))
+                               rosh-hashanah-day type passover-day))))
              (first-saturday;; of Hebrew year
-              (calendar-dayname-on-or-before 6 (+ 6 rosh-hashannah)))
+              (calendar-dayname-on-or-before 6 (+ 6 rosh-hashanah)))
              (saturday;; which Saturday of the Hebrew year
               (/ (- d first-saturday) 7))
              (parasha (aref year-format saturday)))