From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [PATCH] org-latex-compile timestamp checks Date: Sat, 16 Jan 2016 15:16:14 +0100 Message-ID: <87wpr9r4nl.fsf@nicolasgoaziou.fr> References: <57F8EBE2-E535-423A-828B-BCB3A2B9F797@gmail.com> <87r3hjf3b9.fsf@gmx.us> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:41760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRcV-0005m0-56 for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:14:23 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aKRcU-0004mx-Ai for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:14:23 -0500 Received: from relay4-d.mail.gandi.net ([2001:4b98:c:538::196]:35511) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aKRcU-0004ml-4O for emacs-orgmode@gnu.org; Sat, 16 Jan 2016 09:14:22 -0500 In-Reply-To: (Anthony Cowley's message of "Fri, 15 Jan 2016 15:34:13 -0500") List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Anthony Cowley Cc: emacs-orgmode@gnu.org Hello, Anthony Cowley writes: > * 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 | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el > index a57677b..f803b7e 100644 > --- a/lisp/ox-latex.el > +++ b/lisp/ox-latex.el > @@ -3576,7 +3576,8 @@ 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)) > + (time-less-p (subseq (nth 5 (file-attributes pdffile)) 0 2) > + (subseq time 0 2))) This sounds good. Thank you. Although, I suggest to use `cl-subseq' instead of its alias. Also, it may be worth commenting that trick right into the source. Eventually, I think at least ox-texinfo.el, ox-man.el and ox-groff.el need a similar trick. Rasmus, what do you think? Regards, -- Nicolas Goaziou