]> code.delx.au - gnu-emacs/commitdiff
(time-to-seconds): In Emacs, make it an obsolete alias for float-time.
authorGlenn Morris <rgm@gnu.org>
Wed, 2 Sep 2009 03:22:58 +0000 (03:22 +0000)
committerGlenn Morris <rgm@gnu.org>
Wed, 2 Sep 2009 03:22:58 +0000 (03:22 +0000)
(time-to-number-of-days): In Emacs, use float-time.

lisp/ChangeLog
lisp/calendar/time-date.el

index 051f09442d579ec135fefb1fd2f38d4fe091f19e..72ffb0d0de5055336540cf7b43c1dd7d192b5c60 100644 (file)
@@ -1,5 +1,14 @@
 2009-09-02  Glenn Morris  <rgm@gnu.org>
 
+       * calendar/time-date.el (time-to-seconds): In Emacs, make it an obsolete
+       alias for float-time.
+       (time-to-number-of-days): In Emacs, use float-time.
+       * net/newst-backend.el (time-add): Suppress warnings from compat
+       function.
+       * time.el (emacs-uptime, emacs-init-time):
+       * net/rcirc.el (rcirc-keepalive, rcirc-handler-ctcp-KEEPALIVE):
+       Use float-time rather than time-to-seconds.
+
        * minibuffer.el (completion-initials-expand): Fix typo.
 
        * faces.el (modeline, modeline-inactive, modeline-highlight)
index 3478f9646ea0e1cf3089faa839e7729d527bc75d..4521398d2d43228ce91aa800ac39634fe42b45df 100644 (file)
@@ -111,14 +111,20 @@ and type 2 is the list (HIGH LOW MICRO)."
              (timezone-make-date-arpa-standard date)))
     (error (error "Invalid date: %s" date))))
 
-;;;###autoload
-(defun time-to-seconds (time)
-  "Convert time value TIME to a floating point number.
-You can use `float-time' instead."
-  (with-decoded-time-value ((high low micro time))
-    (+ (* 1.0 high 65536)
-       low
-       (/ micro 1000000.0))))
+;; Bit of a mess.  Emacs has float-time since at least 21.1.
+;; This file is synced to Gnus, and XEmacs packages may have been written
+;; using time-to-seconds from the Gnus library.
+;;;###autoload(if (featurep 'xemacs)
+;;;###autoload     (autoload 'time-to-seconds "time-date")
+;;;###autoload   (define-obsolete-function-alias 'time-to-seconds 'float-time "21.1"))
+
+(if (featurep 'xemacs)
+    (defun time-to-seconds (time)
+      "Convert time value TIME to a floating point number."
+      (with-decoded-time-value ((high low micro time))
+        (+ (* 1.0 high 65536)
+           low
+           (/ micro 1000000.0)))))
 
 ;;;###autoload
 (defun seconds-to-time (seconds)
@@ -245,7 +251,9 @@ The Gregorian date Sunday, December 31, 1bce is imaginary."
 (defun time-to-number-of-days (time)
   "Return the number of days represented by TIME.
 The number of days will be returned as a floating point number."
-  (/ (time-to-seconds time) (* 60 60 24)))
+  (/ (if (featurep 'xemacs)
+         (time-to-seconds time)
+       (float-time time)) (* 60 60 24)))
 
 ;;;###autoload
 (defun safe-date-to-time (date)