summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-10-03 09:10:01 -0700
committerKyle Meyer <kyle@kyleam.com>2019-01-13 12:43:04 -0500
commit2b6c7e14f2d7c5eac5d3f08d307b7fc73371ee64 (patch)
treefc2e78a4c0eaf9f679297fa3ab09de46fa04c02c
parent6c4acc8deddb3edad70ab8e902683e429e2ee584 (diff)
downloadorg-mode-2b6c7e14f2d7c5eac5d3f08d307b7fc73371ee64.tar.gz
Backport commit 93fe42094 from Emacs
This follows on a suggestion by Stefan Monnier in: https://lists.gnu.org/r/emacs-devel/2018-08/msg00991.html (Bug#32902). * lisp/org-id.el (org-id-uuid, org-id-time-to-b36): Don't assume timestamps default to list form. New (TICKS . HZ) timestamp format 93fe420942c08111a6048af7c4d7807c61d80a09 Paul Eggert Sat Oct 6 23:31:04 2018 -0700
-rw-r--r--lisp/org-id.el4
1 files changed, 2 insertions, 2 deletions
diff --git a/lisp/org-id.el b/lisp/org-id.el
index bbf761c..2054f0c 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -358,7 +358,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
"Return string with random (version 4) UUID."
(let ((rnd (md5 (format "%s%s%s%s%s%s%s"
(random)
- (current-time)
+ (encode-time nil 'list)
(user-uid)
(emacs-pid)
(user-full-name)
@@ -417,7 +417,7 @@ The input I may be a character, or a single-letter string."
"Encode TIME as a 10-digit string.
This string holds the time to micro-second accuracy, and can be decoded
using `org-id-decode'."
- (setq time (or time (current-time)))
+ (setq time (encode-time time 'list))
(concat (org-id-int-to-b36 (nth 0 time) 4)
(org-id-int-to-b36 (nth 1 time) 4)
(org-id-int-to-b36 (or (nth 2 time) 0) 4)))