Mercurial > emacs
changeset 93410:1a690de051ab
(holiday-julian): Simplify.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 29 Mar 2008 23:23:44 +0000 |
parents | b705f66a40fc |
children | 2e939b95b436 |
files | lisp/calendar/cal-julian.el |
diffstat | 1 files changed, 20 insertions(+), 21 deletions(-) [+] |
line wrap: on
line diff
--- a/lisp/calendar/cal-julian.el Sat Mar 29 23:23:20 2008 +0000 +++ b/lisp/calendar/cal-julian.el Sat Mar 29 23:23:44 2008 +0000 @@ -142,27 +142,26 @@ 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)