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

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

[elpa] scratch/org-edna dc320fe 17/72: Use existing org-xor instead of n


From: Ian Dunn
Subject: [elpa] scratch/org-edna dc320fe 17/72: Use existing org-xor instead of new function
Date: Sun, 21 May 2017 21:11:21 -0400 (EDT)

branch: scratch/org-edna
commit dc320fe84fb6c0a100bf9c3d760214e355dd35dd
Author: Ian D <address@hidden>
Commit: Ian D <address@hidden>

    Use existing org-xor instead of new function
    
    * org-edna.el (org-edna--xor): Removed.
      (org-edna-condition/todo-state):
      (org-edna-condition/headings):
      (org-edna-condition/variable-set):
      (org-edna-condition/has-property): Use org-xor
---
 org-edna.el | 12 ++++--------
 1 file changed, 4 insertions(+), 8 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index e75127e..a605179 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -393,10 +393,6 @@ IDS are all UUIDs as understood by `org-id-find'."
 
 ;; This means that we want to take the exclusive-or of condition and neg.
 
-(defsubst org-edna--xor (lhs rhs)
-  (or (and lhs (not rhs))
-      (and (not lhs) rhs)))
-
 (defun org-edna-condition/done (neg)
   (when-let ((condition
               (if neg
@@ -406,23 +402,23 @@ IDS are all UUIDs as understood by `org-id-find'."
 
 (defun org-edna-condition/todo-state (neg state)
   (let ((condition (string-equal (org-entry-get nil "TODO") state)))
-    (when (org-edna--xor condition neg)
+    (when (org-xor condition neg)
       (org-get-heading))))
 
 ;; Block if there are headings
 (defun org-edna-condition/headings (neg)
   (let ((condition (not (seq-empty-p (org-map-entries (lambda nil t))))))
-    (when (org-edna--xor condition neg)
+    (when (org-xor condition neg)
       (buffer-name))))
 
 (defun org-edna-condition/variable-set (neg var val)
   (let ((condition (string-equal (symbol-value (intern var)) (read val))))
-    (when (org-edna--xor condition neg)
+    (when (org-xor condition neg)
       (format "%s %s= %s" var (or neg "=") val))))
 
 (defun org-edna-condition/has-property (neg prop val)
   (let ((condition (string-equal (org-entry-get nil prop) val)))
-    (when (org-edna--xor condition neg)
+    (when (org-xor condition neg)
       (org-get-heading))))
 
 



reply via email to

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