summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-23 23:45:00 +0200
committerNicolas Goaziou <mail@nicolasgoaziou.fr>2014-06-23 23:45:00 +0200
commit77e234e5785f5aaa60f1e316863a2571de64bbd4 (patch)
treedd62ac823440cb6ffdb467b240ee223f84a41f0a
parent6d15cd3b89cb665357ef1f6e62c8687a10b911b4 (diff)
downloadorg-mode-77e234e5785f5aaa60f1e316863a2571de64bbd4.tar.gz
org-element: Fix thinko
* lisp/org-element.el (org-element--cache-key-less-p): Fix thinko.
-rw-r--r--lisp/org-element.el11
1 files changed, 6 insertions, 5 deletions
diff --git a/lisp/org-element.el b/lisp/org-element.el
index c140b38..93d4fcc 100644
--- a/lisp/org-element.el
+++ b/lisp/org-element.el
@@ -4864,12 +4864,13 @@ A and B are either integers or lists of integers, as returned by
(cond ((car-less-than-car a b) (throw 'exit t))
((car-less-than-car b a) (throw 'exit nil))
(t (setq a (cdr a) b (cdr b)))))
- ;; If A is empty, either keys are equal (B is also empty) or
- ;; B is less than A (B is longer). Therefore return nil.
+ ;; If A is empty, either keys are equal (B is also empty) and
+ ;; we return nil, or A is lesser than B (B is longer) and we
+ ;; return a non-nil value.
;;
- ;; If A is not empty, B is necessarily empty and A is less
- ;; than B (A is longer). Therefore, return a non-nil value.
- a))))
+ ;; If A is not empty, B is necessarily empty and A is greater
+ ;; than B (A is longer). Therefore, return nil.
+ (and (null a) b)))))
(defun org-element--cache-compare (a b)
"Non-nil when element A is located before element B."