diff options
| author | Glenn Morris | 2008-03-15 02:55:06 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-15 02:55:06 +0000 |
| commit | 48dc6f9fd27f5dab4aa6a1b432094292f318f558 (patch) | |
| tree | 7ed20f7c23628259206dfdfba7ba7bcbcc723009 | |
| parent | 55dfee43facff24606e565cb3eb816311fe7f26d (diff) | |
| download | emacs-48dc6f9fd27f5dab4aa6a1b432094292f318f558.tar.gz emacs-48dc6f9fd27f5dab4aa6a1b432094292f318f558.zip | |
(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.
| -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 | |||
| 166 | ;;; End of user options. | 166 | ;;; End of user options. |
| 167 | 167 | ||
| 168 | 168 | ||
| 169 | (defvar solar-n-hemi-seasons | 169 | (defconst solar-n-hemi-seasons |
| 170 | '("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice") | 170 | '("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice") |
| 171 | "List of season changes for the northern hemisphere.") | 171 | "List of season changes for the northern hemisphere.") |
| 172 | 172 | ||
| 173 | (defvar solar-s-hemi-seasons | 173 | (defconst solar-s-hemi-seasons |
| 174 | '("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice") | 174 | '("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice") |
| 175 | "List of season changes for the southern hemisphere.") | 175 | "List of season changes for the southern hemisphere.") |
| 176 | 176 | ||
| @@ -647,14 +647,14 @@ Corresponding value is nil if there is no sunrise/sunset." | |||
| 647 | (list t0 (cadr exact-local-noon)) | 647 | (list t0 (cadr exact-local-noon)) |
| 648 | (calendar-latitude) | 648 | (calendar-latitude) |
| 649 | (calendar-longitude) -0.61))) | 649 | (calendar-longitude) -0.61))) |
| 650 | (rise (car rise-set)) | 650 | (rise-time (car rise-set)) |
| 651 | (adj-rise (if rise (dst-adjust-time date rise))) | 651 | (adj-rise (if rise-time (dst-adjust-time date rise-time))) |
| 652 | (set (cadr rise-set)) ; FIXME ? | 652 | (set-time (cadr rise-set)) |
| 653 | (adj-set (if set (dst-adjust-time date set))) | 653 | (adj-set (if set-time (dst-adjust-time date set-time))) |
| 654 | (length (nth 2 rise-set))) | 654 | (length (nth 2 rise-set))) |
| 655 | (list | 655 | (list |
| 656 | (and rise (calendar-date-equal date (car adj-rise)) (cdr adj-rise)) | 656 | (and rise-time (calendar-date-equal date (car adj-rise)) (cdr adj-rise)) |
| 657 | (and set (calendar-date-equal date (car adj-set)) (cdr adj-set)) | 657 | (and set-time (calendar-date-equal date (car adj-set)) (cdr adj-set)) |
| 658 | (solar-daylight length)))) | 658 | (solar-daylight length)))) |
| 659 | 659 | ||
| 660 | (defun solar-sunrise-sunset-string (date) | 660 | (defun solar-sunrise-sunset-string (date) |
| @@ -842,7 +842,7 @@ This function is suitable for execution in a .emacs file." | |||
| 842 | "E" "W")))))) | 842 | "E" "W")))))) |
| 843 | (calendar-standard-time-zone-name | 843 | (calendar-standard-time-zone-name |
| 844 | (if (< arg 16) calendar-standard-time-zone-name | 844 | (if (< arg 16) calendar-standard-time-zone-name |
| 845 | (cond ((= calendar-time-zone 0) "UTC") | 845 | (cond ((zerop calendar-time-zone) "UTC") |
| 846 | ((< calendar-time-zone 0) | 846 | ((< calendar-time-zone 0) |
| 847 | (format "UTC%dmin" calendar-time-zone)) | 847 | (format "UTC%dmin" calendar-time-zone)) |
| 848 | (t (format "UTC+%dmin" calendar-time-zone))))) | 848 | (t (format "UTC+%dmin" calendar-time-zone))))) |
| @@ -968,7 +968,7 @@ Accurate to within a minute between 1951 and 2050." | |||
| 968 | (defun solar-mean-equinoxes/solstices (k year) | 968 | (defun solar-mean-equinoxes/solstices (k year) |
| 969 | "Julian day of mean equinox/solstice K for YEAR. | 969 | "Julian day of mean equinox/solstice K for YEAR. |
| 970 | K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter | 970 | K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter |
| 971 | solstice. These formulas are only to be used between 1000 BC and 3000 AD." | 971 | solstice. These formulae are only to be used between 1000 BC and 3000 AD." |
| 972 | (let ((y (/ year 1000.0)) | 972 | (let ((y (/ year 1000.0)) |
| 973 | (z (/ (- year 2000) 1000.0))) | 973 | (z (/ (- year 2000) 1000.0))) |
| 974 | (if (< year 1000) ; actually between -1000 and 1000 | 974 | (if (< year 1000) ; actually between -1000 and 1000 |