From: Glenn Morris Date: Thu, 13 Mar 2008 03:55:15 +0000 (+0000) Subject: Re-format comments. X-Git-Tag: emacs-pretest-23.0.90~7219 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=863ad01b09b51e2047643ef83c03e32a83612e12;p=emacs.git Re-format comments. (calendar-julian-from-absolute): Use xerop. (displayed-month, displayed-year): Move declarations where needed. (calendar-print-astro-day-number): Doc fix. --- diff --git a/lisp/calendar/cal-julian.el b/lisp/calendar/cal-julian.el index d8752cb03a7..36cff188755 100644 --- a/lisp/calendar/cal-julian.el +++ b/lisp/calendar/cal-julian.el @@ -36,9 +36,6 @@ ;;; Code: -(defvar displayed-month) -(defvar displayed-year) - (require 'calendar) ;;;###autoload @@ -46,24 +43,24 @@ "Compute the Julian (month day year) corresponding to the absolute DATE. The absolute date is the number of days elapsed since the (imaginary) Gregorian date Sunday, December 31, 1 BC." - (let* ((approx (/ (+ date 2) 366));; Approximation from below. - (year ;; Search forward from the approximation. + (let* ((approx (/ (+ date 2) 366)) ; approximation from below + (year ; search forward from the approximation (+ approx (calendar-sum y approx (>= date (calendar-absolute-from-julian (list 1 1 (1+ y)))) 1))) - (month ;; Search forward from January. + (month ; search forward from January (1+ (calendar-sum m 1 (> date (calendar-absolute-from-julian (list m - (if (and (= m 2) (= (% year 4) 0)) + (if (and (= m 2) (zerop (% year 4))) 29 (aref [31 28 31 30 31 30 31 31 30 31 30 31] (1- m))) year))) 1))) - (day ;; Calculate the day by subtraction. + (day ; calculate the day by subtraction (- date (1- (calendar-absolute-from-julian (list month 1 year)))))) (list month day year))) @@ -77,7 +74,7 @@ The Gregorian date Sunday, December 31, 1 BC is imaginary." (if (and (zerop (% year 100)) (/= (% year 400) 0) (> month 2)) - 1 0);; Correct for Julian but not Gregorian leap year. + 1 0) ; correct for Julian but not Gregorian leap year (* 365 (1- year)) (/ (1- year) 4) -2))) @@ -136,8 +133,11 @@ Driven by the variable `calendar-date-display-form'." (calendar-absolute-from-julian date))) (or noecho (calendar-print-julian-date))) +(defvar displayed-month) +(defvar displayed-year) + (defun holiday-julian (month day string) - "Holiday on MONTH, DAY (Julian) called STRING. + "Holiday on MONTH, DAY (Julian) called STRING. 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." @@ -192,7 +192,7 @@ Defaults to today's date if DATE is not given." ;;;###autoload (defun calendar-print-astro-day-number () - "Show astronomical (Julian) day number after noon UTC on date shown by cursor." + "Show astronomical (Julian) day number after noon UTC on cursor date." (interactive) (message "Astronomical (Julian) day number (at noon UTC): %s.0"