summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2018-08-22 20:45:47 -0700
committerKyle Meyer <kyle@kyleam.com>2019-01-13 12:43:04 -0500
commit9a8462771f2e140c63e0acdf498bd0c36e70488a (patch)
treec7a649c543e0dccb916b23712b9e2b4fff5c5c00
parent28d2c81709d374c601c08c7a44065240f57843d3 (diff)
downloadorg-mode-9a8462771f2e140c63e0acdf498bd0c36e70488a.tar.gz
Backport commit a4a3c92e9 from Emacs
* lisp/org-agenda.el (org-cmp-ts): Avoid arbitrary limit to most-positive-fixnum or to most-negative-fixnum. * lisp/org-footnote.el (org-footnote-new): Simplify. * lisp/org-element.el (org-element--cache-generate-key): Document fixnum limitation. Prune most-positive-fixnum from Lisp source a4a3c92e9de59bd0251f36326375cce898919edc Paul Eggert Wed Aug 22 20:46:08 2018 -0700
-rw-r--r--lisp/org-agenda.el6
-rw-r--r--lisp/org-element.el2
-rw-r--r--lisp/org-footnote.el2
3 files changed, 5 insertions, 5 deletions
diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index 584742a..489ecec 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -7018,15 +7018,15 @@ When TYPE is \"scheduled\", \"deadline\", \"timestamp\" or
\"timestamp_ia\", compare within each of these type. When TYPE
is the empty string, compare all timestamps without respect of
their type."
- (let* ((def (if org-sort-agenda-notime-is-late most-positive-fixnum -1))
+ (let* ((def (and (not org-sort-agenda-notime-is-late) -1))
(ta (or (and (string-match type (or (get-text-property 1 'type a) ""))
(get-text-property 1 'ts-date a))
def))
(tb (or (and (string-match type (or (get-text-property 1 'type b) ""))
(get-text-property 1 'ts-date b))
def)))
- (cond ((< ta tb) -1)
- ((< tb ta) +1))))
+ (cond ((if ta (and tb (< ta tb)) tb) -1)
+ ((if tb (and ta (< tb ta)) ta) +1))))
(defsubst org-cmp-habit-p (a b)
"Compare the todo states of strings A and B."
diff --git a/lisp/org-element.el b/lisp/org-element.el
index c17bee4..8d16aa5 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4906,7 +4906,7 @@ table is cleared once the synchronization is complete."
(defun org-element--cache-generate-key (lower upper)
"Generate a key between LOWER and UPPER.
-LOWER and UPPER are integers or lists, possibly empty.
+LOWER and UPPER are fixnums or lists of same, possibly empty.
If LOWER and UPPER are equals, return LOWER. Otherwise, return
a unique key, as an integer or a list of integers, according to
diff --git a/lisp/org-footnote.el b/lisp/org-footnote.el
index 7147a31..4a296b1 100644
--- a/lisp/org-footnote.el
+++ b/lisp/org-footnote.el
@@ -654,7 +654,7 @@ or new, let the user edit the definition of the footnote."
(let* ((all (org-footnote-all-labels))
(label
(if (eq org-footnote-auto-label 'random)
- (format "%x" (random most-positive-fixnum))
+ (format "%x" (abs (random)))
(org-footnote-normalize-label
(let ((propose (org-footnote-unique-label all)))
(if (eq org-footnote-auto-label t) propose