all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Glenn Morris <rgm@gnu.org>
Cc: 27736@debbugs.gnu.org, Keith David Bershatsky <esq@lawlist.com>,
	"Charles A. Roelli" <charles@aurox.ch>,
	emacs-org list <emacs-orgmode@gnu.org>,
	Noam Postavsky <npostavs@users.sourceforge.net>
Subject: Re: bug#27736: OSX 10.6.8: Building from master branch fails.
Date: Wed, 28 Mar 2018 15:08:03 -0700	[thread overview]
Message-ID: <685168ca-d136-89d7-f33b-0158f094c9ba@cs.ucla.edu> (raw)
In-Reply-To: <ef99767e-50b8-0740-17c9-c93f12f6a79e@cs.ucla.edu>

[-- Attachment #1: Type: text/plain, Size: 482 bytes --]

On 03/28/2018 12:33 PM, Paul Eggert wrote:
> Unfortunately the new org code contains the expression (encode-time 0 
> 0 0 0 0 -50000), which won't work on Emacs platforms where time_t is 
> 32 bits or is unsigned, since such platforms cannot represent a time_t 
> value corresponding to the year -50000. 

I installed the attached patch into Emacs master to try to fix this. 
I'll CC: this to emacs-orgmode in the hopes that this won't get lost in 
the next merge to Emacs master.


[-- Attachment #2: 0001-Port-recent-org-clock-fix-to-POSIX-time_t.patch --]
[-- Type: text/x-patch, Size: 1751 bytes --]

From 43994e484fadac28682542e75548e80cbb80987d Mon Sep 17 00:00:00 2001
From: Paul Eggert <eggert@cs.ucla.edu>
Date: Wed, 28 Mar 2018 15:03:40 -0700
Subject: [PATCH] Port recent org-clock fix to POSIX time_t

* lisp/org/org-clock.el (org-clock-special-range):
Don't assume support for time_t values less than 0, or less than
-2**31 for that matter (Bug#27736).
---
 lisp/org/org-clock.el | 14 ++++++++++++--
 1 file changed, 12 insertions(+), 2 deletions(-)

diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el
index ff32e28d1e..9be0d5bc1f 100644
--- a/lisp/org/org-clock.el
+++ b/lisp/org/org-clock.el
@@ -2239,8 +2239,18 @@ org-clock-special-range
     (let* ((start (pcase key
 		    (`interactive (org-read-date nil t nil "Range start? "))
                     ;; In theory, all clocks started after the dawn of
-                    ;; humanity.
-		    (`untilnow (encode-time 0 0 0 0 0 -50000))
+                    ;; humanity.  However, the platform's clock
+                    ;; support might not go back that far.  Choose the
+                    ;; POSIX timestamp -2**41 (approximately 68,000
+                    ;; BCE) if that works, otherwise -2**31 (1901) if
+                    ;; that works, otherwise 0 (1970).  Going back
+                    ;; billions of years would loop forever on Mac OS
+                    ;; X 10.6 with Emacs 26 and earlier (Bug#27736).
+		    (`untilnow
+                     (let ((old 0))
+                       (dolist (older '((-32768 0) (-33554432 0)) old)
+                         (when (ignore-errors (decode-time older))
+			   (setq old older)))))
 		    (_ (encode-time 0 m h d month y))))
 	   (end (pcase key
 		  (`interactive (org-read-date nil t nil "Range end? "))
-- 
2.14.3


  parent reply	other threads:[~2018-03-28 22:08 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-17 15:18 bug#27736: OSX 10.6.8: Building from master branch fails Keith David Bershatsky
2017-07-17 15:29 ` Noam Postavsky
2017-07-17 16:10 ` Keith David Bershatsky
2017-07-17 16:38   ` Noam Postavsky
2017-07-17 18:05 ` Keith David Bershatsky
2017-07-17 18:48   ` Noam Postavsky
2017-07-17 19:43 ` Alan Third
2017-07-17 20:48   ` Charles A. Roelli
2017-07-17 21:37 ` Keith David Bershatsky
2017-07-18  5:08   ` Charles A. Roelli
2017-07-18  6:56 ` Keith David Bershatsky
2017-07-18 14:34   ` Eli Zaretskii
2017-07-18 16:07 ` Keith David Bershatsky
2017-07-18 18:42   ` Charles A. Roelli
2017-07-19 19:58     ` Charles A. Roelli
2017-07-19 22:48       ` Alan Third
2017-07-23  9:28         ` Charles A. Roelli
2017-07-24 15:50           ` Glenn Morris
2017-07-30 16:32             ` Charles A. Roelli
2017-11-05 18:03 ` Keith David Bershatsky
2017-11-05 18:15   ` Noam Postavsky
2017-11-05 20:01 ` Keith David Bershatsky
2017-11-06  2:20 ` Keith David Bershatsky
2017-11-06 19:41   ` Charles A. Roelli
2017-11-06 20:41     ` Charles A. Roelli
2017-11-07  2:13 ` Keith David Bershatsky
2017-11-07 20:20   ` Charles A. Roelli
2017-11-08  5:18 ` Keith David Bershatsky
2017-11-08 19:55   ` Charles A. Roelli
2018-03-27 21:19 ` Paul Eggert
2018-03-28 17:15   ` Glenn Morris
2018-03-28 19:02     ` Charles A. Roelli
2018-03-28 19:33     ` Paul Eggert
2018-03-28 22:08       ` Paul Eggert
2018-03-28 22:08       ` Paul Eggert [this message]
2018-03-28 18:54   ` Charles A. Roelli
2018-03-28 21:29     ` Paul Eggert
     [not found]     ` <805d95e1-bfc0-bb40-ced7-c10bb5a7256e@cs.ucla.edu>
2018-03-31 15:02       ` Charles A. Roelli
     [not found]       ` <m21sg02sr4.fsf@aurox.ch>
2018-04-01 20:32         ` Paul Eggert
     [not found] <m2a800ve9b.wl%esq@lawlist.com>
2017-11-05 20:54 ` Charles A. Roelli

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

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

  git send-email \
    --in-reply-to=685168ca-d136-89d7-f33b-0158f094c9ba@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=27736@debbugs.gnu.org \
    --cc=charles@aurox.ch \
    --cc=emacs-orgmode@gnu.org \
    --cc=esq@lawlist.com \
    --cc=npostavs@users.sourceforge.net \
    --cc=rgm@gnu.org \
    /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 external index

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

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.