Mercurial > emacs
comparison lisp/calendar/solar.el @ 93749:a67be3023573
(diary-sabbath-candles-minutes, diary-sabbath-candles): Move to cal-hebrew.
author | Glenn Morris <rgm@gnu.org> |
---|---|
date | Sat, 05 Apr 2008 21:23:43 +0000 |
parents | 8a8d2922328b |
children | 047187066e1d |
comparison
equal
deleted
inserted
replaced
93748:e21ebdb02185 | 93749:a67be3023573 |
---|---|
146 `solar-ecliptic-coordinates') in degrees since (delta/360) x (86400/60) = 4 x | 146 `solar-ecliptic-coordinates') in degrees since (delta/360) x (86400/60) = 4 x |
147 delta. At present, delta = 0.01 degrees, so the value of the variable | 147 delta. At present, delta = 0.01 degrees, so the value of the variable |
148 `solar-error' should be at least 0.04 minutes (about 2.5 seconds)." | 148 `solar-error' should be at least 0.04 minutes (about 2.5 seconds)." |
149 :type 'number | 149 :type 'number |
150 :group 'calendar) | 150 :group 'calendar) |
151 | |
152 (defcustom diary-sabbath-candles-minutes 18 | |
153 "Number of minutes before sunset for sabbath candle lighting." | |
154 :group 'diary | |
155 :type 'integer | |
156 :version "21.1") | |
157 | |
158 | 151 |
159 ;;; End of user options. | 152 ;;; End of user options. |
160 | 153 |
161 | 154 |
162 (defconst solar-n-hemi-seasons | 155 (defconst solar-n-hemi-seasons |
881 Accurate to a few seconds." | 874 Accurate to a few seconds." |
882 (or (and calendar-latitude calendar-longitude calendar-time-zone) | 875 (or (and calendar-latitude calendar-longitude calendar-time-zone) |
883 (solar-setup)) | 876 (solar-setup)) |
884 (solar-sunrise-sunset-string date)) | 877 (solar-sunrise-sunset-string date)) |
885 | 878 |
886 ;; To be called from list-sexp-diary-entries, where DATE is bound. | |
887 ;;;###diary-autoload | |
888 (defun diary-sabbath-candles (&optional mark) | |
889 "Local time of candle lighting diary entry--applies if date is a Friday. | |
890 No diary entry if there is no sunset on that date. | |
891 | |
892 An optional parameter MARK specifies a face or single-character string to | |
893 use when highlighting the day in the calendar." | |
894 (or (and calendar-latitude calendar-longitude calendar-time-zone) | |
895 (solar-setup)) | |
896 (if (= (% (calendar-absolute-from-gregorian date) 7) 5) ; Friday | |
897 (let* ((sunset (cadr (solar-sunrise-sunset date))) | |
898 (light (if sunset | |
899 (cons (- (car sunset) | |
900 (/ diary-sabbath-candles-minutes 60.0)) | |
901 (cdr sunset))))) | |
902 (if sunset | |
903 (cons mark | |
904 (format "%s Sabbath candle lighting" | |
905 (apply 'solar-time-string light))))))) | |
906 | |
907 ;; From Meeus, 1991, page 167. | 879 ;; From Meeus, 1991, page 167. |
908 (defconst solar-seasons-data | 880 (defconst solar-seasons-data |
909 '((485 324.96 1934.136) | 881 '((485 324.96 1934.136) |
910 (203 337.23 32964.467) | 882 (203 337.23 32964.467) |
911 (199 342.08 20.186) | 883 (199 342.08 20.186) |