changeset 5221:ac6846067766

Merge.
author Aidan Kehoe <kehoea@parhasard.net>
date Sun, 30 May 2010 15:16:07 +0100
parents 2d0937dc83cf (current diff) 2157ecaedc1d (diff)
children 18c0b5909d16
files lisp/ChangeLog
diffstat 2 files changed, 24 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun May 30 13:27:36 2010 +0100
+++ b/lisp/ChangeLog	Sun May 30 15:16:07 2010 +0100
@@ -37,6 +37,11 @@
 	byte-optimize-binary-predicate as its optimizer, as do the other
 	equality predicates.
 
+2010-05-30  Aidan Kehoe  <kehoea@parhasard.net>
+
+	* subr.el (float-time): Add this function, available in editfns.c
+	in GNU.
+
 2010-05-16  Aidan Kehoe  <kehoea@parhasard.net>
 
 	* files.el (default-file-system-ignore-case):
--- a/lisp/subr.el	Sun May 30 13:27:36 2010 +0100
+++ b/lisp/subr.el	Sun May 30 15:16:07 2010 +0100
@@ -1794,4 +1794,23 @@
   "Return t if (cdr A) is numerically less than (cdr B)."
   (< (cdr a) (cdr b)))
 
+;; XEmacs; this is in editfns.c in GNU.
+(defun float-time (&optional specified-time)
+  "Convert time value SPECIFIED-TIME to a floating point number.
+
+See `current-time'.  Since the result is a floating-point number, this may
+not have the same accuracy as does the result of `current-time'.
+
+If not supplied, SPECIFIED-TIME defaults to the result of `current-time'."
+  (or specified-time (setq specified-time (current-time)))
+  (+ (* (pop specified-time) (+ #x10000 0.0))
+     (if (consp specified-time)
+	 (pop specified-time)
+       (prog1
+	   specified-time
+	 (setq specified-time nil)))
+     (or (and specified-time
+	      (/ (car specified-time) 1000000.0))
+	 0.0)))
+
 ;;; subr.el ends here