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

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

[elpa] scratch/org-edna cc3cd47 22/72: Added configuration option to use


From: Ian Dunn
Subject: [elpa] scratch/org-edna cc3cd47 22/72: Added configuration option to use inheritance
Date: Sun, 21 May 2017 21:11:21 -0400 (EDT)

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

    Added configuration option to use inheritance
    
    * org-edna.el (org-edna-use-inheritance): New defcustom.
      (org-edna-trigger-function):
      (org-edna-blocker-function): Use it
---
 org-edna.el | 18 +++++++++++++++---
 1 file changed, 15 insertions(+), 3 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 1411982..720db92 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1,4 +1,4 @@
-;;; org-edna.el --- Extendable Blockers and Triggers -*- lexical-binding: t; 
-*-
+;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
 ;; Author: Ian Dunn <address@hidden>
 ;; Keywords: convenience, text, org
@@ -12,6 +12,18 @@
 (require 'org)
 (require 'subr-x)
 
+(defgroup org-edna nil
+  "Extensible Dependencies 'N' Actions"
+  :group 'org)
+
+(defcustom org-edna-use-inheritance nil
+  "Whether Edna should use inheritance when looking for properties.
+
+This only applies to the BLOCKER and TRIGGER properties, not any
+properties used during actions or conditions."
+  :group 'org-edna
+  :type 'boolean)
+
 (defun org-edna-parse-form (form)
   (pcase-let* ((`(,token . ,pos) (read-from-string form))
                (modifier nil)
@@ -162,12 +174,12 @@
 
 (defun org-edna-trigger-function (change-plist)
   (org-edna-run change-plist
-    (when-let ((form (org-entry-get pos "TRIGGER")))
+    (when-let ((form (org-entry-get pos "TRIGGER" org-edna-use-inheritance)))
       (org-edna-process-form form 'action))))
 
 (defun org-edna-blocker-function (change-plist)
   (org-edna-run change-plist
-    (if-let ((form (org-entry-get pos "BLOCKER")))
+    (if-let ((form (org-entry-get pos "BLOCKER" org-edna-use-inheritance)))
         (org-edna-process-form form 'condition)
       t)))
 



reply via email to

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