[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Arithmetic range error

From: Paul Eggert
Subject: Re: Arithmetic range error
Date: Sun, 10 Feb 2019 02:06:20 -0800
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0

Nicolas Goaziou wrote:
I modified Org (master branch) so that it uses the list representation
of time values in this situation.
I don't see why it's necessary to assume the list representation in ox-publish.el here:

  (let* ((key (org-publish-timestamp-filename filename pub-dir pub-func))
         (pstamp (pcase (org-publish-cache-get key)
                   ;; Old format, convert it back to a time value.
                   ((and stamp (pred wholenump)) (seconds-to-time stamp))
                   (stamp stamp)))

The call to seconds-to-time is not needed since the only use of pstamp is in (time-less-p pstamp ctime), which works just fine with integer timestamps. That is, you can simplify the above code to the following:

  (let* ((key (org-publish-timestamp-filename filename pub-dir pub-func))
         (pstamp (org-publish-cache-get key))

This simplification treats timestamps as reasonably-opaque objects, which is better since their format is subject to change.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]