diff options
author | Glenn Morris <rgm@gnu.org> | 2008-03-15 02:55:06 +0000 |
---|---|---|
committer | Glenn Morris <rgm@gnu.org> | 2008-03-15 02:55:06 +0000 |
commit | 48dc6f9fd27f5dab4aa6a1b432094292f318f558 (patch) | |
tree | 7ed20f7c23628259206dfdfba7ba7bcbcc723009 /lisp/calendar/solar.el | |
parent | 55dfee43facff24606e565cb3eb816311fe7f26d (diff) | |
download | emacs-48dc6f9fd27f5dab4aa6a1b432094292f318f558.tar.gz |
(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.
Diffstat (limited to 'lisp/calendar/solar.el')
-rw-r--r-- | lisp/calendar/solar.el | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index 78071bb5db8..ed3c5a9074c 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el @@ -166,11 +166,11 @@ delta. At present, delta = 0.01 degrees, so the value of the variable ;;; 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 @@ Corresponding value is nil if there is no sunrise/sunset." (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 @@ This function is suitable for execution in a .emacs file." "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 @@ Accurate to within a minute between 1951 and 2050." (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 |