[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] emacs/lisp/calendar time-date.el
From: |
Glenn Morris |
Subject: |
[Emacs-diffs] emacs/lisp/calendar time-date.el |
Date: |
Wed, 02 Sep 2009 03:22:31 +0000 |
CVSROOT: /sources/emacs
Module name: emacs
Changes by: Glenn Morris <gm> 09/09/02 03:22:31
Modified files:
lisp/calendar : time-date.el
Log message:
(time-to-seconds): In Emacs, make it an obsolete alias for float-time.
(time-to-number-of-days): In Emacs, use float-time.
CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/emacs/lisp/calendar/time-date.el?cvsroot=emacs&r1=1.30&r2=1.31
Patches:
Index: time-date.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/calendar/time-date.el,v
retrieving revision 1.30
retrieving revision 1.31
diff -u -b -r1.30 -r1.31
--- time-date.el 9 Jan 2009 03:01:54 -0000 1.30
+++ time-date.el 2 Sep 2009 03:22:30 -0000 1.31
@@ -111,14 +111,20 @@
(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."
+;; 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))))
+ (/ micro 1000000.0)))))
;;;###autoload
(defun seconds-to-time (seconds)
@@ -245,7 +251,9 @@
(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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] emacs/lisp/calendar time-date.el,
Glenn Morris <=