From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: Re: Arithmetic range error Date: Sun, 10 Feb 2019 02:06:20 -0800 Organization: UCLA Computer Science Department Message-ID: References: <87k1iaft1p.fsf@yandex.com> <8736oye8gm.fsf@yandex.com> <83va1upgdp.fsf@gnu.org> <83r2cipeah.fsf@gnu.org> <87o97l6e1g.fsf@nicolasgoaziou.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="257649"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 Cc: emacs-devel@gnu.org To: Nicolas Goaziou Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Feb 10 11:07:20 2019 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gsm19-0014sv-LO for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2019 11:07:19 +0100 Original-Received: from localhost ([127.0.0.1]:57299 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsm18-0003Cj-KW for ged-emacs-devel@m.gmane.org; Sun, 10 Feb 2019 05:07:18 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:46204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gsm0W-0003CS-2P for emacs-devel@gnu.org; Sun, 10 Feb 2019 05:06:40 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gsm0S-000894-T0 for emacs-devel@gnu.org; Sun, 10 Feb 2019 05:06:38 -0500 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:33652) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gsm0O-00084y-MV for emacs-devel@gnu.org; Sun, 10 Feb 2019 05:06:34 -0500 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 019901612B1; Sun, 10 Feb 2019 02:06:22 -0800 (PST) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id PWYiP84hnp_2; Sun, 10 Feb 2019 02:06:21 -0800 (PST) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3F8CF1612BA; Sun, 10 Feb 2019 02:06:21 -0800 (PST) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id sS57rpVRBKQb; Sun, 10 Feb 2019 02:06:21 -0800 (PST) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 1A77C161265; Sun, 10 Feb 2019 02:06:21 -0800 (PST) In-Reply-To: <87o97l6e1g.fsf@nicolasgoaziou.fr> Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:233181 Archived-At: 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.