]> code.delx.au - gnu-emacs/blobdiff - lisp/calendar/solar.el
Update copyright year to 2016
[gnu-emacs] / lisp / calendar / solar.el
index 84a1544d709220d7f9925897bcbd8812bc6343f4..eb64b770e861a9abdaccc13551ea8d71ba74e483 100644 (file)
@@ -1,7 +1,7 @@
 ;;; solar.el --- calendar functions for solar events
 
-;; Copyright (C) 1992-1993, 1995, 1997, 2001-2011
-;;   Free Software Foundation, Inc.
+;; Copyright (C) 1992-1993, 1995, 1997, 2001-2016 Free Software
+;; Foundation, Inc.
 
 ;; Author: Edward M. Reingold <reingold@cs.uiuc.edu>
 ;;         Denis B. Roegel <Denis.Roegel@loria.fr>
@@ -346,7 +346,7 @@ If SUNRISE-FLAG is non-nil, only calculate longitude and inclination."
                                    (solar-cosine-degrees (* 2 l)))
                                 (* -0.5 y y  (solar-sin-degrees (* 4 l)))
                                 (* -1.25 ecc ecc (solar-sin-degrees (* 2 m)))))
-                       3.1415926535))))
+                       float-pi))))
     (list app i time-eq nut)))
 
 (defun solar-ephemeris-correction (year)
@@ -657,7 +657,7 @@ Corresponding value is nil if there is no sunrise/sunset."
 Optional NOLOCATION non-nil means do not print the location."
   (let ((l (solar-sunrise-sunset date)))
     (format
-     "%s, %s%s (%s hours daylight)"
+     "%s, %s%s (%s hrs daylight)"
      (if (car l)
          (concat "Sunrise " (apply 'solar-time-string (car l)))
        "No sunrise")
@@ -797,7 +797,7 @@ If called with an optional prefix argument ARG, prompt for date.
 If called with an optional double prefix argument, prompt for
 longitude, latitude, time zone, and date, and always use standard time.
 
-This function is suitable for execution in a .emacs file."
+This function is suitable for execution in an init file."
   (interactive "p")
   (or arg (setq arg 1))
   (if (and (< arg 16)
@@ -847,20 +847,12 @@ This function is suitable for execution in a .emacs file."
          (date (if (< arg 4) (calendar-current-date) (calendar-read-date)))
          (date-string (calendar-date-string date t))
          (time-string (solar-sunrise-sunset-string date))
-         (msg (format "%s: %s" date-string time-string))
-         (one-window (one-window-p t)))
-    (if (<= (length msg) (frame-width))
-        (message "%s" msg)
-      (with-output-to-temp-buffer "*temp*"
-        (princ (concat date-string "\n" time-string)))
-      (message "%s"
-               (substitute-command-keys
-                (if one-window
-                    (if pop-up-windows
-                        "Type \\[delete-other-windows] to remove temp window."
-                      "Type \\[switch-to-buffer] RET to remove temp window.")
-                  "Type \\[switch-to-buffer-other-window] RET to restore old \
-contents of temp window."))))))
+         (msg (format "%s%s"
+                      (if (< arg 4) ""  ; don't print date if it's today's
+                        (format "%s: " date-string))
+                      time-string)))
+    (message "%s" msg)
+    msg))
 
 ;;;###cal-autoload
 (defun calendar-sunrise-sunset (&optional event)
@@ -962,7 +954,7 @@ Accurate to within a minute between 1951 and 2050."
 (defun solar-mean-equinoxes/solstices (k year)
   "Julian day of mean equinox/solstice K for YEAR.
 K=0, spring equinox; K=1, summer solstice; K=2, fall equinox; K=3, winter
-solstice.  These formulae are only to be used between 1000 BC and 3000 AD."
+solstice.  These formulas are only to be used between 1000 BC and 3000 AD."
   (let ((y (/ year 1000.0))
         (z (/ (- year 2000) 1000.0)))
     (if (< year 1000)                ; actually between -1000 and 1000