aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2008-04-05 21:24:15 +0000
committerGlenn Morris2008-04-05 21:24:15 +0000
commit87e1e9cdfa80c3a7693ebfd1f131b3414793c7ce (patch)
treed596e016f1bd0bead7fb0bb794437530300f10b3
parent97f35570ad6e237166be67a17b1b29b4f310c914 (diff)
downloademacs-87e1e9cdfa80c3a7693ebfd1f131b3414793c7ce.tar.gz
emacs-87e1e9cdfa80c3a7693ebfd1f131b3414793c7ce.zip
(diary-hebrew-sabbath-candles-minutes, diary-hebrew-sabbath-candles):
Move here from solar.el and rename. Doc fix. Keep old name as alias. (solar-setup, solar-sunrise-sunset, calendar-latitude) (calendar-longitude, calendar-time-zone): Declare for compiler.
-rw-r--r--lisp/calendar/cal-hebrew.el48
1 files changed, 48 insertions, 0 deletions
diff --git a/lisp/calendar/cal-hebrew.el b/lisp/calendar/cal-hebrew.el
index 8374c9b2a8e..f98bb00ff46 100644
--- a/lisp/calendar/cal-hebrew.el
+++ b/lisp/calendar/cal-hebrew.el
@@ -34,6 +34,18 @@
34 34
35(require 'calendar) 35(require 'calendar)
36 36
37(defcustom diary-hebrew-sabbath-candles-minutes 18
38 "Number of minutes before sunset for sabbath candle lighting.
39Used by `diary-hebrew-sabbath-candles'."
40 :group 'diary
41 :type 'integer
42 :version "21.1")
43
44(define-obsolete-variable-alias 'diary-sabbath-candles-minutes
45 'diary-hebrew-sabbath-candles-minutes "23.1")
46
47;; End of user options.
48
37(defun calendar-hebrew-leap-year-p (year) 49(defun calendar-hebrew-leap-year-p (year)
38 "Non-nil if YEAR is a Hebrew calendar leap year." 50 "Non-nil if YEAR is a Hebrew calendar leap year."
39 (< (% (1+ (* 7 year)) 19) 7)) 51 (< (% (1+ (* 7 year)) 19) 7))
@@ -1112,6 +1124,42 @@ use when highlighting the day in the calendar."
1112 1124
1113(define-obsolete-function-alias 'diary-parasha 'diary-hebrew-parasha "23.1") 1125(define-obsolete-function-alias 'diary-parasha 'diary-hebrew-parasha "23.1")
1114 1126
1127
1128(declare-function solar-setup "solar" ())
1129(declare-function solar-sunrise-sunset "solar" (date))
1130(defvar calendar-latitude)
1131(defvar calendar-longitude)
1132(defvar calendar-time-zone)
1133
1134
1135;; To be called from list-sexp-diary-entries, where DATE is bound.
1136;;;###diary-autoload
1137(defun diary-hebrew-sabbath-candles (&optional mark)
1138 "Local time of candle lighting diary entry--applies if date is a Friday.
1139No diary entry if there is no sunset on that date. Uses
1140`diary-hebrew-sabbath-candles-minutes'.
1141
1142An optional parameter MARK specifies a face or single-character string to
1143use when highlighting the day in the calendar."
1144 (require 'solar)
1145 (or (and calendar-latitude calendar-longitude calendar-time-zone)
1146 (solar-setup))
1147 (if (= (% (calendar-absolute-from-gregorian date) 7) 5) ; Friday
1148 (let* ((sunset (cadr (solar-sunrise-sunset date)))
1149 (light (if sunset
1150 (cons (- (car sunset)
1151 (/ diary-hebrew-sabbath-candles-minutes 60.0))
1152 (cdr sunset)))))
1153 (if sunset
1154 (cons mark
1155 (format "%s Sabbath candle lighting"
1156 (apply 'solar-time-string light)))))))
1157
1158;;;###diary-autoload
1159(define-obsolete-function-alias 'diary-sabbath-candles
1160 'diary-hebrew-sabbath-candles "23.1")
1161
1162
1115(provide 'cal-hebrew) 1163(provide 'cal-hebrew)
1116 1164
1117;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c 1165;; arch-tag: aaab6718-7712-42ac-a32d-28fe1f944f3c