diff options
| author | Glenn Morris | 2008-03-20 04:52:19 +0000 |
|---|---|---|
| committer | Glenn Morris | 2008-03-20 04:52:19 +0000 |
| commit | 7d17537facac9f953add8d002135e47008e7b1bc (patch) | |
| tree | 817a7d80838a06af1d84306c4c059f3fb8d52dc3 | |
| parent | f328a783dc97b33007a6ccf138b6ee73c9c927a2 (diff) | |
| download | emacs-7d17537facac9f953add8d002135e47008e7b1bc.tar.gz emacs-7d17537facac9f953add8d002135e47008e7b1bc.zip | |
(calendar-location-name, calendar-latitude)
(calendar-longitude, solar-arctan, sunrise-sunset)
(solar-mean-equinoxes/solstices): Use the appropriate equality test.
| -rw-r--r-- | lisp/ChangeLog | 27 | ||||
| -rw-r--r-- | lisp/calendar/solar.el | 100 |
2 files changed, 77 insertions, 50 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 6cf03d8c642..8cbec501745 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,30 @@ | |||
| 1 | 2008-03-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * calendar/calendar.el (calendar-other-dates): New function. | ||
| 4 | (calendar-print-other-dates): Use calendar-other-dates. | ||
| 5 | * calendar/cal-menu.el (calendar-other-dates): Declare it, and removes | ||
| 6 | the declarations it replaces. | ||
| 7 | (calendar-mouse-print-dates): Use calendar-other-dates. | ||
| 8 | |||
| 9 | * calendar/cal-bahai.el (calendar-bahai-leap-year-p) | ||
| 10 | (calendar-bahai-leap-base, calendar-bahai-from-absolute): Doc fixes. | ||
| 11 | (calendar-absolute-from-bahai): Fix the leap-year case. | ||
| 12 | (calendar-bahai-from-absolute): Re-use the Gregorian month. | ||
| 13 | (calendar-bahai-date-string, calendar-bahai-print-date): Handle | ||
| 14 | pre-Bahai dates. | ||
| 15 | |||
| 16 | * calendar/cal-china.el (chinese-calendar-celestial-stem) | ||
| 17 | (chinese-calendar-terrestrial-branch): Make defcustoms. | ||
| 18 | |||
| 19 | * calendar/cal-menu.el (calendar-mouse-holidays): Re-use the title. | ||
| 20 | (calendar-mouse-view-diary-entries): Use or. | ||
| 21 | (calendar-mouse-chinese-date): Remove unused command. | ||
| 22 | (cal-menu-load-hook): Mark as obsolete. | ||
| 23 | |||
| 24 | * calendar/solar.el (calendar-location-name, calendar-latitude) | ||
| 25 | (calendar-longitude, solar-arctan, sunrise-sunset) | ||
| 26 | (solar-mean-equinoxes/solstices): Use the appropriate equality test. | ||
| 27 | |||
| 1 | 2008-03-20 Jay Belanger <jay.p.belanger@gmail.com> | 28 | 2008-03-20 Jay Belanger <jay.p.belanger@gmail.com> |
| 2 | 29 | ||
| 3 | * calc/calc.el: Remove outdated comments. | 30 | * calc/calc.el: Remove outdated comments. |
diff --git a/lisp/calendar/solar.el b/lisp/calendar/solar.el index 8fbdcada787..3bc5d091c03 100644 --- a/lisp/calendar/solar.el +++ b/lisp/calendar/solar.el | |||
| @@ -125,14 +125,14 @@ This variable should be set in `site-start'.el." | |||
| 125 | (/ (aref calendar-latitude 1) 60.0))) | 125 | (/ (aref calendar-latitude 1) 60.0))) |
| 126 | (if (numberp calendar-latitude) | 126 | (if (numberp calendar-latitude) |
| 127 | (if (> calendar-latitude 0) "N" "S") | 127 | (if (> calendar-latitude 0) "N" "S") |
| 128 | (if (equal (aref calendar-latitude 2) 'north) "N" "S")) | 128 | (if (eq (aref calendar-latitude 2) 'north) "N" "S")) |
| 129 | (if (numberp calendar-longitude) | 129 | (if (numberp calendar-longitude) |
| 130 | (abs calendar-longitude) | 130 | (abs calendar-longitude) |
| 131 | (+ (aref calendar-longitude 0) | 131 | (+ (aref calendar-longitude 0) |
| 132 | (/ (aref calendar-longitude 1) 60.0))) | 132 | (/ (aref calendar-longitude 1) 60.0))) |
| 133 | (if (numberp calendar-longitude) | 133 | (if (numberp calendar-longitude) |
| 134 | (if (> calendar-longitude 0) "E" "W") | 134 | (if (> calendar-longitude 0) "E" "W") |
| 135 | (if (equal (aref calendar-longitude 2) 'east) "E" "W")))) | 135 | (if (eq (aref calendar-longitude 2) 'east) "E" "W")))) |
| 136 | "Expression evaluating to the name of the calendar location. | 136 | "Expression evaluating to the name of the calendar location. |
| 137 | For example, \"New York City\". The default value is just the | 137 | For example, \"New York City\". The default value is just the |
| 138 | variable `calendar-latitude' paired with the variable `calendar-longitude'. | 138 | variable `calendar-latitude' paired with the variable `calendar-longitude'. |
| @@ -188,7 +188,7 @@ Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.") | |||
| 188 | calendar-latitude | 188 | calendar-latitude |
| 189 | (let ((lat (+ (aref calendar-latitude 0) | 189 | (let ((lat (+ (aref calendar-latitude 0) |
| 190 | (/ (aref calendar-latitude 1) 60.0)))) | 190 | (/ (aref calendar-latitude 1) 60.0)))) |
| 191 | (if (equal (aref calendar-latitude 2) 'north) | 191 | (if (eq (aref calendar-latitude 2) 'north) |
| 192 | lat | 192 | lat |
| 193 | (- lat))))) | 193 | (- lat))))) |
| 194 | 194 | ||
| @@ -198,7 +198,7 @@ Needed for polar areas, in order to know whether the day lasts 0 or 24 hours.") | |||
| 198 | calendar-longitude | 198 | calendar-longitude |
| 199 | (let ((long (+ (aref calendar-longitude 0) | 199 | (let ((long (+ (aref calendar-longitude 0) |
| 200 | (/ (aref calendar-longitude 1) 60.0)))) | 200 | (/ (aref calendar-longitude 1) 60.0)))) |
| 201 | (if (equal (aref calendar-longitude 2) 'east) | 201 | (if (eq (aref calendar-longitude 2) 'east) |
| 202 | long | 202 | long |
| 203 | (- long))))) | 203 | (- long))))) |
| 204 | 204 | ||
| @@ -251,10 +251,10 @@ Returns nil if nothing was entered." | |||
| 251 | (defun solar-arctan (x quad) | 251 | (defun solar-arctan (x quad) |
| 252 | "Arctangent of X in quadrant QUAD." | 252 | "Arctangent of X in quadrant QUAD." |
| 253 | (let ((deg (radians-to-degrees (atan x)))) | 253 | (let ((deg (radians-to-degrees (atan x)))) |
| 254 | (cond ((equal quad 2) (+ deg 180)) | 254 | (cond ((= quad 2) (+ deg 180)) |
| 255 | ((equal quad 3) (+ deg 180)) | 255 | ((= quad 3) (+ deg 180)) |
| 256 | ((equal quad 4) (+ deg 360)) | 256 | ((= quad 4) (+ deg 360)) |
| 257 | (t deg)))) | 257 | (t deg)))) |
| 258 | 258 | ||
| 259 | (defun solar-atn2 (x y) | 259 | (defun solar-atn2 (x y) |
| 260 | "Arctangent of point X, Y." | 260 | "Arctangent of point X, Y." |
| @@ -830,14 +830,14 @@ This function is suitable for execution in a .emacs file." | |||
| 830 | (/ (aref calendar-latitude 1) 60.0))) | 830 | (/ (aref calendar-latitude 1) 60.0))) |
| 831 | (if (numberp calendar-latitude) | 831 | (if (numberp calendar-latitude) |
| 832 | (if (> calendar-latitude 0) "N" "S") | 832 | (if (> calendar-latitude 0) "N" "S") |
| 833 | (if (equal (aref calendar-latitude 2) 'north) "N" "S")) | 833 | (if (eq (aref calendar-latitude 2) 'north) "N" "S")) |
| 834 | (if (numberp calendar-longitude) | 834 | (if (numberp calendar-longitude) |
| 835 | (abs calendar-longitude) | 835 | (abs calendar-longitude) |
| 836 | (+ (aref calendar-longitude 0) | 836 | (+ (aref calendar-longitude 0) |
| 837 | (/ (aref calendar-longitude 1) 60.0))) | 837 | (/ (aref calendar-longitude 1) 60.0))) |
| 838 | (if (numberp calendar-longitude) | 838 | (if (numberp calendar-longitude) |
| 839 | (if (> calendar-longitude 0) "E" "W") | 839 | (if (> calendar-longitude 0) "E" "W") |
| 840 | (if (equal (aref calendar-longitude 2) 'east) | 840 | (if (eq (aref calendar-longitude 2) 'east) |
| 841 | "E" "W")))))) | 841 | "E" "W")))))) |
| 842 | (calendar-standard-time-zone-name | 842 | (calendar-standard-time-zone-name |
| 843 | (if (< arg 16) calendar-standard-time-zone-name | 843 | (if (< arg 16) calendar-standard-time-zone-name |
| @@ -971,47 +971,47 @@ solstice. These formulae are only to be used between 1000 BC and 3000 AD." | |||
| 971 | (let ((y (/ year 1000.0)) | 971 | (let ((y (/ year 1000.0)) |
| 972 | (z (/ (- year 2000) 1000.0))) | 972 | (z (/ (- year 2000) 1000.0))) |
| 973 | (if (< year 1000) ; actually between -1000 and 1000 | 973 | (if (< year 1000) ; actually between -1000 and 1000 |
| 974 | (cond ((equal k 0) (+ 1721139.29189 | 974 | (cond ((= k 0) (+ 1721139.29189 |
| 975 | (* 365242.13740 y) | 975 | (* 365242.13740 y) |
| 976 | (* 0.06134 y y) | 976 | (* 0.06134 y y) |
| 977 | (* 0.00111 y y y) | 977 | (* 0.00111 y y y) |
| 978 | (* -0.00071 y y y y))) | 978 | (* -0.00071 y y y y))) |
| 979 | ((equal k 1) (+ 1721233.25401 | 979 | ((= k 1) (+ 1721233.25401 |
| 980 | (* 365241.72562 y) | 980 | (* 365241.72562 y) |
| 981 | (* -0.05323 y y) | 981 | (* -0.05323 y y) |
| 982 | (* 0.00907 y y y) | 982 | (* 0.00907 y y y) |
| 983 | (* 0.00025 y y y y))) | 983 | (* 0.00025 y y y y))) |
| 984 | ((equal k 2) (+ 1721325.70455 | 984 | ((= k 2) (+ 1721325.70455 |
| 985 | (* 365242.49558 y) | 985 | (* 365242.49558 y) |
| 986 | (* -0.11677 y y) | 986 | (* -0.11677 y y) |
| 987 | (* -0.00297 y y y) | 987 | (* -0.00297 y y y) |
| 988 | (* 0.00074 y y y y))) | 988 | (* 0.00074 y y y y))) |
| 989 | ((equal k 3) (+ 1721414.39987 | 989 | ((= k 3) (+ 1721414.39987 |
| 990 | (* 365242.88257 y) | 990 | (* 365242.88257 y) |
| 991 | (* -0.00769 y y) | 991 | (* -0.00769 y y) |
| 992 | (* -0.00933 y y y) | 992 | (* -0.00933 y y y) |
| 993 | (* -0.00006 y y y y)))) | 993 | (* -0.00006 y y y y)))) |
| 994 | ; actually between 1000 and 3000 | 994 | ; actually between 1000 and 3000 |
| 995 | (cond ((equal k 0) (+ 2451623.80984 | 995 | (cond ((= k 0) (+ 2451623.80984 |
| 996 | (* 365242.37404 z) | 996 | (* 365242.37404 z) |
| 997 | (* 0.05169 z z) | 997 | (* 0.05169 z z) |
| 998 | (* -0.00411 z z z) | 998 | (* -0.00411 z z z) |
| 999 | (* -0.00057 z z z z))) | 999 | (* -0.00057 z z z z))) |
| 1000 | ((equal k 1) (+ 2451716.56767 | 1000 | ((= k 1) (+ 2451716.56767 |
| 1001 | (* 365241.62603 z) | 1001 | (* 365241.62603 z) |
| 1002 | (* 0.00325 z z) | 1002 | (* 0.00325 z z) |
| 1003 | (* 0.00888 z z z) | 1003 | (* 0.00888 z z z) |
| 1004 | (* -0.00030 z z z z))) | 1004 | (* -0.00030 z z z z))) |
| 1005 | ((equal k 2) (+ 2451810.21715 | 1005 | ((= k 2) (+ 2451810.21715 |
| 1006 | (* 365242.01767 z) | 1006 | (* 365242.01767 z) |
| 1007 | (* -0.11575 z z) | 1007 | (* -0.11575 z z) |
| 1008 | (* 0.00337 z z z) | 1008 | (* 0.00337 z z z) |
| 1009 | (* 0.00078 z z z z))) | 1009 | (* 0.00078 z z z z))) |
| 1010 | ((equal k 3) (+ 2451900.05952 | 1010 | ((= k 3) (+ 2451900.05952 |
| 1011 | (* 365242.74049 z) | 1011 | (* 365242.74049 z) |
| 1012 | (* -0.06223 z z) | 1012 | (* -0.06223 z z) |
| 1013 | (* -0.00823 z z z) | 1013 | (* -0.00823 z z z) |
| 1014 | (* 0.00032 z z z z))))))) | 1014 | (* 0.00032 z z z z))))))) |
| 1015 | 1015 | ||
| 1016 | (defvar displayed-month) ; from generate-calendar | 1016 | (defvar displayed-month) ; from generate-calendar |
| 1017 | (defvar displayed-year) | 1017 | (defvar displayed-year) |