]> git.eshelyaron.com Git - emacs.git/commitdiff
(holiday-julian): Simplify.
authorGlenn Morris <rgm@gnu.org>
Sat, 29 Mar 2008 23:24:35 +0000 (23:24 +0000)
committerGlenn Morris <rgm@gnu.org>
Sat, 29 Mar 2008 23:24:35 +0000 (23:24 +0000)
lisp/ChangeLog
lisp/calendar/cal-julian.el

index 9f191d390adca7823c08de4be34f7d33f9fbe372..a9ed1bd869c2d5ee784ab55e72e97dd922b94225 100644 (file)
@@ -1,3 +1,8 @@
+2008-03-29  Glenn Morris  <rgm@gnu.org>
+
+       * calendar/cal-hebrew.el (holiday-hebrew): Simplify.
+       * calendar/cal-julian.el (holiday-julian): Simplify.
+
 2008-03-29  Juri Linkov  <juri@jurta.org>
 
        * window.el (split-window-preferred-horizontally): New function.
index abe66a0e950a4f5be09a8c14ab191af2484e3a32..7cefe2538f4431571d15077e7c0bf69df9a098ef 100644 (file)
@@ -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)