diff options
| author | Glenn Morris | 2009-09-02 03:22:58 +0000 |
|---|---|---|
| committer | Glenn Morris | 2009-09-02 03:22:58 +0000 |
| commit | 697c7714ce12e42fe4f3b1274ac4caa8e4afa74b (patch) | |
| tree | b0f14c3f427e8d454eb23b3a2b6f81bfc00833fb | |
| parent | ed4ba8dfc41c4906185f3496f248ece64117daf1 (diff) | |
| download | emacs-697c7714ce12e42fe4f3b1274ac4caa8e4afa74b.tar.gz emacs-697c7714ce12e42fe4f3b1274ac4caa8e4afa74b.zip | |
(time-to-seconds): In Emacs, make it an obsolete alias for float-time.
(time-to-number-of-days): In Emacs, use float-time.
| -rw-r--r-- | lisp/ChangeLog | 9 | ||||
| -rw-r--r-- | lisp/calendar/time-date.el | 26 |
2 files changed, 26 insertions, 9 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 051f09442d5..72ffb0d0de5 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,5 +1,14 @@ | |||
| 1 | 2009-09-02 Glenn Morris <rgm@gnu.org> | 1 | 2009-09-02 Glenn Morris <rgm@gnu.org> |
| 2 | 2 | ||
| 3 | * calendar/time-date.el (time-to-seconds): In Emacs, make it an obsolete | ||
| 4 | alias for float-time. | ||
| 5 | (time-to-number-of-days): In Emacs, use float-time. | ||
| 6 | * net/newst-backend.el (time-add): Suppress warnings from compat | ||
| 7 | function. | ||
| 8 | * time.el (emacs-uptime, emacs-init-time): | ||
| 9 | * net/rcirc.el (rcirc-keepalive, rcirc-handler-ctcp-KEEPALIVE): | ||
| 10 | Use float-time rather than time-to-seconds. | ||
| 11 | |||
| 3 | * minibuffer.el (completion-initials-expand): Fix typo. | 12 | * minibuffer.el (completion-initials-expand): Fix typo. |
| 4 | 13 | ||
| 5 | * faces.el (modeline, modeline-inactive, modeline-highlight) | 14 | * faces.el (modeline, modeline-inactive, modeline-highlight) |
diff --git a/lisp/calendar/time-date.el b/lisp/calendar/time-date.el index 3478f9646ea..4521398d2d4 100644 --- a/lisp/calendar/time-date.el +++ b/lisp/calendar/time-date.el | |||
| @@ -111,14 +111,20 @@ and type 2 is the list (HIGH LOW MICRO)." | |||
| 111 | (timezone-make-date-arpa-standard date))) | 111 | (timezone-make-date-arpa-standard date))) |
| 112 | (error (error "Invalid date: %s" date)))) | 112 | (error (error "Invalid date: %s" date)))) |
| 113 | 113 | ||
| 114 | ;;;###autoload | 114 | ;; Bit of a mess. Emacs has float-time since at least 21.1. |
| 115 | (defun time-to-seconds (time) | 115 | ;; This file is synced to Gnus, and XEmacs packages may have been written |
| 116 | "Convert time value TIME to a floating point number. | 116 | ;; using time-to-seconds from the Gnus library. |
| 117 | You can use `float-time' instead." | 117 | ;;;###autoload(if (featurep 'xemacs) |
| 118 | (with-decoded-time-value ((high low micro time)) | 118 | ;;;###autoload (autoload 'time-to-seconds "time-date") |
| 119 | (+ (* 1.0 high 65536) | 119 | ;;;###autoload (define-obsolete-function-alias 'time-to-seconds 'float-time "21.1")) |
| 120 | low | 120 | |
| 121 | (/ micro 1000000.0)))) | 121 | (if (featurep 'xemacs) |
| 122 | (defun time-to-seconds (time) | ||
| 123 | "Convert time value TIME to a floating point number." | ||
| 124 | (with-decoded-time-value ((high low micro time)) | ||
| 125 | (+ (* 1.0 high 65536) | ||
| 126 | low | ||
| 127 | (/ micro 1000000.0))))) | ||
| 122 | 128 | ||
| 123 | ;;;###autoload | 129 | ;;;###autoload |
| 124 | (defun seconds-to-time (seconds) | 130 | (defun seconds-to-time (seconds) |
| @@ -245,7 +251,9 @@ The Gregorian date Sunday, December 31, 1bce is imaginary." | |||
| 245 | (defun time-to-number-of-days (time) | 251 | (defun time-to-number-of-days (time) |
| 246 | "Return the number of days represented by TIME. | 252 | "Return the number of days represented by TIME. |
| 247 | The number of days will be returned as a floating point number." | 253 | The number of days will be returned as a floating point number." |
| 248 | (/ (time-to-seconds time) (* 60 60 24))) | 254 | (/ (if (featurep 'xemacs) |
| 255 | (time-to-seconds time) | ||
| 256 | (float-time time)) (* 60 60 24))) | ||
| 249 | 257 | ||
| 250 | ;;;###autoload | 258 | ;;;###autoload |
| 251 | (defun safe-date-to-time (date) | 259 | (defun safe-date-to-time (date) |