diff options
| author | Paul Eggert | 2018-03-28 15:03:40 -0700 |
|---|---|---|
| committer | Paul Eggert | 2018-03-28 15:04:50 -0700 |
| commit | fde99c729c46c775dbdfe5bebf857c67138ae7f0 (patch) | |
| tree | 00f31ac896a1c8cf1dcf3f9e6acce6cb02fa3306 | |
| parent | e9bfd114a5e38842dd57929cc1afd1b3082a4c15 (diff) | |
| download | emacs-fde99c729c46c775dbdfe5bebf857c67138ae7f0.tar.gz emacs-fde99c729c46c775dbdfe5bebf857c67138ae7f0.zip | |
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).
| -rw-r--r-- | lisp/org/org-clock.el | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/lisp/org/org-clock.el b/lisp/org/org-clock.el index ff32e28d1e8..9be0d5bc1ff 100644 --- a/lisp/org/org-clock.el +++ b/lisp/org/org-clock.el | |||
| @@ -2239,8 +2239,18 @@ have priority." | |||
| 2239 | (let* ((start (pcase key | 2239 | (let* ((start (pcase key |
| 2240 | (`interactive (org-read-date nil t nil "Range start? ")) | 2240 | (`interactive (org-read-date nil t nil "Range start? ")) |
| 2241 | ;; In theory, all clocks started after the dawn of | 2241 | ;; In theory, all clocks started after the dawn of |
| 2242 | ;; humanity. | 2242 | ;; humanity. However, the platform's clock |
| 2243 | (`untilnow (encode-time 0 0 0 0 0 -50000)) | 2243 | ;; support might not go back that far. Choose the |
| 2244 | ;; POSIX timestamp -2**41 (approximately 68,000 | ||
| 2245 | ;; BCE) if that works, otherwise -2**31 (1901) if | ||
| 2246 | ;; that works, otherwise 0 (1970). Going back | ||
| 2247 | ;; billions of years would loop forever on Mac OS | ||
| 2248 | ;; X 10.6 with Emacs 26 and earlier (Bug#27736). | ||
| 2249 | (`untilnow | ||
| 2250 | (let ((old 0)) | ||
| 2251 | (dolist (older '((-32768 0) (-33554432 0)) old) | ||
| 2252 | (when (ignore-errors (decode-time older)) | ||
| 2253 | (setq old older))))) | ||
| 2244 | (_ (encode-time 0 m h d month y)))) | 2254 | (_ (encode-time 0 m h d month y)))) |
| 2245 | (end (pcase key | 2255 | (end (pcase key |
| 2246 | (`interactive (org-read-date nil t nil "Range end? ")) | 2256 | (`interactive (org-read-date nil t nil "Range end? ")) |