unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Nicolas Goaziou <mail@nicolasgoaziou.fr>
Cc: emacs-devel@gnu.org
Subject: Re: Arithmetic range error
Date: Sun, 10 Feb 2019 02:06:20 -0800	[thread overview]
Message-ID: <a44c1a60-5bd2-eda8-f757-7f769ef08c66@cs.ucla.edu> (raw)
In-Reply-To: <87o97l6e1g.fsf@nicolasgoaziou.fr>

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.



  parent reply	other threads:[~2019-02-10 10:06 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-02-08 10:55 Arithmetic range error Colin Baxter
2019-02-08 12:25 ` Robert Pluim
2019-02-08 13:05   ` Colin Baxter
2019-02-08 13:15     ` Robert Pluim
2019-02-08 13:19       ` Eli Zaretskii
2019-02-08 13:34         ` Robert Pluim
2019-02-08 14:04           ` Eli Zaretskii
2019-02-08 14:18             ` Robert Pluim
2019-02-08 23:44               ` Nicolas Goaziou
2019-02-09  7:02                 ` Colin Baxter
2019-02-10 10:06                 ` Paul Eggert [this message]
2019-02-10 12:59                   ` Nicolas Goaziou

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=a44c1a60-5bd2-eda8-f757-7f769ef08c66@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=mail@nicolasgoaziou.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).