From a37996910e7914fc3a999ca63c449132a49fd300 Mon Sep 17 00:00:00 2001 From: Anthony Cowley Date: Thu, 14 Jan 2016 18:13:45 -0500 Subject: [PATCH] ox-latex: PDF generation timestamp check * lisp/ox-latex.el (org-latex-compile): Improve timestamp check on HFS+ filesystem by only considering 1-second clock resolution. Previously, the call to (current-time) could return a timestamp with a non-zero microsecond or picosecond fields, while the file attribute always has zeros for these fields. The check that the generated file is newer than the reference timestamp only succeeded when the time to generate the file crossed a 1-second clock interval. TINYCHANGE --- lisp/ox-latex.el | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el index 7b99b7cba..7ce50ffad 100644 --- a/lisp/ox-latex.el +++ b/lisp/ox-latex.el @@ -3468,7 +3468,10 @@ Return PDF file name or an error if it couldn't be produced." ;; Check for process failure. Provide collected errors if ;; possible. (if (or (not (file-exists-p pdffile)) - (time-less-p (nth 5 (file-attributes pdffile)) time)) + ;; Only compare times up to whole seconds as some filesystems + ;; (e.g. HFS+) do not retain any finer granularity. + (time-less-p (org-sublist (nth 5 (file-attributes pdffile)) 1 2) + (org-sublist time 1 2))) (error (format "PDF file %s wasn't produced" pdffile)) ;; Else remove log files, when specified, and signal end of ;; process to user, along with any error encountered.