This is more robust since timestamps can have multiple forms.
* lisp/auth-source.el (auth-source-netrc-parse):
* lisp/bookmark.el (bookmark--watch-file-already-queried-p)
(bookmark-maybe-load-default-file):
* lisp/cedet/semantic/db.el (semanticdb-needs-refresh-p):
* lisp/dired.el (dired-directory-changed-p):
* lisp/files.el (dir-locals-find-file):
* lisp/gnus/gnus-util.el (gnus-cache-file-contents):
* lisp/gnus/nneething.el (nneething-create-mapping):
* lisp/gnus/nnfolder.el (nnfolder-read-folder):
* lisp/gnus/nnmaildir.el (nnmaildir--update-nov)
(nnmaildir--scan, nnmaildir-request-scan)
(nnmaildir-request-update-info):
* lisp/gnus/nnmh.el (nnmh-update-gnus-unreads):
* lisp/gnus/spam-stat.el (spam-stat-load):
* lisp/mail/mailabbrev.el (mail-abbrevs-sync-aliases):
* lisp/mail/sendmail.el (sendmail-sync-aliases):
* lisp/net/netrc.el (netrc-parse):
* lisp/nxml/rng-loc.el (rng-get-parsed-schema-locating-file):
* lisp/play/cookie1.el (cookie-snarf):
* lisp/vc/vc-cvs.el (vc-cvs-state-heuristic):
* lisp/vc/vc-hg.el (vc-hg--ignore-patterns-valid-p)
(vc-hg--cached-dirstate-search):
* lisp/vc/vc-hooks.el (vc-after-save):
Prefer ‘time-equal-p’ to ‘equal’ when comparing
timestamps for equality.
result)
(if (and (functionp cached-secrets)
- (equal cached-mtime
+ (time-equal-p
+ cached-mtime
(file-attribute-modification-time
(file-attributes file))))
(progn
(defun bookmark--watch-file-already-queried-p (new-mtime)
;; Don't ask repeatedly if user already said "no" to reloading a
;; file with this mtime:
- (prog1 (equal new-mtime bookmark--watch-already-asked-mtime)
+ (prog1 (time-equal-p new-mtime bookmark--watch-already-asked-mtime)
(setq bookmark--watch-already-asked-mtime new-mtime)))
(defun bookmark-maybe-load-default-file ()
(let ((new-mtime (nth 5 (file-attributes
(car bookmark-bookmarks-timestamp))))
(old-mtime (cdr bookmark-bookmarks-timestamp)))
- (and (not (equal new-mtime old-mtime))
+ (and (not (time-equal-p new-mtime old-mtime))
(not (bookmark--watch-file-already-queried-p new-mtime))
(or (eq 'silent bookmark-watch-bookmark-file)
(yes-or-no-p
(or (not (slot-boundp obj 'tags))
;; (not (oref obj tags)) --> not needed anymore?
(/= (or (oref obj fsize) 0) actualsize)
- (not (equal (oref obj lastmodtime) actualmod))
+ (not (time-equal-p (oref obj lastmodtime) actualmod))
)
))))
(modtime (visited-file-modtime)))
(or (eq modtime 0)
(not (eq (file-attribute-type attributes) t))
- (equal (file-attribute-modification-time attributes) modtime)))))
+ (time-equal-p (file-attribute-modification-time attributes)
+ modtime)))))
(defvar auto-revert-remote-files)
;; The entry MTIME should match the most recent
;; MTIME among matching files.
(and cached-files
- (equal (nth 2 dir-elt)
+ (time-equal-p
+ (nth 2 dir-elt)
(let ((latest 0))
(dolist (f cached-files latest)
(let ((f-time
contents value)
(if (or (null (setq value (symbol-value variable)))
(not (equal (car value) file))
- (not (equal (nth 1 value) time)))
+ (not (time-equal-p (nth 1 value) time)))
(progn
(setq contents (funcall function file))
(set variable (list file time contents))
(while map
(if (and (member (cadr (car map)) files)
;; We also remove files that have changed mod times.
- (equal (file-attribute-modification-time (file-attributes
+ (time-equal-p
+ (file-attribute-modification-time (file-attributes
(nneething-file-name (cadr (car map)))))
(cadr (cdar map))))
(progn
(nnheader-find-file-noselect file t)))))
(mm-enable-multibyte) ;; Use multibyte buffer for future copying.
(buffer-disable-undo)
- (if (equal (cadr (assoc group nnfolder-scantime-alist))
+ (if (time-equal-p
+ (cadr (assoc group nnfolder-scantime-alist))
(file-attribute-modification-time (file-attributes file)))
;; This looks up-to-date, so we don't do any scanning.
(if (file-exists-p file)
;; usable: if the message has been edited or if nnmail-extra-headers
;; has been augmented since this data was parsed from the message,
;; then we have to reparse. Otherwise it's up-to-date.
- (when (and nov (equal mtime (nnmaildir--nov-get-mtime nov)))
+ (when (and nov (time-equal-p mtime (nnmaildir--nov-get-mtime nov)))
;; The timestamp matches. Now check nnmail-extra-headers.
(setq old-extra (nnmaildir--nov-get-extra nov))
(when (equal nnmaildir--extra old-extra) ;; common case
isnew
(throw 'return t))
(setq nattr (file-attribute-modification-time nattr))
- (if (equal nattr (nnmaildir--grp-new group))
+ (if (time-equal-p nattr (nnmaildir--grp-new group))
(setq nattr nil))
(if read-only (setq dir (and (or isnew nattr) ndir))
(when (or isnew nattr)
(rename-file x (concat cdir (nnmaildir--ensure-suffix file)))))
(setf (nnmaildir--grp-new group) nattr))
(setq cattr (file-attribute-modification-time (file-attributes cdir)))
- (if (equal cattr (nnmaildir--grp-cur group))
+ (if (time-equal-p cattr (nnmaildir--grp-cur group))
(setq cattr nil))
(setq dir (and (or isnew cattr) cdir)))
(unless dir (throw 'return t))
(remhash scan-group groups))
(setq x (file-attribute-modification-time (file-attributes srv-dir))
scan-group (null scan-group))
- (if (equal x (nnmaildir--srv-mtime nnmaildir--cur-server))
+ (if (time-equal-p x (nnmaildir--srv-mtime nnmaildir--cur-server))
(when scan-group
(maphash (lambda (group-name _group)
(nnmaildir--scan group-name t groups
(t
markdir-mtime))))
(puthash mark mtime new-mmth)
- (when (equal mtime (gethash mark old-mmth))
+ (when (time-equal-p mtime (gethash mark old-mmth))
(setq ranges (assq mark old-marks))
(if ranges (setq ranges (cdr ranges)))
(throw 'got-ranges nil))
(let ((arts articles)
art)
(while (setq art (pop arts))
- (when (not (equal
+ (when (not (time-equal-p
(file-attribute-modification-time
(file-attributes (concat dir (int-to-string (car art)))))
(cdr art)))
(cond (spam-stat-dirty (message "Spam stat not loaded: spam-stat-dirty t"))
((or (not (boundp 'spam-stat-last-saved-at))
(null spam-stat-last-saved-at)
- (not (equal spam-stat-last-saved-at
+ (not (time-equal-p
+ spam-stat-last-saved-at
(file-attribute-modification-time
(file-attributes spam-stat-file)))))
(progn
(if (file-exists-p mail-personal-alias-file)
(let ((modtime (file-attribute-modification-time
(file-attributes mail-personal-alias-file))))
- (if (not (equal mail-abbrev-modtime modtime))
+ (if (not (time-equal-p mail-abbrev-modtime modtime))
(progn
(setq mail-abbrev-modtime modtime)
(build-mail-abbrevs)))))))
(when mail-personal-alias-file
(let ((modtime (file-attribute-modification-time
(file-attributes mail-personal-alias-file))))
- (or (equal mail-alias-modtime modtime)
+ (or (time-equal-p mail-alias-modtime modtime)
(setq mail-alias-modtime modtime
mail-aliases t)))))
"port"))
alist elem result pair)
(if (and netrc-cache
- (equal (car netrc-cache) (file-attribute-modification-time
- (file-attributes file))))
+ (time-equal-p (car netrc-cache)
+ (file-attribute-modification-time
+ (file-attributes file))))
(insert (base64-decode-string (rot13-string (cdr netrc-cache))))
(insert-file-contents file)
(when (string-match "\\.gpg\\'" file)
(setq rng-schema-locating-file-alist
(delq cached rng-schema-locating-file-alist)))
nil)
- ((and cached (equal (nth 1 cached) mtime))
+ ((and cached (time-equal-p (nth 1 cached) mtime))
(nth 2 cached))
(t
(setq parsed (rng-parse-schema-locating-file file))
and subsequent calls on the same file won't go to disk."
(setq phrase-file (cookie-check-file phrase-file))
(let ((sym (intern-soft phrase-file cookie-cache)))
- (and sym (not (equal (symbol-function sym)
+ (and sym (not (time-equal-p
+ (symbol-function sym)
(file-attribute-modification-time
(file-attributes phrase-file))))
(yes-or-no-p (concat phrase-file
(let ((checkout-time (vc-file-getprop file 'vc-checkout-time))
(lastmod (file-attribute-modification-time (file-attributes file))))
(cond
- ((equal checkout-time lastmod) 'up-to-date)
+ ((time-equal-p checkout-time lastmod) 'up-to-date)
((string= (vc-working-revision file) "0") 'added)
((null checkout-time) 'unregistered)
(t 'edited))))
(attr (file-attributes (nth 0 fs)))
(current-mtime (file-attribute-modification-time attr))
(current-size (file-attribute-size attr)))
- (unless (and (equal saved-mtime current-mtime)
+ (unless (and (time-equal-p saved-mtime current-mtime)
(equal saved-size current-size))
(setf valid nil))))
valid))
)
(if (and cache
(equal dirstate (pop cache))
- (equal mtime (pop cache))
+ (time-equal-p mtime (pop cache))
(equal size (pop cache))
(equal ascii-fname (pop cache)))
(pop cache)
(cond
((null backend))
((eq (vc-checkout-model backend (list file)) 'implicit)
- ;; If the file was saved in the same second in which it was
+ ;; If the file was saved at the same time that it was
;; checked out, clear the checkout-time to avoid confusion.
- (if (equal (vc-file-getprop file 'vc-checkout-time)
+ (if (time-equal-p
+ (vc-file-getprop file 'vc-checkout-time)
(file-attribute-modification-time (file-attributes file)))
(vc-file-setprop file 'vc-checkout-time nil))
(if (vc-state-refresh file backend)