changeset 92958:5700422f1364

(solar-n-hemi-seasons, solar-s-hemi-seasons): Make constants. (solar-sunrise-sunset): Rename some local variables for clarity. (sunrise-sunset): Use zerop. (solar-mean-equinoxes/solstices): Doc fix.
author Glenn Morris <rgm@gnu.org>
date Sat, 15 Mar 2008 02:55:06 +0000
parents c3b09ba22de9
children 1f109b306995
files lisp/calendar/solar.el
diffstat 1 files changed, 10 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/calendar/solar.el	Sat Mar 15 02:54:45 2008 +0000
+++ b/lisp/calendar/solar.el	Sat Mar 15 02:55:06 2008 +0000
@@ -166,11 +166,11 @@
 ;;; End of user options.
 
 
-(defvar solar-n-hemi-seasons
+(defconst solar-n-hemi-seasons
   '("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice")
   "List of season changes for the northern hemisphere.")
 
-(defvar solar-s-hemi-seasons
+(defconst solar-s-hemi-seasons
   '("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice")
   "List of season changes for the southern hemisphere.")
 
@@ -647,14 +647,14 @@
              (list t0 (cadr exact-local-noon))
              (calendar-latitude)
              (calendar-longitude) -0.61)))
-         (rise (car rise-set))
-         (adj-rise (if rise (dst-adjust-time date rise)))
-         (set (cadr rise-set))          ; FIXME ?
-         (adj-set (if set (dst-adjust-time date set)))
+         (rise-time (car rise-set))
+         (adj-rise (if rise-time (dst-adjust-time date rise-time)))
+         (set-time (cadr rise-set))
+         (adj-set (if set-time (dst-adjust-time date set-time)))
          (length (nth 2 rise-set)))
     (list
-     (and rise (calendar-date-equal date (car adj-rise)) (cdr adj-rise))
-     (and set (calendar-date-equal date (car adj-set)) (cdr adj-set))
+     (and rise-time (calendar-date-equal date (car adj-rise)) (cdr adj-rise))
+     (and set-time (calendar-date-equal date (car adj-set)) (cdr adj-set))
      (solar-daylight length))))
 
 (defun solar-sunrise-sunset-string (date)
@@ -842,7 +842,7 @@
                             "E" "W"))))))
          (calendar-standard-time-zone-name
           (if (< arg 16) calendar-standard-time-zone-name
-            (cond ((= calendar-time-zone 0) "UTC")
+            (cond ((zerop calendar-time-zone) "UTC")
                   ((< calendar-time-zone 0)
                    (format "UTC%dmin" calendar-time-zone))
                   (t  (format "UTC+%dmin" calendar-time-zone)))))
@@ -968,7 +968,7 @@
 (defun solar-mean-equinoxes/solstices (k year)
   "Julian day of mean equinox/solstice K for YEAR.
 K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter
-solstice.  These formulas are only to be used between 1000 BC and 3000 AD."
+solstice.  These formulae are only to be used between 1000 BC and 3000 AD."
   (let ((y (/ year 1000.0))
         (z (/ (- year 2000) 1000.0)))
     (if (< year 1000)                ; actually between -1000 and 1000