summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2012-09-03 13:16:52 +0200
committerBastien Guerry <bzg@altern.org>2012-09-03 13:16:52 +0200
commit7719734dd7b216e29ee7f5be5077d13004903a7d (patch)
treefbd119df526b95cd967cdddec02f7c376392fe12
parent069b5bab381b27242534fc88efee1642bf51ef61 (diff)
downloadorg-mode-7719734dd7b216e29ee7f5be5077d13004903a7d.tar.gz
org-compat.el: New compatibility function `org-random'release_7.9.1
* org-compat.el (org-random): New compatibility function. * org-id.el (org-id-uuid): Use it.
-rw-r--r--lisp/org-compat.el6
-rw-r--r--lisp/org-id.el2
2 files changed, 7 insertions, 1 deletions
diff --git a/lisp/org-compat.el b/lisp/org-compat.el
index 7604284..7c65233 100644
--- a/lisp/org-compat.el
+++ b/lisp/org-compat.el
@@ -460,6 +460,12 @@ With two arguments, return floor and remainder of their quotient."
(defun org-release () "N/A")
(defun org-git-version () "N/A !!check installation!!"))))))
+(defun org-random ()
+ "Call ̀€random' appropriately."
+ (if (or (featurep 'xemacs) (version< emacs-version "24.2.50.1"))
+ (random t)
+ (random)))
+
(provide 'org-compat)
;;; org-compat.el ends here
diff --git a/lisp/org-id.el b/lisp/org-id.el
index 0c7a1b5..365b35a 100644
--- a/lisp/org-id.el
+++ b/lisp/org-id.el
@@ -317,7 +317,7 @@ So a typical ID could look like \"Org:4nd91V40HI\"."
(defun org-id-uuid ()
"Return string with random (version 4) UUID."
(let ((rnd (md5 (format "%s%s%s%s%s%s%s"
- (random t)
+ (org-random)
(current-time)
(user-uid)
(emacs-pid)