comparison lisp/calendar/timeclock.el @ 111457:8309f15b2534

time-to-seconds related simplifications. * lisp/gnus/gnus-util.el (with-no-warnings): Remove compat stub, now unused. (gnus-float-time): On Emacs, always an alias. * lisp/gnus/ecomplete.el (with-no-warnings): Remove compat stub, now unused. (ecomplete-add-item): Use float-time on Emacs, else gnus-float-time. * lisp/textmodes/remember.el (remember-time-to-seconds): Remove. (remember-store-in-mailbox): Use float-time. * lisp/calendar/timeclock.el (timeclock-time-to-seconds): Make it an alias. * lisp/calendar/time-date.el (time-to-seconds): Always an alias on Emacs, never a real function. (with-no-warnings): Remove compat stub, now unused. (time-less-p): Doc fix. (time-to-number-of-days): Simplify.
author Glenn Morris <rgm@gnu.org>
date Tue, 09 Nov 2010 20:08:15 -0800
parents 1d1d5d9bd884
children 417b1e4d63cd
comparison
equal deleted inserted replaced
111456:646142bd4c38 111457:8309f15b2534
541 show-seconds))) 541 show-seconds)))
542 (if (called-interactively-p 'interactive) 542 (if (called-interactively-p 'interactive)
543 (message "%s" string) 543 (message "%s" string)
544 string))) 544 string)))
545 545
546 (defsubst timeclock-time-to-seconds (time) 546 (defalias 'timeclock-time-to-seconds (if (fboundp 'float-time) 'float-time
547 "Convert TIME to a floating point number." 547 'time-to-seconds))
548 (+ (* (car time) 65536.0)
549 (cadr time)
550 (/ (or (nth 2 time) 0) 1000000.0)))
551 548
552 (defsubst timeclock-seconds-to-time (seconds) 549 (defsubst timeclock-seconds-to-time (seconds)
553 "Convert SECONDS (a floating point number) to an Emacs time structure." 550 "Convert SECONDS (a floating point number) to an Emacs time structure."
554 (list (floor seconds 65536) 551 (list (floor seconds 65536)
555 (floor (mod seconds 65536)) 552 (floor (mod seconds 65536))
1417 ;; make sure we know the list of reasons, projects, and have computed 1414 ;; make sure we know the list of reasons, projects, and have computed
1418 ;; the last event and current discrepancy. 1415 ;; the last event and current discrepancy.
1419 (if (file-readable-p timeclock-file) 1416 (if (file-readable-p timeclock-file)
1420 (timeclock-reread-log)) 1417 (timeclock-reread-log))
1421 1418
1422 ;; arch-tag: a0be3377-deb6-44ec-b9a2-a7be28436a40
1423 ;;; timeclock.el ends here 1419 ;;; timeclock.el ends here