From ff35f41ec533bd1835d8e555f87e582f15c42fc0 Mon Sep 17 00:00:00 2001 From: ndwarshuis Date: Mon, 2 May 2022 23:41:15 -0400 Subject: [PATCH] FIX conflict resolution for empty lists --- local/lib/org-x/org-x-dag.el | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/local/lib/org-x/org-x-dag.el b/local/lib/org-x/org-x-dag.el index 7f104d5..0ddf520 100644 --- a/local/lib/org-x/org-x-dag.el +++ b/local/lib/org-x/org-x-dag.el @@ -2278,19 +2278,19 @@ Return value is a list like (BUFFER NON-BUFFER)." (cl-labels ((get-overlaps (acc ss) - (-let* (((acc+ acc-) acc) - (s0 (car ss)) - (A (cdr s0))) - (-if-let (rest (cdr ss)) - (let ((a1 (cadr (car s0)))) - ;; add members while if the starting value is less than the ending - ;; value of the current member - (-if-let (over (->> (--take-while (< (car (car it)) a1) rest) - (--map (list A (cdr it))) - (reverse))) - (get-overlaps `((,@over ,@acc+) ,acc-) rest) - (get-overlaps `(,acc+ (,A ,@acc-)) rest))) - `(,acc+ (,A ,@acc-)))))) + (-if-let (s0 (car ss)) + (-let* (((acc+ acc-) acc) + (A (cdr s0)) + (a1 (cadr (car s0))) + (rest (cdr ss))) + ;; add members while if the starting value is less than the ending + ;; value of the current member + (-if-let (over (->> (--take-while (< (car (car it)) a1) rest) + (--map (list A (cdr it))) + (reverse))) + (get-overlaps `((,@over ,@acc+) ,acc-) rest) + (get-overlaps `(,acc+ (,A ,@acc-)) rest))) + acc))) (-let (((over non-over) (->> (-annotate interval-fun xs) (--sort (< (car (car it)) (car (car other)))) (get-overlaps nil))))