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-julian.el,v


From: Glenn Morris
Subject: [Emacs-diffs] Changes to emacs/lisp/calendar/cal-julian.el,v
Date: Thu, 13 Mar 2008 03:55:16 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Glenn Morris <gm>       08/03/13 03:55:15

Index: cal-julian.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/cal-julian.el,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -b -r1.23 -r1.24
--- cal-julian.el       8 Mar 2008 04:21:13 -0000       1.23
+++ cal-julian.el       13 Mar 2008 03:55:15 -0000      1.24
@@ -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 @@
        (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,6 +133,9 @@
                        (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.
 If MONTH, DAY (Julian) is visible, the value returned is corresponding
@@ -192,7 +192,7 @@
 
 ;;;###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"




reply via email to

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