emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/calendar/cal-hebrew.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/cal-hebrew.el,v
Date: Tue, 01 Apr 2008 02:54:29 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/04/01 02:54:29

Index: cal-hebrew.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/cal-hebrew.el,v
retrieving revision 1.53
retrieving revision 1.54
diff -u -b -r1.53 -r1.54
--- cal-hebrew.el       1 Apr 2008 02:45:47 -0000       1.53
+++ cal-hebrew.el       1 Apr 2008 02:54:29 -0000       1.54
@@ -266,7 +266,6 @@
   (or noecho (calendar-print-hebrew-date)))
 
 (defvar displayed-month)                ; from generate-calendar
-(defvar displayed-year)
 
 (defun calendar-hebrew-date-is-visible-p (month day)
   "Return non-nil if Hebrew MONTH DAY is visible in the calendar window.
@@ -302,30 +301,12 @@
              (if (<  9 month) (- month  9) (+ month 3))
              (if (<  8 month) (- month  8) (+ month 4))
              (if (<  7 month) (- month  7) (+ month 5))))
-      ;; This is the same as holiday-julian, except the test of which
-      ;; year to use is different.
-      (let* ((m1 displayed-month)
-             (y1 displayed-year)
-             (m2 displayed-month)
-             (y2 displayed-year)
-             (start-date (progn
-                           (increment-calendar-month m1 y1 -1)
-                           (calendar-absolute-from-gregorian (list m1 1 y1))))
-             (end-date (progn
-                         (increment-calendar-month m2 y2 1)
-                         (calendar-absolute-from-gregorian
-                          (list m2 (calendar-last-day-of-month m2 y2) y2))))
-             (hebrew-start (calendar-hebrew-from-absolute start-date))
-             (hebrew-end (calendar-hebrew-from-absolute end-date))
-             (hebrew-y1 (extract-calendar-year hebrew-start))
-             (hebrew-y2 (extract-calendar-year hebrew-end))
+      (calendar-nongregorian-visible-p
+       month day 'calendar-absolute-from-hebrew
+       'calendar-hebrew-from-absolute
              ;; Hebrew new year is start of month 7.
-             ;; If hmonth >= 7, choose the higher year, y2.
-             (year (if (< 6 month) hebrew-y2 hebrew-y1))
-             (date (calendar-gregorian-from-absolute
-                    (calendar-absolute-from-hebrew (list month day year)))))
-        (if (calendar-date-is-visible-p date)
-            date))))
+       ;; If hmonth >= 7, choose the higher year.
+       (lambda (m) (> m 6)))))
 
 ;;;###holiday-autoload
 (defun holiday-hebrew (month day string)
@@ -339,6 +320,8 @@
 ;; h-r-h-e should be called from holidays code.
 (declare-function holiday-filter-visible-calendar "holidays" (l))
 
+(defvar displayed-year)
+
 ;;;###holiday-autoload
 (defun holiday-rosh-hashanah-etc ()
   "List of dates related to Rosh Hashanah, as visible in calendar window."




reply via email to

[Prev in Thread] Current Thread [Next in Thread]