# HG changeset patch # User Aidan Kehoe # Date 1275228967 -3600 # Node ID ac684606776698a816c4b14566c68e3c0293ea33 # Parent 2d0937dc83cf90bf59867fab44ac43d841327ac2# Parent 2157ecaedc1dc4a6ae53954fd1f732b66b7b104f Merge. diff -r 2d0937dc83cf -r ac6846067766 lisp/ChangeLog --- 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 + + * subr.el (float-time): Add this function, available in editfns.c + in GNU. + 2010-05-16 Aidan Kehoe * files.el (default-file-system-ignore-case): diff -r 2d0937dc83cf -r ac6846067766 lisp/subr.el --- 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