summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2019-08-04 09:57:27 -0700
committerKyle Meyer <kyle@kyleam.com>2019-08-17 09:45:22 -0400
commit71ce18920a843bc9e4e9dbcba3056eeab98cf6da (patch)
tree09c4606284eb37d5be870d39e73730fa69c847a3
parent765577d9b3c4c6867b49458134dd050c4c2d82a2 (diff)
downloadorg-mode-71ce18920a843bc9e4e9dbcba3056eeab98cf6da.tar.gz
Backport commit 5f3f3884a from Emacs
Improve time function doc 5f3f3884a0d2a88101d330b82ef5b584cfc02aa6 Paul Eggert Sun Aug 4 10:09:25 2019 -0700
-rw-r--r--lisp/org-id.el7
1 files changed, 5 insertions, 2 deletions
diff --git a/lisp/org-id.el b/lisp/org-id.el
index 0d83570..cbd0594 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -413,9 +413,12 @@ The input I may be a character, or a single-letter string."
r))
(defun org-id-time-to-b36 (&optional time)
- "Encode TIME as a 10-digit string.
+ "Encode TIME as a 12-digit string.
This string holds the time to micro-second accuracy, and can be decoded
using `org-id-decode'."
+ ;; FIXME: If TIME represents N seconds after the epoch, then
+ ;; this encoding assumes 0 <= N < 110075314176 = (* (expt 36 4) 65536),
+ ;; i.e., that TIME is from 1970-01-01 00:00:00 to 5458-02-23 20:09:36 UTC.
(setq time (or time (org-current-time-as-list)))
(concat (org-id-int-to-b36 (nth 0 time) 4)
(org-id-int-to-b36 (nth 1 time) 4)
@@ -424,7 +427,7 @@ using `org-id-decode'."
(defun org-id-decode (id)
"Split ID into the prefix and the time value that was used to create it.
The return value is (prefix . time) where PREFIX is nil or a string,
-and time is the usual three-integer representation of time."
+and TIME is a Lisp time value (HI LO USEC)."
(let (prefix time parts)
(setq parts (org-split-string id ":"))
(if (= 2 (length parts))