From d53e3af1d4b502561f15860718fe5862ea6f41cf Mon Sep 17 00:00:00 2001 From: Glenn Morris Date: Sat, 29 Mar 2008 23:24:35 +0000 Subject: [PATCH] (holiday-julian): Simplify. --- lisp/ChangeLog | 5 +++++ lisp/calendar/cal-julian.el | 41 ++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 21 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 9f191d390ad..a9ed1bd869c 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,8 @@ +2008-03-29 Glenn Morris + + * calendar/cal-hebrew.el (holiday-hebrew): Simplify. + * calendar/cal-julian.el (holiday-julian): Simplify. + 2008-03-29 Juri Linkov * window.el (split-window-preferred-horizontally): New function. diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el index abe66a0e950..7cefe2538f4 100644 --- a/lisp/calendar/cal-julian.el +++ b/lisp/calendar/cal-julian.el @@ -142,27 +142,26 @@ Driven by the variable `calendar-date-display-form'." If MONTH, DAY (Julian) is visible, the value returned is corresponding Gregorian date in the form of the list (((month day year) STRING)). Returns nil if it is not visible in the current calendar window." - (let ((m1 displayed-month) - (y1 displayed-year) - (m2 displayed-month) - (y2 displayed-year) - (year)) - (increment-calendar-month m1 y1 -1) - (increment-calendar-month m2 y2 1) - (let* ((start-date (calendar-absolute-from-gregorian - (list m1 1 y1))) - (end-date (calendar-absolute-from-gregorian - (list m2 (calendar-last-day-of-month m2 y2) y2))) - (julian-start (calendar-julian-from-absolute start-date)) - (julian-end (calendar-julian-from-absolute end-date)) - (julian-y1 (extract-calendar-year julian-start)) - (julian-y2 (extract-calendar-year julian-end))) - (setq year (if (< 10 month) julian-y1 julian-y2)) - (let ((date (calendar-gregorian-from-absolute - (calendar-absolute-from-julian - (list month day year))))) - (if (calendar-date-is-visible-p date) - (list (list date string))))))) + (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)))) + (julian-start (calendar-julian-from-absolute start-date)) + (julian-end (calendar-julian-from-absolute end-date)) + (julian-y1 (extract-calendar-year julian-start)) + (julian-y2 (extract-calendar-year julian-end)) + (year (if (< 10 month) julian-y1 julian-y2)) + (date (calendar-gregorian-from-absolute + (calendar-absolute-from-julian (list month day year))))) + (if (calendar-date-is-visible-p date) + (list (list date string))))) ;;;###cal-autoload (defun calendar-absolute-from-astro (d) -- 2.39.2