emacs-elpa-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[elpa] master aa259f0 037/135: Fix considerations


From: Ian Dunn
Subject: [elpa] master aa259f0 037/135: Fix considerations
Date: Mon, 17 Feb 2020 10:52:49 -0500 (EST)

branch: master
commit aa259f0edc351f77bf5fe55500978cb42f2d694a
Author: Ian D <address@hidden>
Commit: Ian D <address@hidden>

    Fix considerations
    
    * org-edna.el (org-edna-handle-consideration): Use floats when computing
      percentage of fulfilled blocks.
---
 org-edna.el | 8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 440c4d9..bb6e548 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -543,16 +543,14 @@ IDS are all UUIDs as understood by `org-id-find'."
        first-block)
       ((pred integerp)
        ;; A fixed number of them must be fulfilled, so check how many aren't.
-       (let* ((unfulfilled (seq-count #'identity blocks))
-              (fulfilled   (- total-blocks unfulfilled)))
+       (let* ((fulfilled (seq-count #'not blocks)))
          (if (>= fulfilled consideration)
              nil
            first-block)))
       ((pred floatp)
        ;; A certain percentage of them must be fulfilled
-       (let* ((unfulfilled (seq-count #'identity blocks))
-              (fulfilled   (- total-blocks unfulfilled)))
-         (if (>= (/ fulfilled total-blocks) consideration)
+       (let* ((fulfilled (seq-count #'not blocks)))
+         (if (>= (/ (float fulfilled) (float total-blocks)) consideration)
              nil
            first-block))))))
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]