diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2022-04-27 00:29:26 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2022-04-27 00:30:25 -0700 |
commit | 3abb3681b57d7c8ca7fa808addb0a10b6b109cab (patch) | |
tree | 07e2463370d8dd8acfe9be4ebd821865f11bf5a1 /lisp/org | |
parent | e13689d55f4e3d445cf0457178a1508c0bb054be (diff) | |
download | emacs-3abb3681b57d7c8ca7fa808addb0a10b6b109cab.tar.gz emacs-3abb3681b57d7c8ca7fa808addb0a10b6b109cab.tar.bz2 emacs-3abb3681b57d7c8ca7fa808addb0a10b6b109cab.zip |
Use org-time-convert-to-integer instead of by hand
* lisp/org/org-macs.el (org-file-newer-than-p):
Don’t assume list-format timestamps, by using
org-time-convert-to-integer instead of doing it by hand.
Diffstat (limited to 'lisp/org')
-rw-r--r-- | lisp/org/org-macs.el | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/lisp/org/org-macs.el b/lisp/org/org-macs.el index b10725bd526..92591b5bb75 100644 --- a/lisp/org/org-macs.el +++ b/lisp/org/org-macs.el @@ -257,15 +257,16 @@ ignored in this case." (defun org-file-newer-than-p (file time) "Non-nil if FILE is newer than TIME. -FILE is a filename, as a string, TIME is a list of integers, as +FILE is a filename, as a string, TIME is a Lisp time value, as returned by, e.g., `current-time'." (and (file-exists-p file) ;; Only compare times up to whole seconds as some file-systems ;; (e.g. HFS+) do not retain any finer granularity. As ;; a consequence, make sure we return non-nil when the two ;; times are equal. - (not (time-less-p (cl-subseq (nth 5 (file-attributes file)) 0 2) - (cl-subseq time 0 2))))) + (not (time-less-p (org-time-convert-to-integer + (nth 5 (file-attributes file))) + (org-time-convert-to-integer time))))) (defun org-compile-file (source process ext &optional err-msg log-buf spec) "Compile a SOURCE file using PROCESS. |