Mercurial > emacs
comparison lisp/calendar/solar.el @ 4766:ec8c8721b7e3
(s-hemi-seasons n-hemi-seasons): New constants are hemisphere
dependent list of season names. The names are "international"; i.e.,
`vernal' and `autumnal' are used consistently.
(solar-equinoxes-solstices): Use new constants, allowing southern
hemisphere reports to be meaningful.
(sunrise-sunset): Use `frame-width' instead of `screen-width'.
author | Brian Fox <bfox@gnu.org> |
---|---|
date | Tue, 21 Sep 1993 07:46:03 +0000 |
parents | 2516bc453477 |
children | adfd03a381ca |
comparison
equal
deleted
inserted
replaced
4765:5815d7b38e9a | 4766:ec8c8721b7e3 |
---|---|
102 (if (> calendar-latitude 0) "N" "S") | 102 (if (> calendar-latitude 0) "N" "S") |
103 (abs calendar-longitude) | 103 (abs calendar-longitude) |
104 (if (> calendar-longitude 0) "E" "W"))) | 104 (if (> calendar-longitude 0) "E" "W"))) |
105 "*Expression evaluating to name of `calendar-longitude', calendar-latitude'. | 105 "*Expression evaluating to name of `calendar-longitude', calendar-latitude'. |
106 Default value is just the latitude, longitude pair.") | 106 Default value is just the latitude, longitude pair.") |
107 | |
108 ;;; List of names of the seasons, dependent on your hemisphere. | |
109 (defconst n-hemi-seasons | |
110 '("Vernal Equinox" "Summer Solstice" "Autumnal Equinox" "Winter Solstice") | |
111 "List of season changes for the northern hemisphere.") | |
112 | |
113 (defconst s-hemi-seasons | |
114 '("Autumnal Equinox" "Winter Solstice" "Vernal Equinox" "Summer Solstice") | |
115 "List of season changes for the southern hemisphere.") | |
107 | 116 |
108 (defun solar-setup () | 117 (defun solar-setup () |
109 "Prompt user for latitude, longitude, and time zone." | 118 "Prompt user for latitude, longitude, and time zone." |
110 (beep) | 119 (beep) |
111 (if (not calendar-longitude) | 120 (if (not calendar-longitude) |
493 ;; Time zone/DST can't move the date out of range, | 502 ;; Time zone/DST can't move the date out of range, |
494 ;; so let solar-time-string do the conversion. | 503 ;; so let solar-time-string do the conversion. |
495 (date (list (extract-calendar-month date) | 504 (date (list (extract-calendar-month date) |
496 (truncate day) | 505 (truncate day) |
497 (extract-calendar-year date)))) | 506 (extract-calendar-year date)))) |
498 (list | 507 (list (list date |
499 (list date | 508 (format "%s %s" |
500 (format "%s %s" | 509 (nth k (if s-hemi s-hemi-seasons n-hemi-seasons)) |
501 (cond ((= k 0) | 510 (solar-time-string time date))))))) |
502 (if s-hemi "Autumnal Equinox" "Vernal Equinox")) | |
503 ((= k 1) | |
504 (if s-hemi "Winter Solstice" "Summer Solstice")) | |
505 ((= k 2) | |
506 (if s-hemi "Vernal Equinox" "Autumnal Equinox")) | |
507 ((= k 3) | |
508 (if s-hemi "Summer Solstice" "Winter Solstice"))) | |
509 (solar-time-string time date))))))) | |
510 | 511 |
511 (provide 'solar) | 512 (provide 'solar) |
512 | 513 |
513 ;;; solar.el ends here | 514 ;;; solar.el ends here |