summaryrefslogtreecommitdiff
path: root/lisp/desktop.el
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2017-10-22 01:04:36 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2017-10-22 01:07:32 -0700
commit3aee7be62eaf8caef6f2fab31bee79674b3abbb7 (patch)
tree29226a5776f2ded9966138b98b5cef15b50ce463 /lisp/desktop.el
parent2bfa42855bf0278497f2e4540eac2086dab254c3 (diff)
downloademacs-3aee7be62eaf8caef6f2fab31bee79674b3abbb7.tar.gz
Avoid unnecessary rounding errors in timestamps
Avoid the rounding errors of float-time when it’s easy. E.g., replace (< (float-time a) (float-time b)) with (time-less-p a b). * lisp/desktop.el (desktop-save): * lisp/ecomplete.el (ecomplete-add-item): * lisp/epg.el (epg-wait-for-completion): * lisp/files.el (dir-locals-find-file, dir-locals-read-from-dir): * lisp/image-dired.el (image-dired-get-thumbnail-image) (image-dired-create-thumb-1): * lisp/info.el (info-insert-file-contents): * lisp/ls-lisp.el (ls-lisp-format-time): * lisp/net/ange-ftp.el (ange-ftp-file-newer-than-file-p) (ange-ftp-verify-visited-file-modtime): * lisp/net/rcirc.el (rcirc-ctcp-sender-PING): * lisp/textmodes/remember.el (remember-store-in-mailbox): * lisp/url/url-cookie.el (url-cookie-expired-p): Bypass float-time to avoid rounding errors. * lisp/files.el (dir-locals-find-file):
Diffstat (limited to 'lisp/desktop.el')
-rw-r--r--lisp/desktop.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/desktop.el b/lisp/desktop.el
index 73228ce040b..52cdbaf849d 100644
--- a/lisp/desktop.el
+++ b/lisp/desktop.el
@@ -1046,7 +1046,8 @@ without further confirmation."
(or (not new-modtime) ; nothing to overwrite
(equal desktop-file-modtime new-modtime)
(yes-or-no-p (if desktop-file-modtime
- (if (> (float-time new-modtime) (float-time desktop-file-modtime))
+ (if (time-less-p desktop-file-modtime
+ new-modtime)
"Desktop file is more recent than the one loaded. Save anyway? "
"Desktop file isn't the one loaded. Overwrite it? ")
"Current desktop was not loaded from a file. Overwrite this desktop file? "))