[elpa] externals/org-edna 8258a4d: Synced with upstream

2020-09-02 Thread Ian Dunn
branch: externals/org-edna
commit 8258a4dfa00aa522249cdf9aeea5be4de97bd7c1
Author: Ian Dunn 
Commit: Ian Dunn 

Synced with upstream
---
 org-edna.el   | 118 
 org-edna.info | 282 --
 org-edna.org  |  78 
 3 files changed, 357 insertions(+), 121 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index f743c96..fac34ef 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.1.1
+;; Version: 1.1.2
 
 ;; This file is part of GNU Emacs.
 
@@ -88,6 +88,20 @@ it will be used.  It should be either \"short\" or
   :type '(choice (const :tag "Short Format" short)
  (const :tag "Long Format" long)))
 
+(defcustom org-edna-from-todo-states 'todo
+  "Category of TODO states that allow Edna to run.
+
+This is one of the following options:
+
+If `todo', Edna will run when changing TODO state from an entry
+in `org-not-done-keywords'.
+
+If `not-done', Edna will run when changing TODO state from any
+entry that's not in `org-done-keywords'.  This includes TODO
+state being empty."
+  :type '(choice (const :tag "TODO Keywords" todo)
+ (const :tag "Not DONE Keywords" not-done)))
+
 ;;; Form Parsing
 
 ;; 3 types of "forms" here
@@ -113,6 +127,14 @@ ERROR-POS is the positiong in MSG at which the error 
occurred."
  "Org Edna Syntax Error: %s\n%s\n%s"
  msg form (concat (make-string pos ?\ ) "^"
 
+(defun org-edna--id-pred-p (arg)
+  "Return non-nil if ARG matches id:UUID.
+
+UUID is any UUID recognized by `org-uuidgen-p'."
+  (save-match-data
+(when (string-match "^id:\\(.*\\)" (symbol-name arg))
+  (org-uuidgen-p (match-string 1 (symbol-name arg))
+
 (defun org-edna--transform-arg (arg)
   "Transform argument ARG.
 
@@ -126,6 +148,10 @@ Everything else is returned as is."
   ;; Name matches `org-uuidgen-p'
   (let (pred org-uuidgen-p) (symbol-name arg)))
  (symbol-name arg))
+((and (pred symbolp) ;; Symbol
+  ;; Name matches `org-uuidgen-p'
+  (pred org-edna--id-pred-p))
+ (symbol-name arg))
 (_
  arg)))
 
@@ -631,34 +657,40 @@ this after reverting Org mode buffers."
 
 ;;; Interactive Functions
 
-(defmacro org-edna-run (change-plist  body)
-  "Run a TODO state change.
+(defun org-enda--should-run-in-from-state-p (from)
+  (pcase org-edna-from-todo-states
+('todo
+ (member from (cons 'todo org-not-done-keywords)))
+('not-done
+ (not (member from (cons 'done org-done-keywords))
+
+(defun org-edna--should-run-p (change-plist)
+  "Check if Edna should run.
 
 The state information is held in CHANGE-PLIST.  If the TODO state
 is changing from a TODO state to a DONE state, run BODY."
-  (declare (indent 1))
-  `(let* ((pos (plist-get ,change-plist :position))
-  (type (plist-get ,change-plist :type))
-  (from (plist-get ,change-plist :from))
-  (to (plist-get ,change-plist :to)))
- (if (and
-  ;; We are only handling todo-state-change
-  (eq type 'todo-state-change)
-  ;; And only from a TODO state to a DONE state
-  (member from (cons 'todo org-not-done-keywords))
-  (member to (cons 'done org-done-keywords)))
- (condition-case-unless-debug err
- ,@body
-   (error
-(if (eq (car err) 'invalid-read-syntax)
-(org-edna--print-syntax-error (cdr err))
-  (message "Edna Error at heading %s: %s" (org-get-heading t t t) 
(error-message-string err)))
-(setq org-block-entry-blocking (org-get-heading))
-;; Block
-nil))
-   ;; Return t for the blocker to let the calling function know that there
-   ;; is no block here.
-   t)))
+  (let* ((type (plist-get change-plist :type))
+ (from (plist-get change-plist :from))
+ (to (plist-get change-plist :to)))
+(and
+ ;; We are only handling todo-state-change
+ (eq type 'todo-state-change)
+ ;; And only from a TODO state to a DONE state
+ (org-enda--should-run-in-from-state-p from)
+ (member to (cons 'done org-done-keywords)
+
+(defmacro org-edna-run ( body)
+  "Run a TODO state change."
+  (declare (indent 0))
+  `(condition-case-unless-debug err
+   ,@body
+ (error
+  (if (eq (car err) 'invalid-read-syntax)
+  (org-edna--print-syntax-error (cdr err))
+(message "Edna Error at heading %s: %s" (org-get-heading t t t) 
(error-message-string err)))
+  (setq org-block-entry-blocking (org-get-heading))
+  ;; Block
+  nil)))
 
 (de

[elpa] master 5cacf20 078/135: Updated documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 5cacf20b153a7da664ab846efd20ff63449a4bb6
Author: Ian Dunn 
Commit: Ian Dunn 

Updated documentation

Including info and dir pages for use in ELPA.

* org-edna.el: Added docstrings for all finders, actions, and conditions.

* org-edna.org: Updated documentation to fix uses of commas vs. spaces in 
syntax.
  (Contributing): Give a little background on bazaar and how to use it.
---
 .bzrignore|1 -
 dir   |   19 +
 org-edna.el   |  362 +++--
 org-edna.info | 1233 +
 org-edna.org  |  240 +++
 5 files changed, 1734 insertions(+), 121 deletions(-)

diff --git a/.bzrignore b/.bzrignore
index ec97837..5228a6a 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1,6 +1,5 @@
 *.elc
 local.mk
 org-edna-autoloads.el
-org-edna.info
 org-edna.texi
 org-edna.html
\ No newline at end of file
diff --git a/dir b/dir
new file mode 100644
index 000..cf49cac
--- /dev/null
+++ b/dir
@@ -0,0 +1,19 @@
+This is the file .../info/dir, which contains the
+topmost node of the Info hierarchy, called (dir)Top.
+The first time you invoke Info you start off looking at this node.
+
+File: dir, Node: Top   This is the top of the INFO tree
+
+  This (the Directory node) gives a menu of major topics.
+  Typing "q" exits, "H" lists all Info commands, "d" returns here,
+  "h" gives a primer for first-timers,
+  "mEmacs" visits the Emacs manual, etc.
+
+  In Emacs, you can click mouse button 2 on a menu item or cross reference
+  to select it.
+
+* Menu:
+
+Emacs
+* Org Edna: (org-edna). Extensible Dependencies ’N’ Actions for 
+  Org Mode tasks.
diff --git a/org-edna.el b/org-edna.el
index bda6ec3..ccee794 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -29,7 +29,7 @@
 ;; fulfilled before a task can be completed and actions to take once it is.
 
 ;; Org Edna runs when either the BLOCKER or TRIGGER properties are set on a
-;; headline, and when it is changing from a TODO state to a DONE state.
+;; heading, and when it is changing from a TODO state to a DONE state.
 
 ;;; History:
 
@@ -163,7 +163,7 @@ indicating whether FORM accepts actions or conditions."
 (blocking-entry)
 (consideration 'all)
 (state nil) ;; Type of operation
-;; Keep track of the current headline
+;; Keep track of the current heading
 (last-entry (point-marker))
 (pos 0))
 (while (< pos (length form))
@@ -295,6 +295,8 @@ Remove Edna's workers from `org-trigger-hook' and
 (defun org-edna-finder/match (match-spec  scope skip)
   "Find entries using Org matching.
 
+Edna Syntax: match(\"MATCH-SPEC\" SCOPE SKIP)
+
 MATCH-SPEC may be any valid match string; it is passed straight
 into `org-map-entries'.
 
@@ -316,15 +318,28 @@ SCOPE defaults to agenda, and SKIP defaults to nil.
 
 ;; ID finder
 (defun org-edna-finder/ids ( ids)
-  "Find a list of headlines with given IDs.
+  "Find a list of headings with given IDs.
+
+Edna Syntax: ids(ID1 ID2 ...)
+
+Each ID is a UUID as understood by `org-id-find'.
 
-IDS are all UUIDs as understood by `org-id-find'."
+Note that in the edna syntax, the IDs don't need to be quoted."
   (mapcar (lambda (id) (org-id-find id 'marker)) ids))
 
 (defun org-edna-finder/self ()
+  "Finder for the current heading.
+
+Edna Syntax: self"
   (list (point-marker)))
 
 (defun org-edna-finder/siblings ()
+  "Finder for all siblings of the source heading.
+
+Edna Syntax: siblings
+
+Siblings are returned in order, starting from the first heading,
+and ignoring the source heading."
   (org-with-wide-buffer
(let ((self (and (ignore-errors (org-back-to-heading t)) (point)))
  (markers))
@@ -338,6 +353,12 @@ IDS are all UUIDs as understood by `org-id-find'."
  (nreverse markers
 
 (defun org-edna-finder/siblings-wrap ()
+  "Finder for all siblings of the source heading.
+
+Edna Syntax: siblings-wrap
+
+Siblings are returned in order, starting from the first heading
+after the source heading and wrapping when it reaches the end."
   (org-with-wide-buffer
(let ((self (and (ignore-errors (org-back-to-heading t)) (point)))
  (markers))
@@ -356,6 +377,12 @@ IDS are all UUIDs as understood by `org-id-find'."
  (nreverse markers
 
 (defun org-edna-finder/rest-of-siblings ()
+  "Finder for the siblings after the source heading.
+
+Edna Syntax: rest-of-siblings
+
+Siblings are returned in order, starting from the first heading
+after the source heading."
   (org-with-wide-buffer
(let ((self (and (ignore-errors (org-back-to-heading t)) (point)))
  (markers))
@@ -366,11 +393,23 @@ IDS are all UUIDs as understood by `org-id-find'."
  (nreverse markers
 
 (defun org-edna-finder/next-sibling ()
+  "Finder for the next siblin

[elpa] master 2354cde 118/135: Fixed up description of set-effort!.

2020-02-17 Thread Ian Dunn
branch: master
commit 2354cde6bc27313813062ec679d3ebb235dec17c
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed up description of set-effort!.

* org-edna.org (Effort): Changed layout of syntax variations.
---
 org-edna.info | 227 ++
 org-edna.org  |  16 +++--
 2 files changed, 127 insertions(+), 116 deletions(-)

diff --git a/org-edna.info b/org-edna.info
index 2bc5847..de1c087 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -85,12 +85,12 @@ Advanced Features
 
 Conditions
 
-* done::
-* headings::
-* todo-state::
-* variable-set::
-* has-property::
-* re-search::Search for a regular expression
+* Heading is DONE::
+* File Has Headings::
+* Heading TODO State::
+* Lisp Variable Set::
+* Heading Has Property::
+* Regexp Search::Search for a regular expression
 * Negating Conditions::
 
 
@@ -1091,14 +1091,19 @@ File: org-edna.info,  Node: Effort,  Prev: Tag,  Up: 
Actions
 Effort
 --
 
-   • Syntax: set-effort!(VALUE)
+Modifies the effort of all targets.
 
-   Sets the effort of all targets according to VALUE:
+   • Syntax: set-effort!(“VALUE”)
 
-   • If VALUE is a string, then the effort is set to VALUE
-   • If VALUE is an integer, then set the value to the VALUE’th allowed
- effort property
-   • If VALUE is the symbol ’increment, increment effort
+ Set the effort of all targets to “VALUE”.
+
+   • Syntax: set-effort!(NUMBER)
+
+ Sets the effort to the NUMBER’th allowed effort property.
+
+   • Syntax: set-effort!(increment)
+
+ Increment the effort value.
 
 
 File: org-edna.info,  Node: Getting Help,  Prev: Actions,  Up: Basic Features
@@ -1168,29 +1173,29 @@ means block if any target heading isn’t done.
 
 * Menu:
 
-* done::
-* headings::
-* todo-state::
-* variable-set::
-* has-property::
-* re-search::Search for a regular expression
+* Heading is DONE::
+* File Has Headings::
+* Heading TODO State::
+* Lisp Variable Set::
+* Heading Has Property::
+* Regexp Search::Search for a regular expression
 * Negating Conditions::
 
 
-File: org-edna.info,  Node: done,  Next: headings,  Up: Conditions
+File: org-edna.info,  Node: Heading is DONE,  Next: File Has Headings,  Up: 
Conditions
 
-done
-
+Heading is DONE
+---
 
• Syntax: done?
 
Blocks the source heading if any target heading is DONE.
 
 
-File: org-edna.info,  Node: headings,  Next: todo-state,  Prev: done,  Up: 
Conditions
+File: org-edna.info,  Node: File Has Headings,  Next: Heading TODO State,  
Prev: Heading is DONE,  Up: Conditions
 
-headings
-
+File Has Headings
+-
 
• Syntax: headings?
 
@@ -1202,10 +1207,10 @@ Org heading.  This means that target does not have to 
be a heading.
The above example blocks if refile.org has any headings.
 
 
-File: org-edna.info,  Node: todo-state,  Next: variable-set,  Prev: headings,  
Up: Conditions
+File: org-edna.info,  Node: Heading TODO State,  Next: Lisp Variable Set,  
Prev: File Has Headings,  Up: Conditions
 
-todo-state
---
+Heading TODO State
+--
 
• Syntax: todo-state?(STATE)
 
@@ -1214,10 +1219,10 @@ todo-state
STATE may be a string or a symbol.
 
 
-File: org-edna.info,  Node: variable-set,  Next: has-property,  Prev: 
todo-state,  Up: Conditions
+File: org-edna.info,  Node: Lisp Variable Set,  Next: Heading Has Property,  
Prev: Heading TODO State,  Up: Conditions
 
-variable-set
-
+Lisp Variable Set
+-
 
• Syntax: variable-set?(VARIABLE VALUE)
 
@@ -1234,10 +1239,10 @@ self variable-set?(buffer-file-name “org-edna.org”)
  Blocks if the variable ‘buffer-file-name’ is set to “org-edna.org”.
 
 
-File: org-edna.info,  Node: has-property,  Next: re-search,  Prev: 
variable-set,  Up: Conditions
+File: org-edna.info,  Node: Heading Has Property,  Next: Regexp Search,  Prev: 
Lisp Variable Set,  Up: Conditions
 
-has-property
-
+Heading Has Property
+
 
• Syntax: has-property?(“PROPERTY” “VALUE”)
 
@@ -1261,10 +1266,10 @@ to VALUE.
 showered at least three times.
 
 
-File: org-edna.info,  Node: re-search,  Next: Negating Conditions,  Prev: 
has-property,  Up: Conditions
+File: org-edna.info,  Node: Regexp Search,  Next: Negating Conditions,  Prev: 
Heading Has Property,  Up: Conditions
 
-re-search
--
+Regexp Search
+-
 
• Syntax: re-search?(“REGEXP”)
 
@@ -1275,7 +1280,7 @@ in any of the targets.
 other targets as well.
 
 
-File: org-edna.info,  Node: Negating Conditions,  Prev: re-search,  Up: 
Conditions
+File: org-edna.info,  Node: Negating Conditions,  Prev: Regexp Search,  Up: 
Conditions
 
 Negating Conditions
 ---
@@ -1847,80 +1852,80 @@ Big release here, with three new features.
 
 Tag Table:
 Node: Top225
-Node: Copying4165
-Node: Introduction4987
-Node: Installation and Setup5935
-Node: Basic Operation6659
-Node

[elpa] master d5bce9d 133/135: Deprecated org-edna-load and org-edna-unload

2020-02-17 Thread Ian Dunn
branch: master
commit d5bce9db875a7ab2b085aca265ff7f3350d224ba
Author: Ian Dunn 
Commit: Ian Dunn 

Deprecated org-edna-load and org-edna-unload

* org-edna.el (org-edna--load): Renamed from `org-edna-load'.
  (org-edna--unload): Renamed from `org-edna-unload'.
  (org-edna-mode): Use new functions
  (org-edna-load):
  (org-edna-unload): Marked as deprecated in favor of org-edna-mode.

* org-edna.org (Introduction/Installation and Setup): Update to use new 
function.
---
 org-edna.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index af51033..e72dd4c 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.1.0
+;; Version: 1.1.1
 
 ;; This file is part of GNU Emacs.
 
@@ -688,36 +688,36 @@ This shouldn't be run from outside of `org-blocker-hook'."
   t)))
 
 ;;;###autoload
-(defun org-edna-load ()
+(defun org-edna--load ()
   "Setup the hooks necessary for Org Edna to run.
 
 This means adding to `org-trigger-hook' and `org-blocker-hook'."
-  (interactive)
   (add-hook 'org-trigger-hook 'org-edna-trigger-function)
   (add-hook 'org-blocker-hook 'org-edna-blocker-function))
 
+(define-obsolete-function-alias 'org-edna-load 'org-edna-mode)
+
 ;;;###autoload
-(defun org-edna-unload ()
+(defun org-edna--unload ()
   "Unload Org Edna.
 
 Remove Edna's workers from `org-trigger-hook' and
 `org-blocker-hook'."
-  (interactive)
   (remove-hook 'org-trigger-hook 'org-edna-trigger-function)
   (remove-hook 'org-blocker-hook 'org-edna-blocker-function))
 
+(define-obsolete-function-alias 'org-edna-unload 'org-edna-mode)
+
 ;;;###autoload
 (define-minor-mode org-edna-mode
-  "Toggle Org Edna mode.
-
-Calls `org-edna-load' or `org-edna-unload'."
+  "Toggle Org Edna mode."
   :init-value nil
   :lighter " edna"
   :group 'org-edna
   :global t
   (if org-edna-mode
-  (org-edna-load)
-(org-edna-unload)))
+  (org-edna--load)
+(org-edna--unload)))
 
 
 ;;; Finders



[elpa] master cd8c87e 3/4: Updated copyright strings

2020-02-17 Thread Ian Dunn
branch: master
commit cd8c87e7f70a71e9feb786308e17c3c4776b908b
Author: Ian Dunn 
Commit: Ian Dunn 

Updated copyright strings
---
 org-edna.el  | 2 +-
 org-edna.org | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index e72dd4c..68cca82 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1,6 +1,6 @@
 ;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
 ;; Maintainer: Ian Dunn 
diff --git a/org-edna.org b/org-edna.org
index 01dc3d0..eacbd76 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -14,7 +14,7 @@
 #+TEXINFO_DIR_DESC: Extensible Dependencies 'N' Actions for Org Mode tasks
 
 * Copying
-Copyright (C) 2017-2018 Free Software Foundation, Inc.
+Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 #+BEGIN_QUOTE
 This program is free software: you can redistribute it and/or modify



[elpa] master 94edf14 120/135: Added timestamp sorting to relatives finder

2020-02-17 Thread Ian Dunn
branch: master
commit 94edf1470ecb6e09434d3b82ebb6d81944d3a656
Author: Ian Dunn 
Commit: Ian Dunn 

Added timestamp sorting to relatives finder

* org-edna.el (org-edna--get-timestamp-time): New helper function.
  (org-edna-finder/relatives): Use it for timestamp-up and timestamp-down 
forms.

* org-edna-tests.el (org-edna-relatives/sort-timestamp): New test.
  (org-edna-action-deadline/wkdy):
  (org-edna-action-deadline/cp):
  (org-edna-action-deadline/inc):
  (org-edna-action-deadline/landing):
  (org-edna-action-deadline/landing-no-hour):
  (org-edna-action-deadline/float): New tests for deadline.
---
 org-edna-tests.el  | 208 +
 org-edna-tests.org |  15 +++-
 org-edna.el|  35 -
 org-edna.org   |  10 +++
 4 files changed, 262 insertions(+), 6 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 5b0b1e0..6f5fa5e 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -1102,6 +1102,28 @@ This avoids org-id digging into its internal database."
(org-with-point-at current
  (org-edna-finder/relatives arg 'deadline-down size))
 
+(ert-deftest org-edna-relatives/sort-timestamp ()
+  (let* ((start-marker org-edna-test-relative-parent-one)
+ (target-list `(,org-edna-test-relative-child-with-todo
+,org-edna-test-relative-child-with-done
+,org-edna-test-relative-commented-child
+,org-edna-test-relative-child-with-children
+,org-edna-test-relative-standard-child
+,org-edna-test-relative-archived-child))
+ (arg 'step-down)
+ (size (length target-list))
+ (org-agenda-files `(,org-edna-test-file))
+ (current (org-edna-find-test-heading start-marker))
+ (siblings (mapcar
+(lambda (uuid) (org-edna-find-test-heading uuid))
+target-list)))
+(should (equal siblings
+   (org-with-point-at current
+ (org-edna-finder/relatives arg 'timestamp-up size
+(should (equal (nreverse siblings)
+   (org-with-point-at current
+ (org-edna-finder/relatives arg 'timestamp-down size))
+
 (ert-deftest org-edna-cache/no-entry ()
   (let* ((org-edna-finder-use-cache t)
  (org-edna--finder-cache (make-hash-table :test 'equal)))
@@ -1175,6 +1197,8 @@ This avoids org-id digging into its internal database."
   (should (string-equal (org-entry-get nil "TODO") "TODO")))
   (org-edna-test-restore-test-file
 
+;; Scheduled
+
 (ert-deftest org-edna-action-scheduled/wkdy ()
   ;; Override `current-time' so we can get a deterministic value
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
@@ -1358,6 +1382,189 @@ This avoids org-id digging into its internal database."
 "<2000-01-15 Sat 00:00>")))
   (org-edna-test-restore-test-file
 
+(ert-deftest org-edna-action-deadline/wkdy ()
+  ;; Override `current-time' so we can get a deterministic value
+  (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
+ (org-agenda-files `(,org-edna-test-file))
+ (target (org-edna-find-test-heading 
"0d491588-7da3-43c5-b51a-87fbd34f79f7")))
+(unwind-protect
+(org-with-point-at target
+  (org-edna-action/deadline! nil "Mon")
+  (should (string-equal (org-entry-get nil "DEADLINE")
+"<2000-01-17 Mon>"))
+  (org-edna-action/deadline! nil 'rm)
+  (should (not (org-entry-get nil "DEADLINE")))
+  (org-edna-action/deadline! nil "Mon 9:00")
+  (should (string-equal (org-entry-get nil "DEADLINE")
+"<2000-01-17 Mon 09:00>"))
+  (org-edna-action/deadline! nil 'rm)
+  (should (not (org-entry-get nil "DEADLINE"
+  (org-edna-test-restore-test-file
+
+(ert-deftest org-edna-action-deadline/cp ()
+  (let* ((org-agenda-files `(,org-edna-test-file))
+ (target (org-edna-find-test-heading 
"0d491588-7da3-43c5-b51a-87fbd34f79f7"))
+ (source (org-edna-find-test-heading 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5"))
+ (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . 
"remove"
+(unwind-protect
+(org-with-point-at target
+  (dolist (pair pairs)
+(org-edna-action/deadline! source (car pair))
+(should (string-equal (org-entry-get nil "DEADLINE")
+  "<2000-01-15 Sat 00:00>"))
+(or

[elpa] master eab857e 2/4: Updated documentation

2020-02-17 Thread Ian Dunn
branch: master
commit eab857eee25d8f5ed01c6fbf3279121da67ad2b0
Author: Ian Dunn 
Commit: Ian Dunn 

Updated documentation
---
 org-edna.org | 5 +
 1 file changed, 5 insertions(+)

diff --git a/org-edna.org b/org-edna.org
index 4053e78..01dc3d0 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1643,6 +1643,11 @@ making any changes:
 :PROPERTIES:
 :DESCRIPTION: List of changes by version
 :END:
+** 1.1.1
+- Marked ~org-edna-load~ and ~org-edna-unload~ as deprecated
+- Renamed to ~org-edna--load~ and ~org-edna--unload~ to reflect internal use 
only intention
+** 1.1.0
+- Added ~org-edna-mode~ as a minor mode, as opposed to ~org-edna-load~ and 
~org-edna-unload~
 ** 1.0.2
 - Added ~org-edna-reset-cache~ to allow a user to reset the finder cache
 



[elpa] master 97b6600 119/135: Additional tests and minor cleanup

2020-02-17 Thread Ian Dunn
branch: master
commit 97b6600954bf6589c9972282d303a05c3803f521
Author: Ian Dunn 
Commit: Ian Dunn 

Additional tests and minor cleanup

* org-edna.el: Added some section headers.

* org-edna-tests.el (org-edna-doc-test/ancestors-cache):
  (org-edna-doc-test/descendants-cache):
  (org-edna-doc-test/laundry-cache):
  (org-edna-doc-test/nightly-cache): Added tests for run-through with cache.
---
 org-edna-tests.el | 171 +-
 org-edna.el   |   7 ++-
 2 files changed, 174 insertions(+), 4 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index da8e437..5b0b1e0 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -3,9 +3,6 @@
 ;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
-;; Keywords: convenience, text, org
-;; Version: 1.0
-;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "8.0"))
 
 ;; This file is NOT part of GNU Emacs.
 
@@ -1646,6 +1643,39 @@ This avoids org-id digging into its internal database."
   (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom 
heading5-pom
   (org-edna-test-restore-test-file
 
+(ert-deftest org-edna-doc-test/ancestors-cache ()
+  (let* ((start-heading (org-edna-find-test-heading 
"24a0c3bb-7e69-4e9e-bb98-5aba2ff17bb1"))
+ (org-todo-keywords '((sequence "TODO" "|" "DONE")))
+ ;; Only block based on Edna
+ (org-blocker-hook 'org-edna-blocker-function)
+ ;; Enable cache
+ (org-edna-finder-use-cache t))
+(unwind-protect
+(org-with-point-at start-heading
+  (save-restriction
+;; Only allow operating on the current tree
+(org-narrow-to-subtree)
+;; Show the entire subtree
+(outline-show-all)
+(let* ((heading1-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading2-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading3-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading4-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading5-pom (progn (org-next-visible-heading 1) 
(point-marker
+  ;; Verify that we can't change the TODO state to DONE
+  (should (org-edna-test-check-block heading5-pom "Initial state 
of heading 5"))
+  ;; Change the state at 4 to DONE
+  (org-edna-test-change-todo-state heading4-pom "DONE")
+  ;; Verify that ALL ancestors need to be changed
+  (should (org-edna-test-check-block heading5-pom "Heading 5 after 
parent changed"))
+  (org-edna-test-mark-done heading1-pom heading3-pom)
+  ;; Only need 1, 3, and 4 to change 5
+  (should (not (org-edna-test-check-block heading5-pom
+"Heading 5 after all 
parents changed")))
+  ;; Change the state back to TODO on all of them
+  (org-edna-test-mark-todo heading1-pom heading3-pom heading4-pom 
heading5-pom
+  (org-edna-test-restore-test-file
+
 (ert-deftest org-edna-doc-test/descendants ()
   (let* ((start-heading (org-edna-find-test-heading 
"cc18dc74-00e8-4081-b46f-e36800041fe7"))
  (org-todo-keywords '((sequence "TODO" "|" "DONE")))
@@ -1682,6 +1712,44 @@ This avoids org-id digging into its internal database."
   (should (not (org-edna-test-check-block heading1-pom "Heading 1 
after changing 5"))
   (org-edna-test-restore-test-file
 
+(ert-deftest org-edna-doc-test/descendants-cache ()
+  (let* ((start-heading (org-edna-find-test-heading 
"cc18dc74-00e8-4081-b46f-e36800041fe7"))
+ (org-todo-keywords '((sequence "TODO" "|" "DONE")))
+ ;; Only block based on Edna
+ (org-blocker-hook 'org-edna-blocker-function)
+ ;; Enable cache
+ (org-edna-finder-use-cache t))
+(unwind-protect
+(org-with-point-at start-heading
+  (save-restriction
+;; Only allow operating on the current tree
+(org-narrow-to-subtree)
+;; Show the entire subtree
+(outline-show-all)
+(let* ((heading1-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading2-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading3-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading4-pom (progn (org-next-visible-heading 1) 
(point-marker)))
+   (heading5-pom (progn (org-next-visible-heading 1) 
(point-marker
+  (should (org-edna-test-check-block heading1-pom "Heading 1 
i

[elpa] master 1b05e1e 131/135: Fixed failing tests

2020-02-17 Thread Ian Dunn
branch: master
commit 1b05e1e2b6b5c66b4fad338dc94ddc6605cde5b9
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed failing tests

* org-edna-tests.el (org-test-at-time): Added to keep up with org mode 
changes.
  (org-edna-test-setup): Use it.
---
 org-edna-tests.el | 59 ---
 org-edna.el   |  4 ++--
 2 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index c877321..d044e3d 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -76,12 +76,65 @@
  ;; Change the test file back to its original state.
  (org-edna-test-restore-test-file)))
 
+;; Copied from org-test.el in `org-mode' source code.
+(defmacro org-test-at-time (time  body)
+  "Run body while pretending that the current time is TIME.
+TIME can be a non-nil Lisp time value, or a string specifying a date and time."
+  (declare (indent 1))
+  (let ((tm (cl-gensym))
+   (at (cl-gensym)))
+`(let* ((,tm ,time)
+   (,at (if (stringp ,tm)
+(apply #'encode-time (org-parse-time-string ,tm))
+  ,tm)))
+   (cl-letf
+  ;; Wrap builtins whose behavior can depend on the current time.
+  (((symbol-function 'current-time)
+(lambda () ,at))
+   ((symbol-function 'current-time-string)
+(lambda ( time  args)
+  (apply ,(symbol-function 'current-time-string)
+ (or time ,at) args)))
+   ((symbol-function 'current-time-zone)
+(lambda ( time  args)
+  (apply ,(symbol-function 'current-time-zone)
+ (or time ,at) args)))
+   ((symbol-function 'decode-time)
+(lambda ( time) (funcall ,(symbol-function 'decode-time)
+  (or time ,at
+   ((symbol-function 'encode-time)
+(lambda (time  args)
+  (apply ,(symbol-function 'encode-time) (or time ,at) args)))
+   ((symbol-function 'float-time)
+(lambda ( time)
+  (funcall ,(symbol-function 'float-time) (or time ,at
+   ((symbol-function 'format-time-string)
+(lambda (format  time  args)
+  (apply ,(symbol-function 'format-time-string)
+ format (or time ,at) args)))
+   ((symbol-function 'set-file-times)
+(lambda (file  time)
+  (funcall ,(symbol-function 'set-file-times) file (or time ,at
+   ((symbol-function 'time-add)
+(lambda (a b) (funcall ,(symbol-function 'time-add)
+   (or a ,at) (or b ,at
+   ((symbol-function 'time-equal-p)
+(lambda (a b) (funcall ,(symbol-function 'time-equal-p)
+   (or a ,at) (or b ,at
+   ((symbol-function 'time-less-p)
+(lambda (a b) (funcall ,(symbol-function 'time-less-p)
+   (or a ,at) (or b ,at
+   ((symbol-function 'time-subtract)
+(lambda (a b) (funcall ,(symbol-function 'time-subtract)
+   (or a ,at) (or b ,at)
+,@body
+
 (defmacro org-edna-test-setup ( body)
   "Common settings for tests."
   (declare (indent 0))
   ;; Override `current-time' so we can get a deterministic value
-  `(cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
-  ;; Only use the test file in the agenda
+  `(org-test-at-time org-edna-test-time
+ (let* (;; Only use the test file in the agenda
   (org-agenda-files `(,org-edna-test-file))
   ;; Ensure interactive modification of TODO states works.
   (org-todo-keywords '((sequence "TODO" "|" "DONE")))
@@ -91,7 +144,7 @@
   (org-trigger-hook 'org-edna-trigger-function)
   ;; Inhibit messages if indicated
   (inhibit-message org-edna-test-inhibit-messages))
- ,@body))
+   ,@body)))
 
 (defmacro org-edna-with-point-at-test-heading (heading-id  body)
   (declare (indent 1))
diff --git a/org-edna.el b/org-edna.el
index 1cdc52b..38aff93 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -971,8 +971,8 @@ All arguments are symbols, unless noted otherwise.
 ('step-down
  (setq targets
(org-with-wide-buffer
-(org-goto-first-child)
-(org-edna-collect-current-level (org-edna-self-marker) nil nil 
t
+(when (org-goto-first-child)
+  (org-edna-collect-current-level (org-edna-self-marker) nil 
nil t)
 ('todo-only
  ;; Remove any entry without a TODO keyword, or with a DONE keyword
  (cl-pushnew



[elpa] master 24a0228 059/135: Added tests for actions

2020-02-17 Thread Ian Dunn
branch: master
commit 24a022843df5825f654aacc8313368c9f22287a1
Author: Ian D 
Commit: Ian D 

Added tests for actions

* org-edna.el (org-edna-prompt-for-archive): New defcustom.
  (org-edna-action/archive!): Use it.
  (org-edna-action/delete-property!): New action.

* org-edna-tests.el: Added tests for the remaining actions.

* org-edna-tests.org: Added some more test headings.
---
 org-edna-tests.el  | 73 ++
 org-edna-tests.org |  8 ++
 org-edna.el| 13 +-
 3 files changed, 93 insertions(+), 1 deletion(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 4698e52..27110b3 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -27,6 +27,7 @@
 
 (require 'org-edna)
 (require 'ert)
+(require 'org-id)
 
 (defconst org-edna-test-dir
   (expand-file-name (file-name-directory (or load-file-name 
buffer-file-name
@@ -49,6 +50,7 @@
 (defconst org-edna-test-id-heading-two   
"b010cbad-60dc-46ef-a164-eb155e62cbb2")
 (defconst org-edna-test-id-heading-three 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5")
 (defconst org-edna-test-id-heading-four  
"7d4d564b-18b2-445c-a0c8-b1b3fb9ad29e")
+(defconst org-edna-test-archive-heading  
"d7668277-f959-43ba-8e85-8a3c76996862")
 
 (defun org-edna-find-test-heading (id)
   "Find the test heading with id ID."
@@ -366,6 +368,77 @@
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-15 Sat 00:00>")
 
+(ert-deftest org-edna-action-tag ()
+  (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)))
+(org-with-point-at pom
+  (org-edna-action/tag! nil "tag")
+  (should (equal (org-get-tags) '("tag")))
+  (org-edna-action/tag! nil "")
+  (should-not (org-get-tags)
+
+(ert-deftest org-edna-action-property ()
+  (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)))
+(org-with-point-at pom
+  (org-edna-action/set-property! nil "TEST" "1")
+  (should (equal (org-entry-get nil "TEST") "1"))
+  (org-edna-action/delete-property! nil "TEST")
+  (should-not (org-entry-get nil "TEST")
+
+(ert-deftest org-edna-action-clock ()
+  (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)))
+(org-with-point-at pom
+  (org-edna-action/clock-in! nil)
+  (should (org-clocking-p))
+  (should (equal org-clock-hd-marker pom))
+  (org-edna-action/clock-out! nil)
+  (should-not (org-clocking-p)
+
+(ert-deftest org-edna-action-priority ()
+  (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one))
+(org-lowest-priority  ?C)
+(org-highest-priority ?A)
+(org-default-priority ?B))
+(org-with-point-at pom
+  (org-edna-action/set-priority! nil "A")
+  (should (equal (org-entry-get nil "PRIORITY") "A"))
+  (org-edna-action/set-priority! nil 'down)
+  (should (equal (org-entry-get nil "PRIORITY") "B"))
+  (org-edna-action/set-priority! nil 'up)
+  (should (equal (org-entry-get nil "PRIORITY") "A"))
+  (org-edna-action/set-priority! nil ?C)
+  (should (equal (org-entry-get nil "PRIORITY") "C"))
+  (org-edna-action/set-priority! nil 'remove)
+  (should (equal (org-entry-get nil "PRIORITY") "B")
+
+(ert-deftest org-edna-action-effort ()
+  (let ((pom (org-edna-find-test-heading org-edna-test-id-heading-one)))
+(org-with-point-at pom
+  (org-edna-action/set-effort! nil "0:01")
+  (should (equal (org-entry-get nil "EFFORT") "0:01"))
+  (org-edna-action/set-effort! nil 'increment)
+  (should (equal (org-entry-get nil "EFFORT") "0:02"))
+  (org-entry-delete nil "EFFORT"
+
+(ert-deftest org-edna-action-archive ()
+  (let ((org-archive-save-context-info '(todo))
+(pom (org-edna-find-test-heading org-edna-test-archive-heading))
+;; Archive it to the same location
+(org-archive-location "::** Archive")
+(org-edna-prompt-for-archive nil))
+(org-with-point-at pom
+  (org-edna-action/archive! nil)
+  (should (equal (org-entry-get nil "ARCHIVE_TODO") "TODO"))
+  (org-entry-delete nil "ARCHIVE_TODO"
+
+(ert-deftest org-edna-action-chain ()
+  (let ((old-pom (org-edna-find-test-heading org-edna-test-id-heading-one))
+(new-pom (org-edna-find-test-heading org-edna-test-id-heading-two)))
+(org-entry-put old-pom "TEST" "1")
+(org-with-point-at new-pom
+  (org-edna-action/chain! old-pom "TEST")
+  (should (equal (org-entry-get nil "TEST") "1")))
+(or

[elpa] master updated (bf8ecda -> ccc0814)

2020-02-17 Thread Ian Dunn
skolar42 pushed a change to branch master.

  from  bf8ecda   Add 'packages/org-edna/' from commit 
'd5bce9db875a7ab2b085aca265ff7f3350d224ba'
   new  e7b0bb0   Updated documentation
   new  eab857e   Updated documentation
   new  cd8c87e   Updated copyright strings
   new  ccc0814   Merge commit 'cd8c87e7f70a71e9feb786308e17c3c4776b908b'


Summary of changes:
 packages/org-edna/org-edna.el   |   2 +-
 packages/org-edna/org-edna.info | 172 
 packages/org-edna/org-edna.org  |  13 ++-
 3 files changed, 98 insertions(+), 89 deletions(-)



[elpa] master c02a28f 117/135: Various fixes from testing

2020-02-17 Thread Ian Dunn
branch: master
commit c02a28f3883a5b0189357b71a93944063079a87c
Author: Ian Dunn 
Commit: Ian Dunn 

Various fixes from testing

* org-edna.el (org-edna--function-for-key): Return nil on invalid input
  (org-edna--expand-single-sexp-form): Quote arguments to consideration.
  (org-edna-finder/match): Introduced 'buffer SCOPE to match the nil 
argument in
  org-map-entries.

* org-edna-tests.el: Protect all access to the test file in unwind-protect.
  Use `org-edna-find-test-heading' in all tests instead of org-id-find.
  (org-edna-test-restore-test-file): New function to revert test file.
  (org-edna-test-compare-todos):
  (org-edna-test-change-todo-state):
  (org-edna-test-check-block):
  (org-edna-test-mark-done):
  (org-edna-test-mark-todo): New helper functions.
  (org-edna-doc-test/ancestors):
  (org-edna-doc-test/descendants):
  (org-edna-doc-test/laundry):
  (org-edna-doc-test/nightly):
  (org-edna-doc-test/daily):
  (org-edna-doc-test/weekly):
  (org-edna-doc-test/basic-shower): New full tests from the documentation.

* org-edna.org (Scheduled/Deadline): Fixed up examples to render on info.
  (TODO State): Added example.
  (Chain Property): Added example.
  (Property): Fixed examples.
  (Conditions): Changed heading names.
---
 org-edna-tests.el  | 963 +++--
 org-edna-tests.org | 131 
 org-edna.el|  19 +-
 org-edna.info  | 192 +++
 org-edna.org   | 107 --
 5 files changed, 1006 insertions(+), 406 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index da766a9..da8e437 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -64,10 +64,42 @@
 (defconst org-edna-test-relative-archived-child 
"a4b6131e-0560-4201-86d5-f32b36363431")
 (defconst org-edna-test-relative-child-with-done 
"4a1d74a2-b032-47da-a823-b32f5cab0aae")
 
+(defun org-edna-test-restore-test-file ()
+  "Restore the test file back to its original state."
+  (with-current-buffer (get-file-buffer org-edna-test-file)
+(revert-buffer nil t)))
+
 (defun org-edna-find-test-heading (id)
-  "Find the test heading with id ID."
+  "Find the test heading with id ID.
+
+This avoids org-id digging into its internal database."
   (org-id-find-id-in-file id org-edna-test-file t))
 
+;; _test exists to give more detailed reports in ERT output.
+(defun org-edna-test-compare-todos (pom expected-state _test)
+  (string-equal (org-entry-get pom "TODO") expected-state))
+
+(defun org-edna-test-change-todo-state (pom new-state)
+  (org-with-point-at pom (org-todo new-state)))
+
+(defun org-edna-test-check-block (pom _test)
+  "Check if the heading at point-or-marker POM is blocked."
+  (org-edna-test-change-todo-state pom "DONE")
+  (org-edna-test-compare-todos pom "TODO" _test))
+
+(defun org-edna-test-mark-done ( poms)
+  "Mark all points-or-markers in POMS as DONE."
+  (dolist (pom poms)
+(org-edna-test-change-todo-state pom "DONE")))
+
+(defun org-edna-test-mark-todo ( poms)
+  "Mark all points-or-markers in POMS as TODO."
+  (dolist (pom poms)
+(org-edna-test-change-todo-state pom "TODO")))
+
+
+ Parser Tests
+
 (ert-deftest org-edna-parse-form-no-arguments ()
   (let* ((input-string "test-string")
  (parsed   (org-edna-parse-string-form input-string)))
@@ -471,7 +503,7 @@
 
 (ert-deftest org-edna-finder/match-blocker ()
   (let* ((org-agenda-files `(,org-edna-test-file))
- (heading (org-id-find "caccd0a6-d400-410a-9018-b0635b07a37e" t))
+ (heading (org-edna-find-test-heading 
"caccd0a6-d400-410a-9018-b0635b07a37e"))
  (blocker (org-entry-get heading "BLOCKER"))
  blocking-entry)
 (should (string-equal "match(\"test&1\")" blocker))
@@ -499,16 +531,16 @@
 
 (ert-deftest org-edna-finder/self ()
   (let* ((org-agenda-files `(,org-edna-test-file))
- (current (org-id-find "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c" t))
+ (current (org-edna-find-test-heading 
"82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c"))
  (targets (org-with-point-at current (org-edna-finder/self
 (should (= (length targets) 1))
 (should (equal current (nth 0 targets)
 
 (ert-deftest org-edna-finder/siblings ()
   (let* ((org-agenda-files `(,org-edna-test-file))
- (current (org-id-find org-edna-test-sibling-one-id t))
+ (current (org-edna-find-test-heading org-edna-test-sibling-one-id))
  (siblings (mapcar
-(lambda (uuid) (org-id-find uuid t))
+(lambda (uuid) (org-edna-find-test-heading uuid))
 `(,org-edna-test-sibling-one-id
   ,org-edna-test-sibling-two-id
 

[elpa] master fd1de2f 125/135: Fixed stacking multiple conditions

2020-02-17 Thread Ian Dunn
branch: master
commit fd1de2f180c97fd52ae4843ca3e2d04f26c91f97
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed stacking multiple conditions

* org-edna.el (org-edna--normalize-sexp-form): Only set state if not 
breaking.
  (org-edna--expand-sexp-form): Properly handle blocking-var.

* org-edna-tests.el (org-edna-expand-sexp-form):
  (org-edna-expand-sexp-form-multiple):
  (org-edna-expand-sexp-form-if-else):
  (org-edna-expand-sexp-form-if-no-else): Removed buggy expansion tests.
  (org-edna-doc-test/multiple-blockers): Added test for multiple blockers.

* org-edna.org (Multiple Blockers): Added section.
---
 org-edna-tests.el  | 204 +++--
 org-edna-tests.org |  13 
 org-edna.el|  25 +--
 org-edna.info  | 198 ++-
 org-edna.org   |  28 +++-
 5 files changed, 202 insertions(+), 266 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index b6adf15..331438f 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -336,183 +336,6 @@ This avoids org-id digging into its internal database."
 ;; Error should point to the start of the if-statement
 (should (eq (plist-get data :error-pos) 45
 
-(ert-deftest org-edna-expand-sexp-form ()
-  ;; Override cl-gentemp so we have a repeatable test
-  (cl-letf* (((symbol-function 'cl-gentemp) (lambda ( prefix) (intern 
(format "%s1" prefix
- (input-sexp '((self)
-   (!done?)))
- (output-form (org-edna--expand-sexp-form input-sexp)))
-(should (equal
- output-form
- '(let ((targets1 nil)
-(consideration1 nil)
-(blocking-entry1 nil))
-(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self 'nil)))
-(setq blocking-entry1
-  (or blocking-entry1
-  (org-edna--handle-condition 'org-edna-condition/done?
-  '! 'nil targets1
-  consideration1
-
-(ert-deftest org-edna-expand-sexp-form-multiple ()
-  (cl-letf* ((target-ctr 0)
- (consideration-ctr 0)
- (blocking-entry-ctr 0)
- ((symbol-function 'cl-gentemp)
-  (lambda ( prefix)
-(let ((ctr (pcase prefix
- ("targets" (cl-incf target-ctr))
- ("consideration" (cl-incf consideration-ctr))
- ("blocking-entry" (cl-incf blocking-entry-ctr))
- (_ 0
-  (intern (format "%s%s" prefix ctr)
- (input-sexp '(((match "checklist")
-(todo! DONE))
-   ((siblings)
-(todo! TODO
- (expected-form
-  '(let ((targets1 nil)
- (consideration1 nil)
- (blocking-entry1 nil))
- ;; Don't need a new set of variables
- (let ((targets2 targets1)
-   (consideration2 consideration1)
-   (blocking-entry2 blocking-entry1))
-   (setq targets2
- (org-edna--add-targets targets2
-(org-edna--handle-finder 
'org-edna-finder/match '("checklist"
-   (org-edna--handle-action 'org-edna-action/todo!
-targets2
-(point-marker)
-'(DONE)))
- (let ((targets5 targets1)
-   (consideration5 consideration1)
-   (blocking-entry5 blocking-entry1))
-   (setq targets5
- (org-edna--add-targets targets5
-(org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
-   (org-edna--handle-action 'org-edna-action/todo!
-targets5
-(point-marker)
-'(TODO)
- (output-form (org-edna--expand-sexp-form input-sexp)))
-(should (equal output-form expected-form
-
-(ert-deftest org-edna-expand-sexp-form-if-else ()
-  (cl-letf* ((target-ctr 0)
- (consideration-ctr 0)
- (blocking-entry-ctr 0)
- ((symbol-function 'cl-gentemp)
-  (lambda ( prefix)
-(let ((ctr (pcase prefix
- ("targets" (cl-incf target-ctr))
- ("consi

[elpa] master a9af45f 092/135: Added links in "Changelog"

2020-02-17 Thread Ian Dunn
branch: master
commit a9af45fbf6b9ed0f1d87a5637cc6dbbeb1ed1698
Author: Ian Dunn 
Commit: Ian Dunn 

Added links in "Changelog"

* org-edna.org (Changelog): Added links
---
 org-edna.org | 9 -
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/org-edna.org b/org-edna.org
index b6d85eb..9c1dbf4 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1151,6 +1151,9 @@ making any changes:
be read on a white background; we recommend the "adwaita" theme
 
 * Changelog
+:PROPERTIES:
+:DESCRIPTION: List of changes by version
+:END:
 ** 1.0beta2
 Big release here, with three new features.
 
@@ -1160,9 +1163,13 @@ See [[#setting_keywords][Setting the Properties]] for 
how to do that
 *** New uses of schedule! and deadline!
 - New "float" form that mimics diary-float
 - New "landing" addition to "+1d" and friends to force planning changes to 
land on a certain day or type of day (weekend/weekday)
+- See [[#planning][Scheduled/Deadline]] for details
 
 *** New "relatives" finder
 - Renamed from chain-find with tons of new keywords
 - Modified all other relative finders (previous-sibling, first-child, etc.) to 
use the same keywords
+- See [[#relatives][relatives]] for details
 
-*** New finders: previous-sibling-wrap and rest-of-siblings-wrap
+*** New finders
+- [[#previous-sibling-wrap][previous-sibling-wrap]]
+- [[#rest-of-siblings-wrap][rest-of-siblings-wrap]]



[elpa] master a3183b2 105/135: Bumped version

2020-02-17 Thread Ian Dunn
branch: master
commit a3183b29fd352835a076bff7768de35f808afb72
Author: Ian Dunn 
Commit: Ian Dunn 

Bumped version
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index a4d9d3e..9974e3a 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0beta5
+;; Version: 1.0beta6
 
 ;; This file is part of GNU Emacs.
 



[elpa] master dcad8cc 113/135: Added org-edna-describe-keyword function

2020-02-17 Thread Ian Dunn
branch: master
commit dcad8cc8085843ddd2f172aadf5c0456df13de37
Author: Ian Dunn 
Commit: Ian Dunn 

Added org-edna-describe-keyword function

* org-edna.el (org-edna--function-for-key): Return
  `org-edna-handle-consideration' for consideration and consider keywords.
  (org-edna-describe-keyword): New function.

* org-edna.org (Getting Help): New section.
---
 org-edna.el   |  29 ++-
 org-edna.info | 164 --
 org-edna.org  |  13 +
 3 files changed, 130 insertions(+), 76 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index e271cb0..ee10b17 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -129,8 +129,9 @@ If KEY is an invalid Edna keyword, then return nil."
((or (not key)
 (not (symbolp key
((memq key '(consideration consider))
-;; Function is ignored here
-(cons 'consideration 'identity))
+;; Function is ignored here, but `org-edna-describe-keyword' needs this
+;; function.
+(cons 'consideration 'org-edna-handle-consideration))
((string-suffix-p "!" (symbol-name key))
 ;; Action
 (let ((func-sym (intern (format "org-edna-action/%s" key
@@ -2221,6 +,30 @@ PRED, and ACTION."
   (when-let* ((bounds (bounds-of-thing-at-point 'symbol)))
 (list (car bounds) (cdr bounds) 'org-edna-completion-table-function)))
 
+(defun org-edna-describe-keyword (keyword)
+  "Describe the Org Edna keyword KEYWORD.
+
+KEYWORD should be a string for a keyword recognized by edna.
+
+Displays help for KEYWORD in the Help buffer."
+  (interactive
+   (list
+(completing-read
+ "Keyword: "
+ `(,@(org-edna--collect-finders)
+   ,@(org-edna--collect-actions)
+   ,@(org-edna--collect-conditions)
+   "consideration" "consider")
+ nil ;; No filter predicate
+ t))) ;; require match
+  ;; help-split-fundoc splits the usage info from the rest of the 
documentation.
+  ;; This avoids having another usage line in the keyword documentation that 
has
+  ;; nothing to do with how edna expects the function.
+  (pcase-let* ((`(,_type . ,func) (org-edna--function-for-key (intern 
keyword)))
+   (`(,_usage . ,doc) (help-split-fundoc (documentation func t) 
func)))
+(with-help-window (help-buffer)
+  (princ doc
+
 
 
 (declare-function lm-report-bug "lisp-mnt" (topic))
diff --git a/org-edna.info b/org-edna.info
index 4f29ebe..07c97ff 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -36,6 +36,7 @@ Basic Features
 
 * Finders::  How to find targets
 * Actions::  Next steps
+* Getting Help:: Getting some help
 
 Finders
 
@@ -314,6 +315,7 @@ The most basic features of Edna are *finders* and *actions*.
 
 * Finders::  How to find targets
 * Actions::  Next steps
+* Getting Help:: Getting some help
 
 
 File: org-edna.info,  Node: Finders,  Next: Actions,  Up: Basic Features
@@ -758,7 +760,7 @@ when it reaches the end.
Identical to the *note rest-of-siblings-wrap:: finder.
 
 
-File: org-edna.info,  Node: Actions,  Prev: Finders,  Up: Basic Features
+File: org-edna.info,  Node: Actions,  Next: Getting Help,  Prev: Finders,  Up: 
Basic Features
 
 Actions
 ===
@@ -1055,6 +1057,19 @@ Effort
• If VALUE is the symbol ’increment, increment effort
 
 
+File: org-edna.info,  Node: Getting Help,  Prev: Actions,  Up: Basic Features
+
+Getting Help
+
+
+Edna provides help for any keyword with ‘M-x org-edna-describe-keyword’.
+When invoked, a list of keywords (finders, actions, etc.)  known to Edna
+will be provided.  Select any one to get its description.
+
+   This description includes the syntax and an explanation of what the
+keyword does.  Some descriptions also contain examples.
+
+
 File: org-edna.info,  Node: Advanced Features,  Next: Extending Edna,  Prev: 
Basic Features,  Up: Top
 
 Advanced Features
@@ -1760,79 +1775,80 @@ Big release here, with three new features.
 
 Tag Table:
 Node: Top225
-Node: Copying4114
-Node: Introduction4936
-Node: Installation and Setup5884
-Node: Basic Operation6608
-Node: Blockers8459
-Node: Triggers8745
-Node: Syntax9007
-Node: Basic Features9697
-Node: Finders1
-Node: ancestors11765
-Node: children12359
-Node: descendants12769
-Node: file13291
-Node: first-child14040
-Node: ids14300
-Node: match14961
-Node: next-sibling15599
-Node: next-sibling-wrap15856
-Node: olp16170
-Node: org-file16582
-Node: parent17227
-Node: previous-sibling17425
-Node: previous-sibling-wrap17686
-Node: relatives17965
-Node: rest-of-siblings21586
-Node: rest-of-siblings-wrap21871
-Node: self0
-Node: siblings22381
-Node: siblings-wrap22618
-Node: Actions22922
-Node: Scheduled/Deadline23664
-Node: TODO State27239
-Node: Archive27607
-Node: Chain Property27927
-Node: Clocking

[elpa] master 342f3dd 109/135: Improved contributing section in documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 342f3dd7207ca934002f982bb8a7f5c516e8a684
Author: Ian Dunn 
Commit: Ian Dunn 

Improved contributing section in documentation

* org-edna.org (Installation and Setup): Removed compilation instructions.
  (Finder Cache): New section documenting cache setup.
  (Working with EDE): New section about EDE.
  (Compiling Edna): New section about compiling Edna.
  (Testing Edna): New section on how to test Edna.
  (Before Sending Changes): Moved out of "development"
  (Developing with Bazaar): Moved out of "development"
  (Development): Removed.
  (Changelog): Updated.
---
 org-edna.info | 322 ++
 org-edna.org  | 152 ---
 2 files changed, 373 insertions(+), 101 deletions(-)

diff --git a/org-edna.info b/org-edna.info
index 33b6708..fde1e6e 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -76,6 +76,7 @@ Actions
 
 Advanced Features
 
+* Finder Cache:: Making the finders work faster
 * Conditions::   More than just DONE headings
 * Consideration::Only some of them
 * Conditional Forms::If/Then/Else
@@ -102,11 +103,16 @@ Extending Edna
 Contributing
 
 * Bugs::
-* Development::
+* Working with EDE:: And all its quirks
+* Compiling Edna::   How to compile Edna
+* Testing Edna:: Ensuring Edna works the way we think she will
+* Before Sending Changes::   Follow these instructions before sending us 
anything
+* Developing with Bazaar::   How to use this strange VCS
 * Documentation::Improving the documentation
 
 Changelog
 
+* 1.0beta7: 10beta7.
 * 1.0beta6: 10beta6.
 * 1.0beta5: 10beta5.
 * 1.0beta4: 10beta4.
@@ -184,13 +190,12 @@ org 9.0.5
From Source:
 
  bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna
- make -C org-edna compile autoloads
 
After that, add the following to your init file (typically .emacs):
 
  ;; Only necessary if installing from source
  (add-to-list 'load-path "/full/path/to/org-edna/")
- (load "/path/to/org-edna/org-edna-autoloads.el")
+ (require 'org-edna)
 
  ;; Always necessary
  (org-edna-load)
@@ -1056,13 +1061,39 @@ Advanced Features
 
 * Menu:
 
+* Finder Cache:: Making the finders work faster
 * Conditions::   More than just DONE headings
 * Consideration::Only some of them
 * Conditional Forms::If/Then/Else
 * Setting the Properties::   The easy way to set BLOCKER and TRIGGER
 
 
-File: org-edna.info,  Node: Conditions,  Next: Consideration,  Up: Advanced 
Features
+File: org-edna.info,  Node: Finder Cache,  Next: Conditions,  Up: Advanced 
Features
+
+Finder Cache
+
+
+Some finders, ‘match’ in particular, can take a long time to run.
+Oftentimes, this can make it unappealing to use Edna at all, especially
+with long checklists.
+
+   The finder cache is one solution to this.  To enable it, set
+‘org-edna-finder-use-cache’ to non-nil.  This can be done through the
+customization interface, or manually with ‘setq’.
+
+   When enabled, the cache will store the results of every finder form
+for a configurable amount of time.  This timeout is controlled by
+‘org-edna-finder-cache-timeout’.  The cache is also invalidated if any
+of the results are invalid, which can happen if their target files have
+been closed.
+
+   For example, if there are several entries in a checklist that all use
+the form ‘match("daily")’ as part of their trigger, the results of that
+form will be cached.  When the next item is marked as DONE, the results
+will be searched for in cache, not recomputed.
+
+
+File: org-edna.info,  Node: Conditions,  Next: Consideration,  Prev: Finder 
Cache,  Up: Advanced Features
 
 Conditions
 ==
@@ -1441,11 +1472,15 @@ We are all happy for any help you may provide.
 * Menu:
 
 * Bugs::
-* Development::
+* Working with EDE:: And all its quirks
+* Compiling Edna::   How to compile Edna
+* Testing Edna:: Ensuring Edna works the way we think she will
+* Before Sending Changes::   Follow these instructions before sending us 
anything
+* Developing with Bazaar::   How to use this strange VCS
 * Documentation::Improving the documentation
 
 
-File: org-edna.info,  Node: Bugs,  Next: Development,  Up: Contributing
+File: org-edna.info,  Node: Bugs,  Next: Working with EDE,  Up: Contributing
 
 Bugs
 
@@ -1459,10 +1494,111 @@ There are two ways to submit bug reports:
 caused the bug, with as much context as possible.
 
 
-File: org-edna.info,  Node: Development,  Next: Documentation,  Prev: Bugs,  
Up: Contributing
+File: org-edna.info,  Node: Working with EDE,  Next: Compiling Edna,  Prev: 
Bugs,  Up: Contributing
+
+Working with EDE
+
+
+Our 

[elpa] master 4c8058f 129/135: Step down should not include the headline itself when it has no children.

2020-02-17 Thread Ian Dunn
branch: master
commit 4c8058fee983504392f024620fa01ef146197af8
Author: Alex Roper 
Commit: al...@productionimage.aroper.net 

Step down should not include the headline itself when it has no children.
---
 org-edna.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 1cdc52b..edcf66e 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -971,8 +971,8 @@ All arguments are symbols, unless noted otherwise.
 ('step-down
  (setq targets
(org-with-wide-buffer
-(org-goto-first-child)
-(org-edna-collect-current-level (org-edna-self-marker) nil nil 
t
+(when (org-goto-first-child)
+(org-edna-collect-current-level (org-edna-self-marker) nil nil 
t)
 ('todo-only
  ;; Remove any entry without a TODO keyword, or with a DONE keyword
  (cl-pushnew



[elpa] master e6d38ec 086/135: Added relatives finder

2020-02-17 Thread Ian Dunn
branch: master
commit e6d38ecc0b7545fa5a3b32da8fbac42633e67658
Author: Ian Dunn 
Commit: Ian Dunn 

Added relatives finder

* org-edna.el (org-edna-first-sibling):
  (org-edna-last-sibling):
  (org-edna-goto-sibling):
  (org-edna-self-marker):
  (org-edna-collect-current-level):
  (org-edna-collect-ancestors):
  (org-edna-collect-descendants):
  (org-edna-entry-has-tags-p): New helper functions for relatives finder.
  (org-edna-finder/relatives): New defun.
  (org-edna-finder/chain-find): Alias to org-edna-finder/relatives.
  (org-edna-finder/siblings):
  (org-edna-finder/siblings-wrap):
  (org-edna-finder/rest-of-siblings):
  (org-edna-finder/rest-of-siblings-wrap):
  (org-edna-finder/next-sibling):
  (org-edna-finder/next-sibling-wrap):
  (org-edna-finder/previous-sibling):
  (org-edna-finder/previous-sibling-wrap):
  (org-edna-finder/first-child):
  (org-edna-finder/ancestors):
  (org-edna-finder/descendants):
  (org-edna-finder/children): Implemented in terms of 
org-edna-finder/relatives.

* org-edna-tests.el: Added tests for every form of relatives.

* org-edna.org: Added documentation for relatives, and added new options 
for all
  other relative finders.

* org-edna.info: Updated.

* org-edna-tests.org: Added section for relative tests.
---
 org-edna-tests.el  | 479 -
 org-edna-tests.org |  56 +
 org-edna.el| 608 +++--
 org-edna.info  | 334 ++---
 org-edna.org   | 184 +++-
 5 files changed, 1275 insertions(+), 386 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 52d1540..d3911db 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -52,6 +52,18 @@
 (defconst org-edna-test-id-heading-four  
"7d4d564b-18b2-445c-a0c8-b1b3fb9ad29e")
 (defconst org-edna-test-archive-heading  
"d7668277-f959-43ba-8e85-8a3c76996862")
 
+(defconst org-edna-test-relative-grandparent 
"c07cf4c1-3693-443a-9d79-b581f7cbd62c")
+(defconst org-edna-test-relative-parent-one  
"5a35daf7-4957-4588-9a68-21d8763a9e0d")
+(defconst org-edna-test-relative-parent-two  
"4fe67f03-2b35-4708-8c38-54d2c4dfab81")
+(defconst org-edna-test-relative-standard-child 
"7c542695-8165-4c8b-b44d-4c12fa009548")
+(defconst org-edna-test-relative-child-with-children 
"c7a986df-8d89-4509-b086-6db429b5607b")
+(defconst org-edna-test-relative-grandchild-one 
"588bbd29-2e07-437f-b74d-f72459b545a1")
+(defconst org-edna-test-relative-grandchild-two 
"a7047c81-21ec-46cd-8289-60ad515900ff")
+(defconst org-edna-test-relative-child-with-todo 
"8c0b31a1-af49-473c-92ea-a5c1c3bace33")
+(defconst org-edna-test-relative-commented-child 
"0a1b9508-17ce-49c5-8ff3-28a0076374f5")
+(defconst org-edna-test-relative-archived-child 
"a4b6131e-0560-4201-86d5-f32b36363431")
+(defconst org-edna-test-relative-child-with-done 
"4a1d74a2-b032-47da-a823-b32f5cab0aae")
+
 (defun org-edna-find-test-heading (id)
   "Find the test heading with id ID."
   (org-id-find-id-in-file id org-edna-test-file t))
@@ -210,14 +222,14 @@
 
 (ert-deftest org-edna-finder/siblings ()
   (let* ((org-agenda-files `(,org-edna-test-file))
- (current (org-id-find "82a4ac3d-9565-4f94-bc84-2bbfd8d7d96c" t))
+ (current (org-id-find org-edna-test-sibling-one-id t))
  (siblings (mapcar
 (lambda (uuid) (org-id-find uuid t))
-'("72534efa-e932-460b-ae2d-f044a0074815"
-  "06aca55e-ce09-46df-80d7-5b52e55d6505")))
+`(,org-edna-test-sibling-one-id
+  ,org-edna-test-sibling-two-id
+  ,org-edna-test-sibling-three-id)))
  (targets (org-with-point-at current
 (org-edna-finder/siblings
-(should (= (length targets) 2))
 (should (equal siblings targets
 
 (ert-deftest org-edna-finder/siblings-wrap ()
@@ -318,6 +330,465 @@
 (should (= (length targets) 1))
 (should (equal parent targets
 
+(ert-deftest org-edna-relatives/from-top ()
+  (let* ((org-agenda-files `(,org-edna-test-file))
+ (current (org-id-find org-edna-test-sibling-one-id t))
+ (siblings (mapcar
+(lambda (uuid) (org-id-find uuid t))
+`(,org-edna-test-sibling-one-id)))
+ (targets (org-with-point-at current
+(org-edna-finder/relatives 'from-top 1
+(should (equal siblings targets
+
+(ert-deftest org-edna-relatives/from-bottom ()
+  (let* ((org-agenda-files `(,org-edna-test-file))
+ (current (org-id-find org-edna-test-sibling-one-id t))
+ (siblings (mapcar
+(lambda (uuid) (or

[elpa] master 2e8b7eb 094/135: Don't export special strings for documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 2e8b7eb395133107b1dc737e37b61d6e15f675d8
Author: Ian Dunn 
Commit: Ian Dunn 

Don't export special strings for documentation

Preserves -- in docs.

* org-edna.org: Add special string preserve option
---
 org-edna.org | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.org b/org-edna.org
index 9c1dbf4..7009570 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -7,7 +7,7 @@
 #+STARTUP: indent
 #+TODO: FIXME | FIXED
 #+OPTIONS: toc:2 num:nil timestamp:nil \n:nil |:t ':t email:t
-#+OPTIONS: *:t <:t d:nil todo:nil pri:nil tags:not-in-toc
+#+OPTIONS: *:t <:t d:nil todo:nil pri:nil tags:not-in-toc -:nil
 
 #+TEXINFO_DIR_CATEGORY: Emacs
 #+TEXINFO_DIR_TITLE: Org Edna: (org-edna)



[elpa] master 6287170 122/135: Removed remnants of old build system

2020-02-17 Thread Ian Dunn
branch: master
commit 6287170939712c029a34a51dabbfafb7137b3792
Author: Ian Dunn 
Commit: Ian Dunn 

Removed remnants of old build system
---
 defaults.mk | 26 --
 1 file changed, 26 deletions(-)

diff --git a/defaults.mk b/defaults.mk
deleted file mode 100644
index f599ee4..000
--- a/defaults.mk
+++ /dev/null
@@ -1,26 +0,0 @@
-# This is part of org-edna
-#
-#  Copyright (C) 2017-2018 Free Software Foundation, Inc.
-#
-#  This program is free software: you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation, either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-emacs = emacs
-
-prefix = /usr/share
-
-org_path = $(prefix)/emacs/site-lisp/org
-
-info_dir = $(prefix)/info
-
-lisp_dir = $(prefix)/emacs/site-lisp/



[elpa] master b72cb7b 101/135: Cleaned up Changelog some more

2020-02-17 Thread Ian Dunn
branch: master
commit b72cb7b83287ec9685dadf9cae2c817f830ff47e
Author: Ian Dunn 
Commit: Ian Dunn 

Cleaned up Changelog some more

* org-edna.org (Changelog): Use spaces between each feature description

* org-edna.info: Regenerated documentation.
---
 org-edna.info | 364 +++---
 org-edna.org  |  11 ++
 2 files changed, 182 insertions(+), 193 deletions(-)

diff --git a/org-edna.info b/org-edna.info
index 8745526..184755b 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -95,9 +95,9 @@ Conditions
 Extending Edna
 
 * Naming Conventions::   How to name new functions
-* Finders: Finders (1).  Making a new finder
-* Actions: Actions (1).  Making a new action
-* Conditions: Conditions (1).Making a new condition
+* Finders: Finders 1.Making a new finder
+* Actions: Actions 1.Making a new action
+* Conditions: Conditions 1.  Making a new condition
 
 Contributing
 
@@ -107,32 +107,11 @@ Contributing
 
 Changelog
 
+* 1.0beta5: 10beta5.
 * 1.0beta4: 10beta4.
 * 1.0beta3: 10beta3.
 * 1.0beta2: 10beta2.
 
-1.0beta4
-
-* Fixed multiple forms getting incorrect targets::
-* Fixed multiple forms not evaluating::
-
-
-1.0beta3
-
-* Conditional Forms: Conditional Forms (1).
-* Overhauled Internal Parsing::
-* Fixed consideration keywords::
-* Added 'any consideration::
-
-
-1.0beta2
-
-* Added interactive keyword editor with completion::
-* New uses of schedule! and deadline!::
-* New ``relatives'' finder::
-* New finders::
-
-
 
 
 File: org-edna.info,  Node: Copying,  Next: Introduction,  Prev: Top,  Up: Top
@@ -953,13 +932,69 @@ Property
 
 
• Syntax: set-property!(“PROPERTY” “VALUE”)
+   • Syntax: set-property!(“PROPERTY” inc)
+   • Syntax: set-property!(“PROPERTY” dec)
+   • Syntax: set-property!(“PROPERTY” next)
+   • Syntax: set-property!(“PROPERTY” prev)
+   • Syntax: set-property!(“PROPERTY” previous)
+
+   The first form sets the property PROPERTY on all targets to VALUE.
+
+   If VALUE is a symbol, it is interpreted as follows:
+
+inc
+ Increment a numeric property value by one
+dec
+ Decrement a numeric property value by one
+
+   If either ‘inc’ or ‘dec’ attempt to modify a non-numeric property
+value, Edna will fail with an error message.
+
+next
+ Cycle the property through to the next allowed property value
+previous
+ Cycle the property through to the previous allowed property value
+
+   The symbol ‘prev’ may be used as an abbreviation for ‘previous’.
+Similar to ‘inc’ and ‘dec’, any of these will fail if there are no
+defined properties.  When reaching the end of the list of allowed
+properties, ‘next’ will cycle back to the beginning.
 
-   Sets the property PROPERTY on all targets to VALUE.
+   Example:
+
+ #+PROPERTY: TEST_ALL a b c d
+
+ * TODO Test Heading
+   :PROPERTIES:
+   :TEST: d
+   :TRIGGER:  self set-property!("TEST" next)
+   :END:
+
+   When “Test Heading” is set to DONE, its TEST property will change to
+“a”.  This also works with ‘previous’, but in the opposite direction.
+
+   Additionally, all special forms will fail if the property is not
+already set:
+
+ * TODO Test
+   :PROPERTIES:
+   :TRIGGER: self set-property("TEST" inc)
+   :END:
+
+   In the above example, if “Test” is set to DONE, Edna will fail to
+increment the TEST property, since it doesn’t exist.
 
• Syntax: delete-property!(“PROPERTY”)
 
Deletes the property PROPERTY from all targets.
 
+   Examples:
+
+   • set-property!(“COUNTER” “1”) -> Sets the property COUNTER to 1 on
+ all targets
+   • set-property!(“COUNTER” inc) -> Increments the property COUNTER by
+ 1.  Following the previous example, it would be 2.
+
 
 File: org-edna.info,  Node: Priority,  Next: Tag,  Prev: Property,  Up: Actions
 
@@ -1302,12 +1337,12 @@ org-edna-TYPE/KEYWORD.
 * Menu:
 
 * Naming Conventions::   How to name new functions
-* Finders: Finders (1).  Making a new finder
-* Actions: Actions (1).  Making a new action
-* Conditions: Conditions (1).Making a new condition
+* Finders: Finders 1.Making a new finder
+* Actions: Actions 1.Making a new action
+* Conditions: Conditions 1.  Making a new condition
 
 
-File: org-edna.info,  Node: Naming Conventions,  Next: Finders (1),  Up: 
Extending Edna
+File: org-edna.info,  Node: Naming Conventions,  Next: Finders 1,  Up: 
Extending Edna
 
 Naming Conventions
 ==
@@ -1321,7 +1356,7 @@ predicates with ’?’.
 finds a file.
 
 
-File: org-edna.info,  Node: Finders (1),  Next: Actions (1),  Prev: Naming 
Conventions,  Up: Extending Edna
+File: org-edna.info,  Node: Finders 1,  Next: Actions 1,  Prev: Naming 
Conventions,  Up: Extending Edna
 
 Finders
 ===
@@ -1335,7 +1370,7 @@ Finders have the form org-edna-finder/KEYWORD, like so:
 or nil if no targets were found.
 
 
-File: org

[elpa] master db8a046 124/135: Bumped version

2020-02-17 Thread Ian Dunn
branch: master
commit db8a046a037dd85a8cb90e1562df36b54c03c0c2
Author: Ian Dunn 
Commit: Ian Dunn 

Bumped version
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index f804dba..486cd88 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0beta8
+;; Version: 1.0
 
 ;; This file is part of GNU Emacs.
 



[elpa] master e7b0bb0 1/4: Updated documentation

2020-02-17 Thread Ian Dunn
branch: master
commit e7b0bb0c892798b1d8660f762bcc1e32cb54a597
Author: Ian Dunn 
Commit: Ian Dunn 

Updated documentation
---
 org-edna.info | 172 +-
 org-edna.org  |   6 +-
 2 files changed, 91 insertions(+), 87 deletions(-)

diff --git a/org-edna.info b/org-edna.info
index afedda2..0bd114c 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -1,4 +1,4 @@
-This is org-edna.info, produced by makeinfo version 6.5 from
+This is org-edna.info, produced by makeinfo version 6.7 from
 org-edna.texi.
 
 INFO-DIR-SECTION Emacs
@@ -17,7 +17,7 @@ Org Edna
 * Copying::
 * Introduction:: A Brief Introduction to Edna
 * Basic Features::   Finders and Actions
-* Advanced Features::
+* Advanced Features::Be careful in here
 * Extending Edna::   What else can it do?
 * Contributing:: I wanna help!
 * Changelog::List of changes by version
@@ -206,9 +206,11 @@ org 9.0.5
  (require 'org-edna)
 
  ;; Always necessary
- (org-edna-load)
+ (org-edna-mode)
 
-   If you ever want to disable Edna, run ‘org-edna-unload’.
+   If you ever want to disable Edna, run ‘(org-edna-mode)’ again.
+
+   To determine if Edna is active, check the ‘org-edna-mode’ variable.
 
 
 File: org-edna.info,  Node: Basic Operation,  Next: Blockers,  Prev: 
Installation and Setup,  Up: Introduction
@@ -2036,87 +2038,87 @@ Big release here, with three new features.
 
 Tag Table:
 Node: Top225
-Node: Copying4453
-Node: Introduction5276
-Node: Installation and Setup6224
-Node: Basic Operation6948
-Node: Blockers8799
-Node: Triggers9086
-Node: Syntax9348
-Node: Basic Features10038
-Node: Finders10392
-Node: ancestors12157
-Node: children12751
-Node: descendants13161
-Node: file13683
-Node: first-child14432
-Node: ids14692
-Node: match15353
-Node: next-sibling15991
-Node: next-sibling-wrap16248
-Node: olp16562
-Node: org-file16975
-Node: parent17620
-Node: previous-sibling17818
-Node: previous-sibling-wrap18079
-Node: relatives18358
-Node: rest-of-siblings22084
-Node: rest-of-siblings-wrap22369
-Node: self22718
-Node: siblings22879
-Node: siblings-wrap23116
-Node: Actions23420
-Node: Scheduled/Deadline24183
-Node: Timestamp Format27771
-Node: TODO State28659
-Node: Archive29384
-Node: Chain Property29704
-Node: Clocking30457
-Node: Property30869
-Node: Priority33042
-Node: Tag33611
-Node: Effort33828
-Node: Getting Help34212
-Node: Advanced Features34657
-Node: Finder Cache35105
-Node: Conditions36553
-Node: Heading is DONE37438
-Node: File Has Headings37644
-Node: Heading TODO State38066
-Node: Lisp Variable Set38360
-Node: Heading Has Property39029
-Node: Regexp Search39775
-Node: Checking Tags40218
-Node: Matching Headings41120
-Node: Negating Conditions41717
-Node: Multiple Conditions42140
-Node: Consideration42822
-Node: Conditional Forms45008
-Node: Setting the Properties47697
-Node: Extending Edna48781
-Node: Naming Conventions49271
-Node: Finders (1)50065
-Node: Actions (1)50431
-Node: Conditions (1)50896
-Node: Contributing51786
-Node: Bugs52652
-Node: Working with EDE53009
-Node: Compiling Edna54094
-Node: Testing Edna54963
-Node: Before Sending Changes55945
-Node: Developing with Bazaar56632
-Node: Documentation57373
-Node: Changelog57829
-Node: 10258118
-Node: 10158398
-Node: 1058535
-Node: 10beta859049
-Node: 10beta759172
-Node: 10beta659466
-Node: 10beta559742
-Node: 10beta460129
-Node: 10beta360382
-Node: 10beta260821
+Node: Copying4483
+Node: Introduction5306
+Node: Installation and Setup6254
+Node: Basic Operation7060
+Node: Blockers8911
+Node: Triggers9198
+Node: Syntax9460
+Node: Basic Features10150
+Node: Finders10504
+Node: ancestors12269
+Node: children12863
+Node: descendants13273
+Node: file13795
+Node: first-child14544
+Node: ids14804
+Node: match15465
+Node: next-sibling16103
+Node: next-sibling-wrap16360
+Node: olp16674
+Node: org-file17087
+Node: parent17732
+Node: previous-sibling17930
+Node: previous-sibling-wrap18191
+Node: relatives18470
+Node: rest-of-siblings22196
+Node: rest-of-siblings-wrap22481
+Node: self22830
+Node: siblings22991
+Node: siblings-wrap23228
+Node: Actions23532
+Node: Scheduled/Deadline24295
+Node: Timestamp Format27883
+Node: TODO State28771
+Node: Archive29496
+Node: Chain Property29816
+Node: Clocking30569
+Node: Property30981
+Node: Priority33154
+Node: Tag33723
+Node: Effort33940
+Node: Getting Help34324
+Node: Advanced Features34769
+Node: Finder Cache35217
+Node: Conditions36665
+Node: Heading is DONE37550
+Node: File Has Headings37756
+Node: Heading TODO State38178
+Node: Lisp Variable Set38472
+Node: Heading Has Property39141
+Node: Regexp Search39887
+Node: Checking Tags40330
+Node: Matching Headings41232
+Node: Negating Conditions41829
+Node: Multiple Conditions42252
+Node: Consideration42934
+Node

[elpa] master e08eae5 096/135: Fixed bugs in parsing multiple forms

2020-02-17 Thread Ian Dunn
branch: master
commit e08eae5e929016a7f596ecc261ca84466c4aec10
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed bugs in parsing multiple forms

* org-edna.el (org-edna--normalize-all-forms): New defun to parse all forms.
  (org-edna-string-form-to-sexp-form): Use it.
  (org-edna--expand-sexp-form): Fix scoping for form lists.
---
 org-edna-tests.el | 193 --
 org-edna.el   |  34 +++---
 org-edna.info | 180 ++
 org-edna.org  |   4 ++
 4 files changed, 236 insertions(+), 175 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index a6b3554..83c05a3 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -151,39 +151,39 @@
  (sexp (org-edna-string-form-to-sexp-form input-string 'condition)))
 (should (equal
  sexp
- '((self)
-   (!done?))
+ '(((self)
+(!done?)))
 
 (ert-deftest org-edna-form-to-sexp-arguments ()
   (let* ((input-string "match(\"checklist\") todo!(TODO)")
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
 (should (equal
  sexp
- '((match "checklist")
-   (todo! TODO))
+ '(((match "checklist")
+   (todo! TODO)))
 
 (ert-deftest org-edna-form-to-sexp-if-no-else ()
   (let* ((input-string "if match(\"checklist\") done? then self todo!(TODO) 
endif")
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
 (should (equal
  sexp
- '((if ((match "checklist")
-(done?))
-   ((self)
-(todo! TODO))
- nil))
+ '(((if ((match "checklist")
+ (done?))
+((self)
+ (todo! TODO))
+  nil)))
 
 (ert-deftest org-edna-form-to-sexp-if-else ()
   (let* ((input-string "if match(\"checklist\") done? then self todo!(TODO) 
else siblings todo!(DONE) endif")
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
 (should (equal
  sexp
- '((if ((match "checklist")
-(done?))
-   ((self)
-(todo! TODO))
- ((siblings)
-  (todo! DONE
+ '(((if ((match "checklist")
+  (done?))
+((self)
+ (todo! TODO))
+  ((siblings)
+   (todo! DONE)
 
 (ert-deftest org-edna-expand-sexp-form ()
   ;; Override cl-gentemp so we have a repeatable test
@@ -224,21 +224,24 @@
  (consideration1 nil)
  (blocking-entry1 nil))
  ;; Don't need a new set of variables
- (progn
-   (setq targets1
- (org-edna--add-targets targets1
+ (let ((targets2 targets1)
+   (consideration2 consideration1)
+   (blocking-entry2 blocking-entry1))
+   (setq targets2
+ (org-edna--add-targets targets2
 (org-edna-finder/match 
"checklist")))
(org-edna--handle-action 'org-edna-action/todo!
-targets1
+targets2
 (point-marker)
 '(DONE)))
- ;; No new set of variables here either
- (progn
-   (setq targets1
- (org-edna--add-targets targets1
+ (let ((targets5 targets1)
+   (consideration5 consideration1)
+   (blocking-entry5 blocking-entry1))
+   (setq targets5
+ (org-edna--add-targets targets5
 (org-edna-finder/siblings)))
(org-edna--handle-action 'org-edna-action/todo!
-targets1
+targets5
 (point-marker)
 '(TODO)
  (output-form (org-edna--expand-sexp-form input-sexp)))
@@ -263,45 +266,46 @@
 (todo! TODO))
  ((siblings)
   (todo! DONE)
- (expected-form '(let
- ((targets1 nil)
-  (consideration1 nil)
-  (blocki

[elpa] master ccc0814 4/4: Merge commit 'cd8c87e7f70a71e9feb786308e17c3c4776b908b'

2020-02-17 Thread Ian Dunn
branch: master
commit ccc0814a3342252340fc8c8e9c9eba2227a472fc
Merge: bf8ecda cd8c87e
Author: Ian Dunn 
Commit: Ian Dunn 

Merge commit 'cd8c87e7f70a71e9feb786308e17c3c4776b908b'
---
 packages/org-edna/org-edna.el   |   2 +-
 packages/org-edna/org-edna.info | 172 
 packages/org-edna/org-edna.org  |  13 ++-
 3 files changed, 98 insertions(+), 89 deletions(-)

diff --git a/packages/org-edna/org-edna.el b/packages/org-edna/org-edna.el
index e72dd4c..68cca82 100644
--- a/packages/org-edna/org-edna.el
+++ b/packages/org-edna/org-edna.el
@@ -1,6 +1,6 @@
 ;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2020 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
 ;; Maintainer: Ian Dunn 
diff --git a/packages/org-edna/org-edna.info b/packages/org-edna/org-edna.info
index afedda2..0bd114c 100644
--- a/packages/org-edna/org-edna.info
+++ b/packages/org-edna/org-edna.info
@@ -1,4 +1,4 @@
-This is org-edna.info, produced by makeinfo version 6.5 from
+This is org-edna.info, produced by makeinfo version 6.7 from
 org-edna.texi.
 
 INFO-DIR-SECTION Emacs
@@ -17,7 +17,7 @@ Org Edna
 * Copying::
 * Introduction:: A Brief Introduction to Edna
 * Basic Features::   Finders and Actions
-* Advanced Features::
+* Advanced Features::Be careful in here
 * Extending Edna::   What else can it do?
 * Contributing:: I wanna help!
 * Changelog::List of changes by version
@@ -206,9 +206,11 @@ org 9.0.5
  (require 'org-edna)
 
  ;; Always necessary
- (org-edna-load)
+ (org-edna-mode)
 
-   If you ever want to disable Edna, run ‘org-edna-unload’.
+   If you ever want to disable Edna, run ‘(org-edna-mode)’ again.
+
+   To determine if Edna is active, check the ‘org-edna-mode’ variable.
 
 
 File: org-edna.info,  Node: Basic Operation,  Next: Blockers,  Prev: 
Installation and Setup,  Up: Introduction
@@ -2036,87 +2038,87 @@ Big release here, with three new features.
 
 Tag Table:
 Node: Top225
-Node: Copying4453
-Node: Introduction5276
-Node: Installation and Setup6224
-Node: Basic Operation6948
-Node: Blockers8799
-Node: Triggers9086
-Node: Syntax9348
-Node: Basic Features10038
-Node: Finders10392
-Node: ancestors12157
-Node: children12751
-Node: descendants13161
-Node: file13683
-Node: first-child14432
-Node: ids14692
-Node: match15353
-Node: next-sibling15991
-Node: next-sibling-wrap16248
-Node: olp16562
-Node: org-file16975
-Node: parent17620
-Node: previous-sibling17818
-Node: previous-sibling-wrap18079
-Node: relatives18358
-Node: rest-of-siblings22084
-Node: rest-of-siblings-wrap22369
-Node: self22718
-Node: siblings22879
-Node: siblings-wrap23116
-Node: Actions23420
-Node: Scheduled/Deadline24183
-Node: Timestamp Format27771
-Node: TODO State28659
-Node: Archive29384
-Node: Chain Property29704
-Node: Clocking30457
-Node: Property30869
-Node: Priority33042
-Node: Tag33611
-Node: Effort33828
-Node: Getting Help34212
-Node: Advanced Features34657
-Node: Finder Cache35105
-Node: Conditions36553
-Node: Heading is DONE37438
-Node: File Has Headings37644
-Node: Heading TODO State38066
-Node: Lisp Variable Set38360
-Node: Heading Has Property39029
-Node: Regexp Search39775
-Node: Checking Tags40218
-Node: Matching Headings41120
-Node: Negating Conditions41717
-Node: Multiple Conditions42140
-Node: Consideration42822
-Node: Conditional Forms45008
-Node: Setting the Properties47697
-Node: Extending Edna48781
-Node: Naming Conventions49271
-Node: Finders (1)50065
-Node: Actions (1)50431
-Node: Conditions (1)50896
-Node: Contributing51786
-Node: Bugs52652
-Node: Working with EDE53009
-Node: Compiling Edna54094
-Node: Testing Edna54963
-Node: Before Sending Changes55945
-Node: Developing with Bazaar56632
-Node: Documentation57373
-Node: Changelog57829
-Node: 10258118
-Node: 10158398
-Node: 1058535
-Node: 10beta859049
-Node: 10beta759172
-Node: 10beta659466
-Node: 10beta559742
-Node: 10beta460129
-Node: 10beta360382
-Node: 10beta260821
+Node: Copying4483
+Node: Introduction5306
+Node: Installation and Setup6254
+Node: Basic Operation7060
+Node: Blockers8911
+Node: Triggers9198
+Node: Syntax9460
+Node: Basic Features10150
+Node: Finders10504
+Node: ancestors12269
+Node: children12863
+Node: descendants13273
+Node: file13795
+Node: first-child14544
+Node: ids14804
+Node: match15465
+Node: next-sibling16103
+Node: next-sibling-wrap16360
+Node: olp16674
+Node: org-file17087
+Node: parent17732
+Node: previous-sibling17930
+Node: previous-sibling-wrap18191
+Node: relatives18470
+Node: rest-of-siblings22196
+Node: rest-of-siblings-wrap22481
+Node: self22830
+Node: siblings22991
+Node: siblings-wrap23228
+Node: Actions23532
+Node: Scheduled/Deadline24295
+Node: Timestamp

[elpa] master c4d1298 099/135: Added new forms for set-property! and fixed up build system

2020-02-17 Thread Ian Dunn
branch: master
commit c4d12987025906f69e12eca4205958b6e3ede12e
Author: Ian Dunn 
Commit: Ian Dunn 

Added new forms for set-property! and fixed up build system

* org-edna.el (org-edna--string-is-numeric-p):
  (org-edna--increment-numeric-property):
  (org-edna--cycle-property): New helper functions.
  (org-edna-action/set-property!): Use them for new forms.
  (org-edna-set-effort): Take entire function from Org for compatibility.
  (org-edna-action/set-effort!): Use new signature.

* Project.ede, test.mk: New files for EDE.

* org-edna.org (Property): Document new forms for property action.
  (Changelog): Start section for 1.0beta5

* .elpaignore: Added ignored files for ELPA to avoid problems with EDE

* org-edna-tests.el: Added tests for new property forms
---
 .bzrignore |   3 +-
 .elpaignore|   5 +++
 Makefile   |  68 --
 Project.ede|  28 ++
 org-edna-tests.el  |  50 -
 org-edna-tests.org |   3 +-
 org-edna.el| 107 -
 org-edna.org   |  60 +-
 test.mk|  28 ++
 9 files changed, 270 insertions(+), 82 deletions(-)

diff --git a/.bzrignore b/.bzrignore
index 5228a6a..bbb6def 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -2,4 +2,5 @@
 local.mk
 org-edna-autoloads.el
 org-edna.texi
-org-edna.html
\ No newline at end of file
+org-edna.html
+.deps
\ No newline at end of file
diff --git a/.elpaignore b/.elpaignore
new file mode 100644
index 000..3ef4d79
--- /dev/null
+++ b/.elpaignore
@@ -0,0 +1,5 @@
+Project.ede
+Makefile
+test.mk
+org-edna-tests.el
+org-edna-tests.org
\ No newline at end of file
diff --git a/Makefile b/Makefile
deleted file mode 100644
index 2c123ca..000
--- a/Makefile
+++ /dev/null
@@ -1,68 +0,0 @@
-# This is part of org-edna
-#
-# Copyright (C) 2017-2018 Free Software Foundation, Inc.
-#
-#  This program is free software: you can redistribute it and/or modify
-#  it under the terms of the GNU General Public License as published by
-#  the Free Software Foundation, either version 3 of the License, or
-#  (at your option) any later version.
-#
-#  This program is distributed in the hope that it will be useful,
-#  but WITHOUT ANY WARRANTY; without even the implied warranty of
-#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-#  GNU General Public License for more details.
-#
-#  You should have received a copy of the GNU General Public License
-#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
-
-# Load defaults
-include defaults.mk
-
-# Load local definitions
-include local.mk
-
-EMACS=$(emacs) --batch -L $(org_path)
-ALLSRC=org-edna.el
-SOURCE=$(ALLSRC)
-TARGET=$(patsubst %.el,%.elc,$(SOURCE))
-
-.PHONY: clean check local.mk help
-
-all: $(TARGET)
-
-compile: $(TARGET)
-
-%.elc: %.el
-   @$(EMACS) \
-   -L "." \
-   -f batch-byte-compile $<
-
-autoloads: org-edna-autoloads.el
-
-org-edna-autoloads.el:
-   @$(EMACS) \
-   --eval "(require 'package)" \
-   --eval "(setq inhibit-message t)" \
-   --eval "(package-generate-autoloads \"org-edna\" \"$$(pwd)\")"
-
-clean:
-   -rm -f *.elc
-
-check: compile
-   @$(EMACS) \
-   -L "." \
-   --load "ert" \
-   --load "org-edna-tests.el" \
-   -f ert-run-tests-batch-and-exit
-
-local.mk:
-   @cp -n defaults.mk local.mk
-
-help:
-   $(info )
-   $(info make all   - Default)
-   $(info make compile   - Compile Emacs Lisp Files)
-   $(info make autoloads - Generate Autoloads)
-   $(info make clean - Remove generated .elc files)
-   $(info make check - Run Tests)
-   @echo ""
diff --git a/Project.ede b/Project.ede
new file mode 100644
index 000..decef82
--- /dev/null
+++ b/Project.ede
@@ -0,0 +1,28 @@
+;; Object ede-proj-project
+;; EDE Project Files are auto generated: Do Not Edit
+(ede-proj-project "ede-proj-project"
+  :file "Project.ede"
+  :name "Org Edna"
+  :targets
+  (list
+(ede-proj-target-elisp "ede-proj-target-elisp"
+  :name "compile"
+  :path ""
+  :source '("org-edna.el")
+  :aux-packages '("org"))
+(ede-proj-target-makefile-miscelaneous 
"ede-proj-target-makefile-miscelaneous"
+  :name "check"
+  :path ""
+  :source '("org-edna-tests.el" "org-edna-tests.org")
+  :partofall nil
+  :submakefile "test.mk")
+(ede-proj-target-aux "ede-proj-target-aux"
+  :name "extra"
+  :path ""
+  :source '("org-edna.org" "COPYING" "dir" "org-edna.info" ".elp

[elpa] master b86ae49 103/135: Fixed parsing of ! in conditions

2020-02-17 Thread Ian Dunn
branch: master
commit b86ae49dc7136a9b047fea845ffc2e6e1663b56d
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed parsing of ! in conditions

* org-edna.el (org-edna--normalize-sexp-form): Break form before parsing.

* org-edna-tests.el: Added test for parsing negations

* org-edna.org (Changelog): Added updates.
---
 .bzrignore|   3 +-
 Project.ede   |   4 +-
 org-edna-tests.el |   8 +++
 org-edna.el   |   3 +-
 org-edna.info | 144 +-
 org-edna.org  |   3 ++
 test.mk   |   4 +-
 7 files changed, 97 insertions(+), 72 deletions(-)

diff --git a/.bzrignore b/.bzrignore
index bbb6def..05318df 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -3,4 +3,5 @@ local.mk
 org-edna-autoloads.el
 org-edna.texi
 org-edna.html
-.deps
\ No newline at end of file
+.deps
+Makefile
\ No newline at end of file
diff --git a/Project.ede b/Project.ede
index decef82..65176dc 100644
--- a/Project.ede
+++ b/Project.ede
@@ -11,9 +11,9 @@
   :source '("org-edna.el")
   :aux-packages '("org"))
 (ede-proj-target-makefile-miscelaneous 
"ede-proj-target-makefile-miscelaneous"
-  :name "check"
+  :name #("check" 0 1 (idx 2))
   :path ""
-  :source '("org-edna-tests.el" "org-edna-tests.org")
+  :source '("org-edna-tests.el" "org-edna-tests.org" "test.mk")
   :partofall nil
   :submakefile "test.mk")
 (ede-proj-target-aux "ede-proj-target-aux"
diff --git a/org-edna-tests.el b/org-edna-tests.el
index 6ce4f64..01842ec 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -154,6 +154,14 @@
  '(((self)
 (!done?)))
 
+(ert-deftest org-edna-form-to-sexp-negation ()
+  (let* ((input-string "self !done?")
+ (sexp (org-edna-string-form-to-sexp-form input-string 'condition)))
+(should (equal
+ sexp
+ '(((self)
+(!done?)))
+
 (ert-deftest org-edna-form-to-sexp-arguments ()
   (let* ((input-string "match(\"checklist\") todo!(TODO)")
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
diff --git a/org-edna.el b/org-edna.el
index 947d8f6..a72377b 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -259,7 +259,8 @@ the remainder of FORM after the current scope was parsed."
   (_
;; Determine the type of the form
;; If we need to change state, return from this scope
-   (pcase-let* ((`(,type . ,func) (org-edna--function-for-key (car 
current-form
+   (pcase-let* ((`(_ . ,key)   (org-edna-break-modifier (car 
current-form)))
+(`(,type . ,func) (org-edna--function-for-key key)))
  (unless (and type func)
(org-edna--syntax-error "Unrecognized Form"
from-string error-pos))
diff --git a/org-edna.info b/org-edna.info
index 184755b..25a9421 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -107,6 +107,7 @@ Contributing
 
 Changelog
 
+* 1.0beta6: 10beta6.
 * 1.0beta5: 10beta5.
 * 1.0beta4: 10beta4.
 * 1.0beta3: 10beta3.
@@ -1510,13 +1511,23 @@ Changelog
 
 * Menu:
 
+* 1.0beta6: 10beta6.
 * 1.0beta5: 10beta5.
 * 1.0beta4: 10beta4.
 * 1.0beta3: 10beta3.
 * 1.0beta2: 10beta2.
 
 
-File: org-edna.info,  Node: 10beta5,  Next: 10beta4,  Up: Changelog
+File: org-edna.info,  Node: 10beta6,  Next: 10beta5,  Up: Changelog
+
+1.0beta6
+
+
+   • Fixed error reporting
+   • Fixed parsing of negations in conditions
+
+
+File: org-edna.info,  Node: 10beta5,  Next: 10beta4,  Prev: 10beta6,  Up: 
Changelog
 
 1.0beta5
 
@@ -1594,71 +1605,72 @@ Big release here, with three new features.
 
 Tag Table:
 Node: Top225
-Node: Copying3672
-Node: Introduction4494
-Node: Installation and Setup5442
-Node: Basic Operation6235
-Node: Blockers8086
-Node: Triggers8372
-Node: Syntax8634
-Node: Basic Features9324
-Node: Finders9627
-Node: ancestors11392
-Node: children11986
-Node: descendants12396
-Node: file12918
-Node: first-child13667
-Node: ids13927
-Node: match14588
-Node: next-sibling15226
-Node: next-sibling-wrap15483
-Node: olp15797
-Node: org-file16209
-Node: parent16854
-Node: previous-sibling17052
-Node: previous-sibling-wrap17313
-Node: relatives17592
-Node: rest-of-siblings21213
-Node: rest-of-siblings-wrap21498
-Node: self21847
-Node: siblings22008
-Node: siblings-wrap22245
-Node: Actions22549
-Node: Scheduled/Deadline23291
-Node: TODO State26866
-Node: Archive27234
-Node: Chain Property27554
-Node: Clocking27837
-Node: Property28249
-Node: Priority30436
-Node: Tag31005
-Node: Effort31222
-Node: Advanced Features31611
-Node: Conditions31995
-Node: done32610
-Node: headings32774
-Node: todo-state33150
-Node: variable-set33406
-Node: has-property33835
-N

[elpa] master bad787d 128/135: Bumped version

2020-02-17 Thread Ian Dunn
branch: master
commit bad787d6671d5a3666149e3407a2716721f8d234
Author: Ian Dunn 
Commit: Ian Dunn 

Bumped version
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index b2398c7..1cdc52b 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0.1
+;; Version: 1.0.2
 
 ;; This file is part of GNU Emacs.
 



[elpa] master ef04c24 123/135: Added has-tags? and matches? conditions

2020-02-17 Thread Ian Dunn
branch: master
commit ef04c24b93b4f200a6af37aabc8ba24084640d68
Author: Ian Dunn 
Commit: Ian Dunn 

Added has-tags? and matches? conditions

* org-edna.el (org-edna-condition/has-tags?): New defun.
  (org-edna--heading-matches): New helper defun.
  (org-edna-condition/matches?): New defun.

* org-edna-tests.el: Refactored to consolidate common forms.
  (org-edna-protect-test-file):
  (org-edna-test-setup):
  (org-edna-with-point-at-test-heading):
  (org-edna-with-test-heading): New helper macros.
  (org-edna-test-children-marks): New helper function.
  (org-edna-doc-test/has-tags):
  (org-edna-doc-test/matches):
  (org-edna-doc-test/chain): New tests.

* org-edna.org (Checking Tags):
  (Matching Headings): Sections for new conditions.
---
 org-edna-tests.el  | 1920 +++-
 org-edna-tests.org |   36 +
 org-edna.el|   33 +-
 org-edna.info  |  215 +++---
 org-edna.org   |   55 +-
 5 files changed, 1092 insertions(+), 1167 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 52c901a..b6adf15 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -69,6 +69,48 @@
   (with-current-buffer (get-file-buffer org-edna-test-file)
 (revert-buffer nil t)))
 
+(defmacro org-edna-protect-test-file ( body)
+  (declare (indent 0))
+  `(unwind-protect
+   (progn ,@body)
+ ;; Change the test file back to its original state.
+ (org-edna-test-restore-test-file)))
+
+(defmacro org-edna-test-setup ( body)
+  "Common settings for tests."
+  (declare (indent 0))
+  ;; Override `current-time' so we can get a deterministic value
+  `(cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
+  ;; Only use the test file in the agenda
+  (org-agenda-files `(,org-edna-test-file))
+  ;; Ensure interactive modification of TODO states works.
+  (org-todo-keywords '((sequence "TODO" "|" "DONE")))
+  ;; Only block based on Edna
+  (org-blocker-hook 'org-edna-blocker-function)
+  ;; Only trigger based on Edna
+  (org-trigger-hook 'org-edna-trigger-function)
+  ;; Inhibit messages if indicated
+  (inhibit-message org-edna-test-inhibit-messages))
+ ,@body))
+
+(defmacro org-edna-with-point-at-test-heading (heading-id  body)
+  (declare (indent 1))
+  `(org-with-point-at (org-edna-find-test-heading ,heading-id)
+ ,@body))
+
+(defmacro org-edna-with-test-heading (heading-id  body)
+  "Establish a test case with test heading HEADING-ID.
+
+HEADING-ID is a UUID string of a heading to use.
+
+Moves point to the heading, protects the test file, sets default
+test settings, then runs BODY."
+  (declare (indent 1))
+  `(org-edna-test-setup
+ (org-edna-protect-test-file
+   (org-edna-with-point-at-test-heading ,heading-id
+ ,@body
+
 (defun org-edna-find-test-heading (id)
   "Find the test heading with id ID.
 
@@ -97,8 +139,11 @@ This avoids org-id digging into its internal database."
   (dolist (pom poms)
 (org-edna-test-change-todo-state pom "TODO")))
 
+(defun org-edna-test-children-marks ()
+  (org-edna-collect-descendants nil))
+
 
- Parser Tests
+;;; Parser Tests
 
 (ert-deftest org-edna-parse-form-no-arguments ()
   (let* ((input-string "test-string")
@@ -469,48 +514,48 @@ This avoids org-id digging into its internal database."
 (should (equal output-form expected-form
 
 
-;; Finders
+;;; Finders
 
 (defsubst org-edna-heading (pom)
   (org-with-point-at pom
 (org-get-heading t t t t)))
 
 (ert-deftest org-edna-finder/match-single-arg ()
-  (let* ((org-agenda-files `(,org-edna-test-file))
- (targets (org-edna-finder/match "test&1")))
-(should (= (length targets) 2))
-(should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Heading 
1"))
-(should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Heading 
2"
+  (org-edna-test-setup
+(let* ((targets (org-edna-finder/match "test&1")))
+  (should (= (length targets) 2))
+  (should (string-equal (org-edna-heading (nth 0 targets)) "Tagged Heading 
1"))
+  (should (string-equal (org-edna-heading (nth 1 targets)) "Tagged Heading 
2")
 
 (ert-deftest org-edna-finder/ids-single ()
-  (let* ((org-agenda-files `(,org-edna-test-file))
- (test-id "caccd0a6-d400-410a-9018-b0635b07a37e")
- (targets (org-edna-finder/ids test-id)))
-(should (= (length targets) 1))
-(should (string-equal (org-edna-heading (nth 0 targets)) "Blocking Test"))
-(should (string-equal (org-entry-get (nth 0 targets) "ID") test-id
+  (org-edna-test-setup
+(let* ((test-id "caccd0a6-d400-410a-901

[elpa] master 6869846 130/135: Merged fix.

2020-02-17 Thread Ian Dunn
branch: master
commit 686984683904a06ae561341522bf34dbb04aa919
Merge: bad787d 4c8058f
Author: Ian Dunn 
Commit: Ian Dunn 

Merged fix.

Copyright exempt.



[elpa] master 31c40be 100/135: Fixed up Changelog in documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 31c40be5b1ba6de14aa6d329c907a48acb9c25fd
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed up Changelog in documentation

* org-edna.org (Changelog): Use lists, not headings, to avoid cluttering 
info
  output
---
 org-edna.org | 42 +-
 1 file changed, 21 insertions(+), 21 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index e062701..dd53c6b 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1298,33 +1298,33 @@ making any changes:
 - Fixed compatibility with new Org effort functions
 ** 1.0beta4
 Just some bug fixes from the new form parsing.
-*** Fixed multiple forms getting incorrect targets
-*** Fixed multiple forms not evaluating
+- Fixed multiple forms getting incorrect targets
+- Fixed multiple forms not evaluating
 ** 1.0beta3
 HUGE addition here
-*** Conditional Forms
-- See [[#conditional_forms][Conditional Forms]] for more information
-*** Overhauled Internal Parsing
-*** Fixed consideration keywords
+- Conditional Forms
+  - See [[#conditional_forms][Conditional Forms]] for more information
+- Overhauled Internal Parsing
+- Fixed consideration keywords
 - Both consider and consideration are accepted now
-*** Added 'any consideration
-- Allows passage if just one target is fulfilled
+- Added 'any consideration
+  - Allows passage if just one target is fulfilled
 ** 1.0beta2
 Big release here, with three new features.
 
-*** Added interactive keyword editor with completion
-- See [[#setting_keywords][Setting the Properties]] for how to do that
+- Added interactive keyword editor with completion
+  - See [[#setting_keywords][Setting the Properties]] for how to do that
 
-*** New uses of schedule! and deadline!
-- New "float" form that mimics diary-float
-- New "landing" addition to "+1d" and friends to force planning changes to 
land on a certain day or type of day (weekend/weekday)
-- See [[#planning][Scheduled/Deadline]] for details
+- New uses of schedule! and deadline!
+  - New "float" form that mimics diary-float
+  - New "landing" addition to "+1d" and friends to force planning changes to 
land on a certain day or type of day (weekend/weekday)
+  - See [[#planning][Scheduled/Deadline]] for details
 
-*** New "relatives" finder
-- Renamed from chain-find with tons of new keywords
-- Modified all other relative finders (previous-sibling, first-child, etc.) to 
use the same keywords
-- See [[#relatives][relatives]] for details
+- New "relatives" finder
+  - Renamed from chain-find with tons of new keywords
+  - Modified all other relative finders (previous-sibling, first-child, etc.) 
to use the same keywords
+  - See [[#relatives][relatives]] for details
 
-*** New finders
-- [[#previous-sibling-wrap][previous-sibling-wrap]]
-- [[#rest-of-siblings-wrap][rest-of-siblings-wrap]]
+- New finders
+  - [[#previous-sibling-wrap][previous-sibling-wrap]]
+  - [[#rest-of-siblings-wrap][rest-of-siblings-wrap]]



[elpa] master 7776cb4 079/135: Added documentation for popout editing

2020-02-17 Thread Ian Dunn
branch: master
commit 7776cb4e866784aaa727cb05350ea6886ea50b33
Author: Ian Dunn 
Commit: Ian Dunn 

Added documentation for popout editing

* org-edna.el (org-edna-edit): Added explanation of how to abort changes.

* org-edna.org (Setting the Properties): New section

* org-edna.info: Updated from org-edna.org
---
 org-edna.el   |   5 +-
 org-edna.info | 168 +++---
 org-edna.org  |  39 +-
 3 files changed, 143 insertions(+), 69 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index ccee794..c8e466d 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -,10 +,9 @@ Form 3: consider the condition met if only P% of the 
targets pass."
 (setq-local org-window-configuration wc)
 (setq-local org-selected-window sel-win)
 (setq-local org-finish-function 'org-edna-edit-finish)
-(insert (substitute-command-keys "\\\
-Edit blockers and triggers in this buffer under their respective sections 
below.
+(insert "Edit blockers and triggers in this buffer under their respective 
sections below.
 All lines under a given section will be merged into one when saving back to
-the source buffer.  Finish with `\\[org-ctrl-c-ctrl-c]' or 
`\\[org-edit-special]'.\n\n"))
+the source buffer.  Finish with `C-c C-c' or abort with `C-c C-k'")
 (setq-local org-edna-blocker-section-marker (point-marker))
 (insert (format "BLOCKER\n%s\n\n" blocker))
 (setq-local org-edna-trigger-section-marker (point-marker))
diff --git a/org-edna.info b/org-edna.info
index bf4d14b..999d669 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -75,6 +75,7 @@ Advanced Features
 
 * Conditions::
 * Consideration::
+* Setting the properties::
 
 Conditions
 
@@ -852,6 +853,7 @@ Advanced Features
 
 * Conditions::
 * Consideration::
+* Setting the properties::
 
 
 File: org-edna.info,  Node: Conditions,  Next: Consideration,  Up: Advanced 
Features
@@ -861,7 +863,11 @@ Conditions
 
 Edna gives you he option to specify *blocking conditions*.  Each
 condition is checked for each of the specified targets; if one of the
-conditions returns true for that target, then that heading is blocked.
+conditions returns true for that target, then the source heading is
+blocked.
+
+   If no condition is specified, ‘!done?’ is used by default, which
+means block if any target heading isn’t done.
 
 * Menu:
 
@@ -881,7 +887,7 @@ done
 
• Syntax: done?
 
-   Blocks the source heading if any target is DONE.
+   Blocks the source heading if any target heading is DONE.
 
 
 File: org-edna.info,  Node: headings,  Next: todo-state,  Prev: done,  Up: 
Conditions
@@ -892,7 +898,7 @@ headings
• Syntax: headings?
 
Blocks the source heading if any target belongs to a file that has an
-Org heading.
+Org heading.  This means that target does not have to be a heading.
 
  org-file("refile.org") headings?
 
@@ -906,7 +912,7 @@ todo-state
 
• Syntax: todo-state?(STATE)
 
-   Blocks if any target has a heading with TODO state set to STATE.
+   Blocks if any target heading has TODO state set to STATE.
 
STATE may be a string or a symbol.
 
@@ -918,11 +924,12 @@ variable-set
 
• Syntax: variable-set?(VARIABLE VALUE)
 
-   Blocks the source heading if VARIABLE is set to VALUE.
+   Evaluate VARIABLE when visiting a target, and compare it with ‘equal’
+against VALUE. Block the source heading if VARIABLE = VALUE.
 
-   VARIABLE should be a symbol, and VALUE is any valid lisp expression
+   VARIABLE should be a symbol, and VALUE is any valid lisp expression.
 
- self variable-set?(test-variable,12)
+ self variable-set?(test-variable 12)
 
 
 File: org-edna.info,  Node: has-property,  Next: re-search,  Prev: 
variable-set,  Up: Conditions
@@ -955,15 +962,15 @@ File: org-edna.info,  Node: Negating Conditions,  Prev: 
re-search,  Up: Conditio
 Negating Conditions
 ---
 
-Any condition can be negated using ’!’.
+Any condition can be negated by using ’!’ before the condition.
 
- match("test") !has-property?("PROP","1")
+ match("test") !has-property?("PROP" "1")
 
The above example will cause the source heading to block if any
 heading tagged “test” does *not* have the property PROP set to “1”.
 
 
-File: org-edna.info,  Node: Consideration,  Prev: Conditions,  Up: Advanced 
Features
+File: org-edna.info,  Node: Consideration,  Next: Setting the properties,  
Prev: Conditions,  Up: Advanced Features
 
 Consideration
 =
@@ -1002,6 +1009,36 @@ are complete.
If no consideration is given, ALL is assumed.
 
 
+File: org-edna.info,  Node: Setting the properties,  Prev: Consideration,  Up: 
Advanced Features
+
+Setting the properties
+==
+
+There are two ways to set the BLOCKER and TRIGGER properties: by hand,
+or the easy way.  You can probably guess which way we prefer.
+
+   With

[elpa] master 1f2adab 097/135: Updated copyright

2020-02-17 Thread Ian Dunn
branch: master
commit 1f2adab37d82174e2659346b426fc85b73112e92
Author: Ian Dunn 
Commit: Ian Dunn 

Updated copyright
---
 Makefile   |   2 +-
 defaults.mk|   2 +-
 org-edna-tests.el  |   2 +-
 org-edna-tests.org |   2 +-
 org-edna.el|   2 +-
 org-edna.info  | 148 ++---
 org-edna.org   |   2 +-
 7 files changed, 80 insertions(+), 80 deletions(-)

diff --git a/Makefile b/Makefile
index 765fe32..2c123ca 100644
--- a/Makefile
+++ b/Makefile
@@ -1,6 +1,6 @@
 # This is part of org-edna
 #
-#  Copyright (C) 2017 Ian Dunn.
+# Copyright (C) 2017-2018 Free Software Foundation, Inc.
 #
 #  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
diff --git a/defaults.mk b/defaults.mk
index aed4ab3..f599ee4 100644
--- a/defaults.mk
+++ b/defaults.mk
@@ -1,6 +1,6 @@
 # This is part of org-edna
 #
-#  Copyright (C) 2017 Ian Dunn.
+#  Copyright (C) 2017-2018 Free Software Foundation, Inc.
 #
 #  This program is free software: you can redistribute it and/or modify
 #  it under the terms of the GNU General Public License as published by
diff --git a/org-edna-tests.el b/org-edna-tests.el
index 83c05a3..8d6df7c 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -1,6 +1,6 @@
 ;;; org-edna-tests.el --- Tests for org-edna
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
 ;; Keywords: convenience, text, org
diff --git a/org-edna-tests.org b/org-edna-tests.org
index 01c0dcc..9dced13 100644
--- a/org-edna-tests.org
+++ b/org-edna-tests.org
@@ -2,7 +2,7 @@
 #+PROPERTY: EFFORT_ALL 0:01 0:02 0:03
 
 * COMMENT Copying
-Copyright (C) 2017 Ian Dunn
+Copyright (C) 2017-2018 Free Software Foundation, Inc.
 
 #+BEGIN_QUOTE
 This program is free software: you can redistribute it and/or modify
diff --git a/org-edna.el b/org-edna.el
index b071b38..9e19f40 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1,6 +1,6 @@
 ;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017 Free Software Foundation, Inc.
+;; Copyright (C) 2017-2018 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
 ;; Maintainer: Ian Dunn 
diff --git a/org-edna.info b/org-edna.info
index 5a7db99..8745526 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -140,7 +140,7 @@ File: org-edna.info,  Node: Copying,  Next: Introduction,  
Prev: Top,  Up: Top
 Copying
 ***
 
-Copyright (C) 2017 Free Software Foundation, Inc.
+Copyright (C) 2017-2018 Free Software Foundation, Inc.
 
  This program is free software: you can redistribute it and/or
  modify it under the terms of the GNU General Public License as
@@ -1608,79 +1608,79 @@ New finders
 Tag Table:
 Node: Top225
 Node: Copying4054
-Node: Introduction4871
-Node: Installation and Setup5819
-Node: Basic Operation6612
-Node: Blockers8463
-Node: Triggers8749
-Node: Syntax9011
-Node: Basic Features9701
-Node: Finders10004
-Node: ancestors11769
-Node: children12363
-Node: descendants12773
-Node: file13295
-Node: first-child14044
-Node: ids14304
-Node: match14965
-Node: next-sibling15603
-Node: next-sibling-wrap15860
-Node: olp16174
-Node: org-file16586
-Node: parent17231
-Node: previous-sibling17429
-Node: previous-sibling-wrap17690
-Node: relatives17969
-Node: rest-of-siblings21590
-Node: rest-of-siblings-wrap21875
-Node: self4
-Node: siblings22385
-Node: siblings-wrap22622
-Node: Actions22926
-Node: Scheduled/Deadline23668
-Node: TODO State27243
-Node: Archive27611
-Node: Chain Property27931
-Node: Clocking28214
-Node: Property28626
-Node: Priority28948
-Node: Tag29517
-Node: Effort29734
-Node: Advanced Features30123
-Node: Conditions30507
-Node: done31122
-Node: headings31286
-Node: todo-state31662
-Node: variable-set31918
-Node: has-property32347
-Node: re-search32616
-Node: Negating Conditions32976
-Node: Consideration33363
-Node: Conditional Forms34932
-Node: Setting the Properties37588
-Node: Extending Edna38672
-Node: Naming Conventions39162
-Node: Finders (1)39625
-Node: Actions (1)39991
-Node: Conditions (1)40456
-Node: Contributing41346
-Node: Bugs41897
-Node: Development42249
-Node: Documentation43402
-Node: Changelog43847
-Node: 10beta444013
-Node: Fixed multiple forms getting incorrect targets44252
-Node: Fixed multiple forms not evaluating44483
-Node: 10beta344692
-Node: Conditional Forms (1)44966
-Node: Overhauled Internal Parsing45165
-Node: Fixed consideration keywords45362
-Node: Added 'any consideration45621
-Node: 10beta245836
-Node: Added interactive keyword editor with completion46118
-Node: New uses of schedule! and deadline!46417
-Node: New ``relatives'' finder46912
-Node: New finders47308
+Node: Introduction4876
+Node: Installation and Setup5824
+Node: Basic Operation6617
+Node: Blockers8468
+Node

[elpa] master d5c8002 121/135: Inverted definition of consideration

2020-02-17 Thread Ian Dunn
branch: master
commit d5c80028e8dc03f63111ed2d04a25add7f9356a5
Author: Ian Dunn 
Commit: Ian Dunn 

Inverted definition of consideration

Makes it clearer how it works with the rest of the system.

* org-edna.el (org-edna-handle-consideration): Inverted semantics.

* org-edna-tests.el (org-edna-test-inhibit-messages): New defvar to silence 
org
  mode's messages during testing.
  (org-edna-consideration/any): New test.
  (org-edna-consideration/all):
  (org-edna-consideration/integer):
  (org-edna-consideration/float): Updated tests to match new semantics.
  (org-edna-doc-test/daily): Expanded scope of test.
  (org-edna-doc-test/snow-shoveling):
  (org-edna-doc-test/consider-fraction):
  (org-edna-doc-test/consider-number): New tests from docs.

* org-edna.org (Consideration): Updated section.
  (Conditional Forms): Updated semantics of consideration.

* test.mk: Set `org-edna-test-inhibit-messages' to silence Org messages.
---
 org-edna-tests.el  | 278 -
 org-edna-tests.org |  41 +++-
 org-edna.el|  70 --
 org-edna.info  | 261 -
 org-edna.org   |  92 --
 test.mk|   1 +
 6 files changed, 532 insertions(+), 211 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 6f5fa5e..52c901a 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -26,6 +26,9 @@
 (require 'ert)
 (require 'org-id)
 
+(defvar org-edna-test-inhibit-messages nil
+  "Whether to inhibit messages (apart from ERT messages).")
+
 (defconst org-edna-test-dir
   (expand-file-name (file-name-directory (or load-file-name 
buffer-file-name
 
@@ -1184,6 +1187,7 @@ This avoids org-id digging into its internal database."
 
 (ert-deftest org-edna-action/todo-test ()
   (let* ((org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"0d491588-7da3-43c5-b51a-87fbd34f79f7")))
 (unwind-protect
 (org-with-point-at target
@@ -1203,6 +1207,7 @@ This avoids org-id digging into its internal database."
   ;; Override `current-time' so we can get a deterministic value
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
  (org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"0d491588-7da3-43c5-b51a-87fbd34f79f7")))
 (unwind-protect
 (org-with-point-at target
@@ -1220,6 +1225,7 @@ This avoids org-id digging into its internal database."
 
 (ert-deftest org-edna-action-scheduled/cp ()
   (let* ((org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"0d491588-7da3-43c5-b51a-87fbd34f79f7"))
  (source (org-edna-find-test-heading 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5"))
  (pairs '((cp . rm) (copy . remove) ("cp" . "rm") ("copy" . 
"remove"
@@ -1237,6 +1243,7 @@ This avoids org-id digging into its internal database."
   ;; Override `current-time' so we can get a deterministic value
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
  (org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5")))
 (unwind-protect
 (org-with-point-at target
@@ -1295,6 +1302,7 @@ This avoids org-id digging into its internal database."
   ;; Override `current-time' so we can get a deterministic value
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
  (org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5")))
 (unwind-protect
 (org-with-point-at target
@@ -1321,6 +1329,7 @@ This avoids org-id digging into its internal database."
   ;; Override `current-time' so we can get a deterministic value
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
  (org-agenda-files `(,org-edna-test-file))
+ (inhibit-message org-edna-test-inhibit-messages)
  (target (org-edna-find-test-heading 
"caf27724-0887-4565-9765-ed2f1edcfb16")))
 (unwind-protect
 (org-with-point-at target
@@ -1345,6 +1354,7 @@ This avoids org-id digging into its internal database."
 (ert-deftest org-edna-action-scheduled/float ()
   (cl-letf* (((symbol-function 'current-time) (lambda () org-edna-test-time))
 

[elpa] master 6b3923b 110/135: Added tests for cache

2020-02-17 Thread Ian Dunn
branch: master
commit 6b3923bc630d70732925b19479e54aad960d72cf
Author: Ian Dunn 
Commit: Ian Dunn 

Added tests for cache

* org-edna.el (org-edna--get-cache-entry): New function for finding an 
entry in
  cache.
  (org-edna--handle-finder): Use it.
  (org-edna--expand-single-sexp-form): Update calling method of
  `org-edna--handle-finder'.

* org-edna-tests.el (org-edna-cache/no-entry):
  (org-edna-cache/added-new-entry):
  (org-edna-cache/timed-out): New tests for cache.
---
 org-edna-tests.el | 71 ---
 org-edna.el   | 58 +
 2 files changed, 100 insertions(+), 29 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 827e242..890ddd9 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -270,7 +270,7 @@
  '(let ((targets1 nil)
 (consideration1 nil)
 (blocking-entry1 nil))
-(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self 'nil)))
+(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self (quote
 (setq blocking-entry1
   (or blocking-entry1
   (org-edna--handle-condition 'org-edna-condition/done?
@@ -303,7 +303,7 @@
(blocking-entry2 blocking-entry1))
(setq targets2
  (org-edna--add-targets targets2
-(org-edna--handle-finder 
'org-edna-finder/match '("checklist"
+(org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
(org-edna--handle-action 'org-edna-action/todo!
 targets2
 (point-marker)
@@ -313,7 +313,7 @@
(blocking-entry5 blocking-entry1))
(setq targets5
  (org-edna--add-targets targets5
-(org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
+(org-edna--handle-finder 
'org-edna-finder/siblings (quote
(org-edna--handle-action 'org-edna-action/todo!
 targets5
 (point-marker)
@@ -355,7 +355,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
+ (org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -365,7 +365,7 @@
;; Add targets for self finder
(setq targets1
  (org-edna--add-targets targets1
-(org-edna--handle-finder 
'org-edna-finder/self 'nil)))
+(org-edna--handle-finder 
'org-edna-finder/self (quote
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
 (point-marker)
@@ -375,7 +375,7 @@
  ;; Find siblings
  (setq targets1
(org-edna--add-targets targets1
-  (org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
+  (org-edna--handle-finder 
'org-edna-finder/siblings (quote
  ;; Mark as DONE
  (org-edna--handle-action 'org-edna-action/todo! targets1
   (point-marker)
@@ -416,7 +416,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
+ (org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -426,7 +426,7 @@
;; Add targets for self finder
   

[elpa] master e6f88e7 069/135: Silenced byte-compiler

2020-02-17 Thread Ian Dunn
branch: master
commit e6f88e7b7de87e6187356540d61d2e09e15e39db
Author: Ian D 
Commit: Ian D 

Silenced byte-compiler

* org-edna.el: Correctly declare lm-report-bug
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 883e92d..dd8ba6c 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -702,7 +702,7 @@ Test will block if the heading \"path/to/heading\" in 
\"test.org\" is not DONE."
 
 
 
-(declare-function 'lm-report-bug "lisp-mnt" (topic))
+(declare-function lm-report-bug "lisp-mnt" (topic))
 
 (defun org-edna-submit-bug-report (topic)
   (interactive "sTopic: ")



[elpa] master 0503710 080/135: Bumped version to beta1

2020-02-17 Thread Ian Dunn
branch: master
commit 0503710955afa1b787173b8fd755a93ffc070493
Author: Ian Dunn 
Commit: Ian Dunn 

Bumped version to beta1
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index c8e466d..9a7e043 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0alpha1
+;; Version: 1.0beta1
 
 ;; This file is part of GNU Emacs.
 



[elpa] master 8a21978 042/135: Fixed copyright notices

2020-02-17 Thread Ian Dunn
branch: master
commit 8a21978307a55949b713bc500b98bf41ac0a1da4
Author: Ian D 
Commit: Ian D 

Fixed copyright notices

* org-edna.el: Fixed typo in copyright notice.

* org-edna-tests.el: Fixed typo in copyright notice.
---
 org-edna-tests.el | 26 --
 org-edna.el   | 17 -
 2 files changed, 20 insertions(+), 23 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 152a087..636d9af 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -7,20 +7,18 @@
 
 ;; This file is NOT part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
-
-;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-;; License for more details.
-
-;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the Free
-;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
-;; 02110-1301, USA.
+;; This program is free software; you can redistribute it and/or modify it 
under
+;; the terms of the GNU General Public License as published by the Free 
Software
+;; Foundation; either version 3, or (at your option) any later version.
+
+;; This program is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS
+;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+;; details.
+
+;; You should have received a copy of the GNU General Public License along with
+;; This program; see the file COPYING.  If not, write to the Free Software
+;; Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 ;;; Commentary:
 
diff --git a/org-edna.el b/org-edna.el
index 3f01a4d..0911ff8 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,18 +7,17 @@
 
 ;; This file is NOT part of GNU Emacs.
 
-;; GNU Emacs is free software; you can redistribute it and/or modify it
-;; under the terms of the GNU General Public License as published by
-;; the Free Software Foundation; either version 3, or (at your option)
-;; any later version.
+;; This program is free software; you can redistribute it and/or modify it 
under
+;; the terms of the GNU General Public License as published by the Free 
Software
+;; Foundation; either version 3, or (at your option) any later version.
 
-;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
-;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
-;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
-;; License for more details.
+;; This program is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 
FITNESS
+;; FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
+;; details.
 
 ;; You should have received a copy of the GNU General Public License
-;; along with GNU Emacs; see the file COPYING.  If not, write to the Free
+;; along with this program; see the file COPYING.  If not, write to the Free
 ;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
 ;; 02110-1301, USA.
 



[elpa] master 827d7c1 060/135: Fixed up chain test

2020-02-17 Thread Ian Dunn
branch: master
commit 827d7c15e131971fba257ea5dd0e3bd60ac15864
Author: Ian D 
Commit: Ian D 

Fixed up chain test

* org-edna-tests.el (org-edna-action-chain): Remove TEST property from both
  headings.
---
 org-edna-tests.el | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 27110b3..3ba5c28 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -437,7 +437,8 @@
 (org-with-point-at new-pom
   (org-edna-action/chain! old-pom "TEST")
   (should (equal (org-entry-get nil "TEST") "1")))
-(org-entry-delete old-pom "TEST")))
+(org-entry-delete old-pom "TEST")
+(org-entry-delete new-pom "TEST")))
 
 
 ;; Conditions



[elpa] master f909703 114/135: Added note about naming conventions.

2020-02-17 Thread Ian Dunn
branch: master
commit f9097031fbd516d2fe4c0ffe2ea7c6e807faf39e
Author: Ian Dunn 
Commit: Ian Dunn 

Added note about naming conventions.

* org-edna.org (Naming Conventions): Added note about reserved characters.
---
 org-edna.info | 44 +---
 org-edna.org  |  6 ++
 2 files changed, 31 insertions(+), 19 deletions(-)

diff --git a/org-edna.info b/org-edna.info
index 07c97ff..d1f6a35 100644
--- a/org-edna.info
+++ b/org-edna.info
@@ -1403,6 +1403,12 @@ predicates with ’?’.
Thus, one can have an action that files a target, and a finder that
 finds a file.
 
+   We recommend that you don’t name a finder with a special character at
+the end of its name.  As we devise new ideas, we consider using special
+characters for additional categories of keywords.  Thus, to avoid
+complications in the future, it’s best if everyone avoids using
+characters that may become reserved in the future.
+
 
 File: org-edna.info,  Node: Finders 1,  Next: Actions 1,  Prev: Naming 
Conventions,  Up: Extending Edna
 
@@ -1830,25 +1836,25 @@ Node: Conditional Forms38485
 Node: Setting the Properties41141
 Node: Extending Edna42225
 Node: Naming Conventions42715
-Node: Finders 143176
-Node: Actions 143538
-Node: Conditions 143997
-Node: Contributing44883
-Node: Bugs45749
-Node: Working with EDE46106
-Node: Compiling Edna47190
-Node: Testing Edna48059
-Node: Before Sending Changes49040
-Node: Developing with Bazaar49727
-Node: Documentation50468
-Node: Changelog50924
-Node: 10beta851174
-Node: 10beta751286
-Node: 10beta651580
-Node: 10beta551856
-Node: 10beta452243
-Node: 10beta352496
-Node: 10beta252935
+Node: Finders 143507
+Node: Actions 143869
+Node: Conditions 144328
+Node: Contributing45214
+Node: Bugs46080
+Node: Working with EDE46437
+Node: Compiling Edna47521
+Node: Testing Edna48390
+Node: Before Sending Changes49371
+Node: Developing with Bazaar50058
+Node: Documentation50799
+Node: Changelog51255
+Node: 10beta851505
+Node: 10beta751617
+Node: 10beta651911
+Node: 10beta552187
+Node: 10beta452574
+Node: 10beta352827
+Node: 10beta253266
 
 End Tag Table
 
diff --git a/org-edna.org b/org-edna.org
index c0612e2..2a58b5c 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1187,6 +1187,12 @@ Scheme to suffix destructive functions with '!' and 
predicates with '?'.
 Thus, one can have an action that files a target, and a finder that finds a
 file.
 
+We recommend that you don't name a finder with a special character at the end 
of
+its name.  As we devise new ideas, we consider using special characters for
+additional categories of keywords.  Thus, to avoid complications in the future,
+it's best if everyone avoids using characters that may become reserved in the
+future.
+
 ** Finders
 :PROPERTIES:
 :DESCRIPTION: Making a new finder



[elpa] master f45f911 115/135: Mention consider in opening of Consideration section

2020-02-17 Thread Ian Dunn
branch: master
commit f45f911c2b9fbeb5f84f17ed34f8a7d8cab91d81
Author: Ian Dunn 
Commit: Ian Dunn 

Mention consider in opening of Consideration section

* org-edna.org (Consideration): Mention consider.
---
 org-edna.org | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/org-edna.org b/org-edna.org
index 2a58b5c..65d1832 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1015,7 +1015,8 @@ tagged "test" does *not* have the property PROP set to 
"1".
 :DESCRIPTION: Only some of them
 :END:
 
-"Consideration" is a special keyword that's only valid for blockers.
+"Consideration" and "consider" are special keywords that are only valid for
+blockers.
 
 This says "Allow a task to complete if CONSIDERATION of its targets pass the
 given condition".



[elpa] master 836feb4 062/135: Fixed actions and documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 836feb47dc51e64739e2fb5d9efef30377118b8a
Author: Ian D 
Commit: Ian D 

Fixed actions and documentation

* org-edna.org (Archive): Documented org-edna-prompt-for-archive.
  (TODO State): Fixed syntax
  (Scheduled/Deadline): Fixed example
---
 org-edna.org | 9 ++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index 1d1f17a..3ab9a9e 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -494,10 +494,10 @@ There are several forms that the planning keywords can 
take:
 
 Examples:
 
-scheduled("Mon 09:00") -> Set SCHEDULED to the following Monday at 9:00
-*** Todo State
+scheduled!("Mon 09:00") -> Set SCHEDULED to the following Monday at 9:00
+*** TODO State
 
-Syntax: todo(NEW-STATE)
+Syntax: todo!(NEW-STATE)
 
 Sets the TODO state of the target headline to NEW-STATE.
 
@@ -512,6 +512,9 @@ Syntax: archive!
 
 Archives all targets with confirmation.
 
+Confirmation is controlled with ~org-edna-prompt-for-archive~.  If this option 
is
+nil, Edna will not ask before archiving the target.
+
 *** Chain Property
 
 Syntax: chain!("PROPERTY")



[elpa] master f265a6b 102/135: Fixed error reporting

2020-02-17 Thread Ian Dunn
branch: master
commit f265a6b2e8a6c004d5f796efeb00bc3823e97d95
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed error reporting

* org-edna.el (org-edna--syntax-error): Take the error position as an 
argument.
  (org-edna--print-syntax-error): Update contents of error-plist.
  (org-edna--convert-form): Add the position to the returned forms.
  (org-edna--normalize-sexp-form): Pass that position to error functions.
---
 org-edna.el | 27 +--
 1 file changed, 13 insertions(+), 14 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index cfd6d16..947d8f6 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -70,20 +70,19 @@ properties used during actions or conditions."
 ;; 2. Edna sexp form; this is the intermediary form, and form used in 
org-edna-form
 ;; 3. Lisp form; a form that can be evaluated by Emacs
 
-(defmacro org-edna--syntax-error (msg form error-form)
+(defmacro org-edna--syntax-error (msg form error-pos)
   "Signal an Edna syntax error.
 
 MSG will be reported to the user and should describe the error.
 FORM is the form that generated the error.
-ERROR-FORM is the sub-form in FORM at which the error occurred."
-  `(signal 'invalid-read-syntax (list :msg ,msg :form ,form :error-form 
,error-form)))
+ERROR-POS is the positiong in MSG at which the error occurred."
+  `(signal 'invalid-read-syntax (list :msg ,msg :form ,form :error-pos 
,error-pos)))
 
 (defun org-edna--print-syntax-error (error-plist)
   "Prints the syntax error from ERROR-PLIST."
   (let* ((msg (plist-get error-plist :msg))
  (form (plist-get error-plist :form))
- (error-form (plist-get error-plist :error-form))
- (pos (string-match-p (symbol-name (car error-form)) form)))
+ (pos (plist-get error-plist :error-pos)))
 (message
  "Org Edna Syntax Error: %s\n%s\n%s"
  msg form (concat (make-string pos ?\ ) "^"
@@ -192,7 +191,7 @@ siblings todo!(TODO) => ((siblings) (todo! TODO))"
 final-form)
 (while (< pos (length string))
   (pcase-let* ((`(,form ,new-pos) (org-edna-parse-string-form string pos)))
-(setq final-form (append final-form (list form)))
+(setq final-form (append final-form (list (cons form pos
 (setq pos new-pos)))
 (cons final-form pos)))
 
@@ -212,7 +211,7 @@ the remainder of FORM after the current scope was parsed."
  final-form
  need-break)
 (while (and remaining-form (not need-break))
-  (let ((current-form (pop remaining-form)))
+  (pcase-let* ((`(,current-form . ,error-pos) (pop remaining-form)))
 (pcase (car current-form)
   ('if
   ;; Check the car of each r*-form for the expected
@@ -228,7 +227,7 @@ the remainder of FORM after the current scope was parsed."
   (unless (equal (car-safe r-form) '(then))
 (org-edna--syntax-error
  "Malformed if-construct; expected then terminator"
- from-string current-form))
+ from-string (cdr (car-safe r-form
   (setq cond-form temp-form
 remaining-form (cdr r-form)))
 (pcase-let* ((`(,temp-form ,r-form)
@@ -238,7 +237,7 @@ the remainder of FORM after the current scope was parsed."
   (unless (member (car-safe r-form) '((else) (endif)))
 (org-edna--syntax-error
  "Malformed if-construct; expected else or endif 
terminator"
- from-string current-form))
+ from-string (cdr (car-safe r-form
   (setq have-else (equal (car r-form) '(else))
 then-form temp-form
 remaining-form (cdr r-form)))
@@ -249,7 +248,7 @@ the remainder of FORM after the current scope was parsed."
from-string)))
 (unless (equal (car-safe r-form) '(endif))
   (org-edna--syntax-error "Malformed if-construct; 
expected endif terminator"
-  from-string current-form))
+  from-string (cdr (car-safe 
r-form
 (setq else-form temp-form
   remaining-form (cdr r-form
 (push `(if ,cond-form ,then-form ,else-form) final-form)))
@@ -263,7 +262,7 @@ the remainder of FORM after the current scope was parsed."
(pcase-let* ((`(,type . ,func) (org-edna--function-for-key (car 
current-form
  (unless (and type func)
(org-edna--syntax-error "Unrecognized Form"
-   from-string current-form))
+   from-string error-pos))
  (pcase t

[elpa] master c05b661 111/135: Added documentation about using a timeout for cache

2020-02-17 Thread Ian Dunn
branch: master
commit c05b6619b6a522f012b3a93d7a95aebdb2093060
Author: Ian Dunn 
Commit: Ian Dunn 

Added documentation about using a timeout for cache
---
 org-edna.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index 5a152e6..37c9849 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -469,6 +469,11 @@ which of the two types is allowed in STRING-FORM."
 ;; Cache works because the returned values of finders are all markers.  Markers
 ;; will automatically update themselves when a buffer is edited.
 
+;; We use a timeout for cache because it's expected that the Org files
+;; themselves will change.  Thus, there's no assured way to determine if we 
need
+;; to update the cache without actually running again.  Therefore, we assume
+;; most operations that the user wants to expedite will be performed in bulk.
+
 (cl-defstruct org-edna--finder-input
   func-sym args)
 



[elpa] master 4c26cc8 041/135: Added copyright and licensing information to all files

2020-02-17 Thread Ian Dunn
 PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+Also add information on how to contact you by electronic and paper mail.
+
+  If the program does terminal interaction, make it output a short
+notice like this when it starts in an interactive mode:
+
+  Copyright (C)   
+This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License.  Of course, your program's commands
+might be different; for a GUI interface, you would use an "about box".
+
+  You should also get your employer (if you work as a programmer) or school,
+if any, to sign a "copyright disclaimer" for the program, if necessary.
+For more information on this, and how to apply and follow the GNU GPL, see
+<http://www.gnu.org/licenses/>.
+
+  The GNU General Public License does not permit incorporating your program
+into proprietary programs.  If your program is a subroutine library, you
+may consider it more useful to permit linking proprietary applications with
+the library.  If this is what you want to do, use the GNU Lesser General
+Public License instead of this License.  But first, please read
+<http://www.gnu.org/philosophy/why-not-lgpl.html>.
diff --git a/org-edna-tests.el b/org-edna-tests.el
index 3ffc5a8..152a087 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -1,6 +1,26 @@
 ;;; org-edna-tests.el --- Tests for org-edna
 
-;; Author: Ian Dunn
+;; Author: Ian Dunn 
+;; Keywords: convenience, text, org
+;; Version: 1.0
+;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "8.0"))
+
+;; This file is NOT part of GNU Emacs.
+
+;; GNU Emacs is free software; you can redistribute it and/or modify it
+;; under the terms of the GNU General Public License as published by
+;; the Free Software Foundation; either version 3, or (at your option)
+;; any later version.
+
+;; GNU Emacs is distributed in the hope that it will be useful, but WITHOUT
+;; ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
+;; or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public
+;; License for more details.
+
+;; You should have received a copy of the GNU General Public License
+;; along with GNU Emacs; see the file COPYING.  If not, write to the Free
+;; Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+;; 02110-1301, USA.
 
 ;;; Commentary:
 
diff --git a/org-edna-tests.org b/org-edna-tests.org
index bd93dd6..0586f08 100644
--- a/org-edna-tests.org
+++ b/org-edna-tests.org
@@ -1,3 +1,20 @@
+* COMMENT Copying
+Copyright (C) 2017 Ian Dunn
+
+#+BEGIN_QUOTE
+This program is free software: you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation, either version 3 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#+END_QUOTE
 * Test Pool
 ** TODO Tagged Heading 1:1:test:
 ** TODO Tagged Heading 2:1:test:



[elpa] master 3748507 083/135: Add space between edit message and BLOCKER section

2020-02-17 Thread Ian Dunn
branch: master
commit 3748507304d6295a835f8f9408c8815e09907b87
Author: Ian Dunn 
Commit: Ian Dunn 

Add space between edit message and BLOCKER section

* org-edna.el (org-edna-edit): Modify edit message
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index d9c16d4..33ba1cb 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1119,7 +1119,7 @@ Form 3: consider the condition met if only P% of the 
targets pass."
 (setq-local org-finish-function 'org-edna-edit-finish)
 (insert "Edit blockers and triggers in this buffer under their respective 
sections below.
 All lines under a given section will be merged into one when saving back to
-the source buffer.  Finish with `C-c C-c' or abort with `C-c C-k'")
+the source buffer.  Finish with `C-c C-c' or abort with `C-c C-k'\n\n")
 (setq-local org-edna-blocker-section-marker (point-marker))
 (insert (format "BLOCKER\n%s\n\n" blocker))
 (setq-local org-edna-trigger-section-marker (point-marker))



[elpa] master 972968a 116/135: Modified cache to only work for specific finders

2020-02-17 Thread Ian Dunn
branch: master
commit 972968ad1a72af84551c15262a9d4a6a46ffd8fa
Author: Ian Dunn 
Commit: Ian Dunn 

Modified cache to only work for specific finders

* org-edna.el (org-edna-finder-cache-enabled-finders): List of finder 
functions
  for which cache is enabled.
  (org-edna--cache-is-enabled-for-finder): New function.
  (org-edna--handle-finder): Use it.
---
 org-edna.el | 24 +++-
 1 file changed, 23 insertions(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index ee10b17..dcb3157 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -505,6 +505,24 @@ adding unrelated headlines, will be taken into account."
   :group 'org-edna
   :type 'number)
 
+(defvar org-edna-finder-cache-enabled-finders
+  '(org-edna-finder/match
+org-edna-finder/ids
+org-edna-finder/olp
+org-edna-finder/file
+org-edna-finder/org-file)
+  "List of finders for which cache is enabled.
+
+Only edit this list if you've added custom finders.  Many
+finders, specifically relative finders, rely on the context in
+which they're called.  For these finders, cache will not work
+properly.
+
+The default state of this list contains the built-in finders for
+which context is irrelevant.
+
+Each entry is the function symbol for the finder.")
+
 (defun org-edna--add-to-finder-cache (func-sym args)
   (let* ((results (apply func-sym args))
  (input (make-org-edna--finder-input :func-sym func-sym
@@ -548,8 +566,12 @@ following reasons:
  ;; We have an entry created within the allowed interval.
  (t entry
 
+(defun org-edna--cache-is-enabled-for-finder (func-sym)
+  (memq func-sym org-edna-finder-cache-enabled-finders))
+
 (defun org-edna--handle-finder (func-sym args)
-  (if (not org-edna-finder-use-cache)
+  (if (or (not org-edna-finder-use-cache)
+  (not (org-edna--cache-is-enabled-for-finder func-sym)))
   ;; Not using cache, so use the function directly.
   (apply func-sym args)
 (let* ((entry (org-edna--get-cache-entry func-sym args)))



[elpa] master 491c810 132/135: Added minor mode for Edna

2020-02-17 Thread Ian Dunn
branch: master
commit 491c8104126c1c34b766c59bf88be9d91bc887f9
Author: Ian Dunn 
Commit: Ian Dunn 

Added minor mode for Edna

* org-edna.el (org-edna-mode): New command.
---
 org-edna.el | 15 ++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 38aff93..af51033 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0.2
+;; Version: 1.1.0
 
 ;; This file is part of GNU Emacs.
 
@@ -706,6 +706,19 @@ Remove Edna's workers from `org-trigger-hook' and
   (remove-hook 'org-trigger-hook 'org-edna-trigger-function)
   (remove-hook 'org-blocker-hook 'org-edna-blocker-function))
 
+;;;###autoload
+(define-minor-mode org-edna-mode
+  "Toggle Org Edna mode.
+
+Calls `org-edna-load' or `org-edna-unload'."
+  :init-value nil
+  :lighter " edna"
+  :group 'org-edna
+  :global t
+  (if org-edna-mode
+  (org-edna-load)
+(org-edna-unload)))
+
 
 ;;; Finders
 



[elpa] master 3f4595b 052/135: Finished rough draft of documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 3f4595b0a4986c59ee1304a25d49a5f3c1cc1f4c
Author: Ian D 
Commit: Ian D 

Finished rough draft of documentation
---
 org-edna.org | 170 +++
 1 file changed, 149 insertions(+), 21 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index 5144f5a..dba2bca 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -5,6 +5,7 @@
 
 #+STARTUP: overview
 #+TODO: FIXME | FIXED
+#+OPTIONS: toc:2
 
 Extensible Dependencies 'N' Actions for Org-Mode tasks
 
@@ -56,21 +57,21 @@ Edna can handle this for you like so:
 ,* TODO Put clothes in washer
   SCHEDULED: <2017-04-08 Sat 09:00>
   :PROPERTIES:
-  :TRIGGER: next-sibling scheduled(++1h)
+  :TRIGGER: next-sibling scheduled("++1h")
   :END:
 ,* TODO Put clothes in dryer
   :PROPERTIES:
-  :TRIGGER: next-sibling scheduled(++1h)
+  :TRIGGER: next-sibling scheduled("++1h")
   :BLOCKER:  previous-sibling
   :END:
 ,* TODO Fold laundry
   :PROPERTIES:
-  :TRIGGER: next-sibling scheduled(++1h)
+  :TRIGGER: next-sibling scheduled("++1h")
   :BLOCKER:  previous-sibling
   :END:
 ,* TODO Put clothes away
   :PROPERTIES:
-  :TRIGGER: next-sibling scheduled(++1h)
+  :TRIGGER: next-sibling scheduled("++1h")
   :BLOCKER:  previous-sibling
   :END:
 #+END_EXAMPLE
@@ -94,7 +95,7 @@ can help:
 #+BEGIN_EXAMPLE
 ,* TODO Address all TODOs in code
   :PROPERTIES:
-  :BLOCKER: file(main.cpp) file(code.cpp) re-search(TODO)
+  :BLOCKER: file("main.cpp") file("code.cpp") re-search("TODO")
   :END:
 ,* TODO Commit Code to Repository
 #+END_EXAMPLE
@@ -223,7 +224,19 @@ In order to get all levels of children of the current 
headline, use the
 The ~descendants~ finder returns a list of all descendants of the current
 headline.
 
-EXAMPLE HERE
+#+BEGIN_EXAMPLE
+,* TODO Heading 1
+   :PROPERTIES:
+   :BLOCKER:  descendants
+   :END:
+,** TODO Heading 2
+,** TODO Heading 3
+,*** TODO Heading 4
+, TODO Heading 5
+#+END_EXAMPLE
+
+In the above example, "Heading 1" will block until Headings 2, 3, 4, and 5 are
+DONE.
 
 *** file
 :PROPERTIES:
@@ -369,6 +382,11 @@ Returns the current headline.
 :PROPERTIES:
 :CUSTOM_ID: siblings
 :END:
+
+Syntax: siblings
+
+Returns all siblings of the source heading as targets.
+
 *** siblings-wrap
 
 Finds the siblings on the same level as the current headline, wrapping when it
@@ -382,8 +400,8 @@ them.
 :CUSTOM_ID: planning
 :END:
 
-scheduled(OPTIONS)
-deadline(OPTIONS)
+Syntax: scheduled(OPTIONS)
+Syntax: deadline(OPTIONS)
 
 There are several forms that the planning keywords can take:
 
@@ -419,15 +437,59 @@ Examples:
 
 scheduled("Mon 09:00") -> Set SCHEDULED to the following Monday at 9:00
 *** Todo State
-todo(NEW-STATE)
+
+Syntax: todo(NEW-STATE)
 
 Sets the TODO state of the target headline to NEW-STATE.
+
+NEW-STATE may either be a string or a symbol denoting the new TODO state.
+
 *** archive
-*** set-property
-*** set-priority
+
+Syntax: archive
+
+Archives all targets with confirmation.
+
+*** chain
+
+Syntax: chain("PROPERTY")
+
+Copies PROPERTY from the source entry to all targets.
+
 *** clock-in
+
+Syntax: clock-in
+
+Clocks into all targets (so be careful when using this with more than one
+target).
+
 *** clock-out
+
+Syntax: clock-out
+
+Clocks out of all targets
+*** set-property
+
+Syntax: set-property("PROPERTY","VALUE")
+
+Sets the property PROPERTY on all targets to VALUE.
+
+*** set-priority
+
+Syntax: set-priority(PRIORITY)
+
+Sets the priority of all targets to PRIORITY.  PRIORITY is processed as 
follows:
+
+- If PRIORITY is a string, the first character is used as the priority
+- Any other value is passed into ~org-priority~ verbatim, so it can be 'up, 
'down, or an integer
+
 *** tag
+
+Syntax: tag("TAG-SPEC")
+
+Tags all targets with TAG-SPEC, which is any valid tag specification,
+e.g. tag1:tag2
+
 *** set-effort
 * Advanced Features
 :PROPERTIES:
@@ -475,6 +537,8 @@ Syntax: todo-state(STATE)
 
 Blocks if any target has a headline with TODO state set to STATE.
 
+STATE may be a string or a symbol.
+
 *** variable-set
 :PROPERTIES:
 :CUSTOM_ID: variable-set
@@ -493,7 +557,7 @@ self variable-set(test-variable,12)
 :CUSTOM_ID: has-property
 :END:
 
-Syntax: has-property(PROPERTY,VALUE)
+Syntax: has-property("PROPERTY","VALUE")
 
 Tests each target for the property PROPERTY, and blocks if it's set to VALUE.
 
@@ -503,7 +567,7 @@ Tests each target for the property PROPERTY, and blocks if 
it's set to VALUE.
 :DESCRIPTION: Search for a regular expression
 :END:
 
-Syntax: re-search(REGEXP)
+Syntax: re-search("REGEXP")
 
 Blocks the current headline if the regular expression REGEXP is present in any
 of the targets.
@@ -518,11 +582,11 @@ as well.
 Any condition can be negated using '!'.
 
 #+BEGIN_EXAMPLE
-match(test) !has-property(PROP,1)
+match(test) !has-property("PROP","1")
 #+END_EXAMPLE
 
 The above example will cause the current headline to block if any headline
-tagged "test" does *not* have the property PROP set to 1.
+tagged "test" does *not* have the 

[elpa] master 7d30f60 088/135: Catch non-existent timestamps in planning action

2020-02-17 Thread Ian Dunn
branch: master
commit 7d30f60877802876f71e6da817e11705d1d39151
Author: Ian Dunn 
Commit: Ian Dunn 

Catch non-existent timestamps in planning action

* org-edna.el (org-edna--handle-planning): Throw an error if the source
  timestamp doesn't exist.
---
 org-edna.el | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index 01f13c3..f14bcc7 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1195,6 +1195,9 @@ forward) or the last day of MONTH (backward)."
   (pcase-let* ((`(,n ,what-string ,def) (org-edna--read-date-get-relative 
arg this-time current))
(ts (if def current-ts this-ts))
(what (cdr (assoc-string what-string type-map
+;; Ensure that the source timestamp exists
+(unless ts
+  (error "Tried to increment a non-existent timestamp"))
 (org--deadline-or-schedule nil type (org-edna--mod-timestamp ts n 
what
  (t
   ;; For everything else, assume `org-read-date-analyze' can handle it



[elpa] master 9a6ba17 071/135: Fixed up documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 9a6ba1795c44c45da467491af6c95a6c4cf07b68
Author: Ian D 
Commit: Ian D 

Fixed up documentation

* org-edna.el: Removed org annotations from docstrings.

* org-edna.org: Changed syntax snippets to lists.
---
 org-edna.el  | 28 +--
 org-edna.org | 63 ++--
 2 files changed, 40 insertions(+), 51 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 380ab87..e0d3cc0 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -301,12 +301,10 @@ into `org-map-entries'.
 SCOPE and SKIP are their counterparts in `org-map-entries'.
 SCOPE defaults to agenda, and SKIP defaults to nil.
 
-#+BEGIN_SRC org
-,* TODO Test
+* TODO Test
   :PROPERTIES:
   :BLOCKER:  match(\"test\" agenda)
   :END:
-#+END_SRC
 
 \"Test\" will block until all entries tagged \"test\" and
 \"mine\" in the agenda files are marked DONE."
@@ -407,16 +405,14 @@ IDS are all UUIDs as understood by `org-id-find'."
 
 Example:
 
-#+BEGIN_SRC org
-,* TODO Heading 1
-,** TODO Heading 2
-,*** TODO Heading 3
-, TODO Heading 4
-,* TODO Heading 5
+* TODO Heading 1
+** TODO Heading 2
+*** TODO Heading 3
+ TODO Heading 4
+* TODO Heading 5
   :PROPERTIES:
   :BLOCKER:  ancestors
   :END:
-#+END_SRC
 
 In the above example, Heading 5 will be blocked until Heading 1,
 Heading 3, and Heading 4 are marked DONE, while Heading 2 is
@@ -432,12 +428,10 @@ ignored."
 
 Finds the heading given by OLP in FILE.  Both arguments are strings.
 
-#+BEGIN_SRC org
-,* TODO Test
+* TODO Test
   :PROPERTIES:
   :BLOCKER:  olp(\"test.org\" \"path/to/heading\")
   :END:
-#+END_SRC
 
 Test will block if the heading \"path/to/heading\" in
 \"test.org\" is not DONE."
@@ -453,12 +447,10 @@ Test will block if the heading \"path/to/heading\" in
 The `file' finder finds a single file, specified as a string.
 The returned target will be the minimum point in the file.
 
-#+BEGIN_SRC org
-,* TODO Test
+* TODO Test
   :PROPERTIES:
   :BLOCKER:  file(\"~/myfile.org\") headings?
   :END:
-#+END_SRC
 
 Here, \"Test\" will block until myfile.org is clear of headlines.
 
@@ -474,12 +466,10 @@ Note that with the default condition, `file' won't work."
 A special form of `file', `org-file' will find FILE (a string) in
 `org-directory'.
 
-#+BEGIN_SRC org
-,* TODO Test
+* TODO Test
   :PROPERTIES:
   :BLOCKER:  org-file(\"test.org\")
   :END:
-#+END_SRC
 
 Note that the file still requires an extension."
   (with-current-buffer (find-file-noselect (expand-file-name file 
org-directory))
diff --git a/org-edna.org b/org-edna.org
index 930e7b0..bb31c85 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -307,7 +307,7 @@ DONE.
 :DESCRIPTION: Find a file by name
 :END:
 
-Syntax: file("FILE")
+- Syntax: file("FILE")
 
 The ~file~ finder finds a single file, specified as a string.  The returned 
target
 will be the minimum point in the file.
@@ -330,7 +330,7 @@ Here, "Test" will block until myfile.org is clear of 
headlines.
 :DESCRIPTION: Find the first child of a headline
 :END:
 
-Syntax: first-child
+- Syntax: first-child
 
 The ~first-child~ finder returns the first child of a headline, if any.
 
@@ -340,7 +340,7 @@ The ~first-child~ finder returns the first child of a 
headline, if any.
 :CUSTOM_ID: ids
 :END:
 
-Syntax: id(ID1 ID2 ...)
+- Syntax: id(ID1 ID2 ...)
 
 The ~ids~ finder will search for headlines with given IDs, using ~org-id~.  Any
 number of UUIDs may be specified.  For example:
@@ -364,7 +364,7 @@ Note that UUIDs need not be quoted; Edna will handle that 
for you.
 :DESCRIPTION: Good old tag matching
 :END:
 
-Syntax: match("MATCH-STRING" SCOPE SKIP)
+- Syntax: match("MATCH-STRING" SCOPE SKIP)
 
 The ~match~ keyword will take any arguments that ~org-map-entries~ usually 
takes.
 In fact, the arguments to ~match~ are passed straight into ~org-map-entries~.
@@ -388,7 +388,7 @@ argument.
 :DESCRIPTION: Find the next sibling
 :END:
 
-Syntax: next-sibling
+- Syntax: next-sibling
 
 The ~next-sibling~ keyword returns the next sibling of the current heading, if
 any.
@@ -399,7 +399,7 @@ any.
 :DESCRIPTION: Find a headline by its outline path
 :END:
 
-Syntax: olp("FILE" "OLP")
+- Syntax: olp("FILE" "OLP")
 
 Finds the heading given by OLP in FILE.  Both arguments are strings.
 
@@ -418,7 +418,7 @@ Finds the heading given by OLP in FILE.  Both arguments are 
strings.
 :DESCRIPTION: Find a file in org-directory
 :END:
 
-Syntax: org-file("FILE")
+- Syntax: org-file("FILE")
 
 A special form of ~file~, ~org-file~ will find FILE in ~org-directory~.
 
@@ -437,7 +437,7 @@ Note that the file still requires an extension.
 :DESCRIPTION: Find a parent
 :END:
 
-Syntax: parent
+- Syntax: parent
 
 Returns the parent of the current headline, if any.
 
@@ -447,18 +447,17 @@ Returns the parent of the current headline, if any.
 :DESCRIPTION: Find the previous sibling
 :END:
 
-Syntax: previous-sibling
+- Syntax: previous-sibling
 
 Returns the previous sibling of the 

[elpa] master 4142fb8 108/135: Updated tests for new form expansion

2020-02-17 Thread Ian Dunn
branch: master
commit 4142fb8bd9befa32741b7b535f943ef7caba9f78
Author: Ian Dunn 
Commit: Ian Dunn 

Updated tests for new form expansion

* org-edna-tests.el (org-edna-action-scheduled/landing-no-hour): New test to
  ensure landing doesn't mess with assigned time.
---
 org-edna-tests.el | 40 
 1 file changed, 32 insertions(+), 8 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 0a9ddca..827e242 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -270,7 +270,7 @@
  '(let ((targets1 nil)
 (consideration1 nil)
 (blocking-entry1 nil))
-(setq targets1 (org-edna--add-targets targets1 
(org-edna-finder/self)))
+(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self 'nil)))
 (setq blocking-entry1
   (or blocking-entry1
   (org-edna--handle-condition 'org-edna-condition/done?
@@ -303,7 +303,7 @@
(blocking-entry2 blocking-entry1))
(setq targets2
  (org-edna--add-targets targets2
-(org-edna-finder/match 
"checklist")))
+(org-edna--handle-finder 
'org-edna-finder/match '("checklist"
(org-edna--handle-action 'org-edna-action/todo!
 targets2
 (point-marker)
@@ -313,7 +313,7 @@
(blocking-entry5 blocking-entry1))
(setq targets5
  (org-edna--add-targets targets5
-(org-edna-finder/siblings)))
+(org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
(org-edna--handle-action 'org-edna-action/todo!
 targets5
 (point-marker)
@@ -355,7 +355,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna-finder/match 
"checklist")))
+ (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -365,7 +365,7 @@
;; Add targets for self finder
(setq targets1
  (org-edna--add-targets targets1
-(org-edna-finder/self)))
+(org-edna--handle-finder 
'org-edna-finder/self 'nil)))
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
 (point-marker)
@@ -375,7 +375,7 @@
  ;; Find siblings
  (setq targets1
(org-edna--add-targets targets1
-  (org-edna-finder/siblings)))
+  (org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
  ;; Mark as DONE
  (org-edna--handle-action 'org-edna-action/todo! targets1
   (point-marker)
@@ -416,7 +416,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna-finder/match 
"checklist")))
+ (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -426,7 +426,7 @@
;; Add targets for self finder
(setq targets1
  (org-edna--add-targets targets1
-(org-edna-finder/self)))
+(org-edna--handle-finder 
'org-edna-finder/self 'nil)))
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
 (point-marker)
@@ -1198,6 +1198,30 @@
   (should (string-equal (org-entry-get nil "SCHEDULED&quo

[elpa] master f80835a 038/135: Added tests for considerations

2020-02-17 Thread Ian Dunn
branch: master
commit f80835af84b1290fafb3fc27e68540692dc41917
Author: Ian D 
Commit: Ian D 

Added tests for considerations
---
 org-edna-tests.el | 22 ++
 1 file changed, 22 insertions(+)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index d304c2a..3ffc5a8 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -150,6 +150,28 @@
 
 ;; Consideration
 
+(ert-deftest org-edna-consideration/all ()
+  (let ((blocks-blocking `("a" nil "b"))
+(blocks-no-blocking `(nil nil nil)))
+(should (string-equal (org-edna-handle-consideration 'all blocks-blocking) 
"a"))
+(should (not (org-edna-handle-consideration 'all blocks-no-blocking)
+
+(ert-deftest org-edna-consideration/integer ()
+  (let ((blocks-blocking `("a" "c" "b"))
+(blocks-no-blocking `("a" nil "b"))
+(blocks-empty `(nil nil nil)))
+(should (string-equal (org-edna-handle-consideration 1 blocks-blocking) 
"a"))
+(should (not (org-edna-handle-consideration 1 blocks-no-blocking)))
+(should (not (org-edna-handle-consideration 1 blocks-empty)
+
+(ert-deftest org-edna-consideration/float ()
+  (let ((blocks-blocking `("a" "c" "b"))
+(blocks-no-blocking `("a" nil "b"))
+(blocks-empty `(nil nil nil)))
+(should (string-equal (org-edna-handle-consideration 0.25 blocks-blocking) 
"a"))
+(should (not (org-edna-handle-consideration 0.25 blocks-no-blocking)))
+(should (not (org-edna-handle-consideration 0.25 blocks-empty)
+
 (provide 'org-edna-tests)
 
 ;;; org-edna-tests.el ends here



[elpa] master 8e20fb9 098/135: Fixed failing effort test

2020-02-17 Thread Ian Dunn
branch: master
commit 8e20fb9287124fc9cdea6cb6caaace39c75b6d1e
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed failing effort test

* org-edna.el (org-edna-set-effort): New defun for compatibility
  (org-edna-action/set-effort!): Use it.
---
 org-edna.el | 11 +--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 9e19f40..9925af3 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1607,6 +1607,13 @@ Form 4: Set the target's priority to the character P."
 (string-to-char priority-action)
   priority-action)))
 
+(defun org-edna-set-effort (increment value)
+  "Compatibility function for `org-set-effort'."
+  ;; The signature of `org-set-effort' changed in 9.1.6
+  (if (version< org-version "9.1.6")
+  (org-set-effort value increment)
+(org-set-effort increment value)))
+
 (defun org-edna-action/set-effort! (_last-entry value)
   "Action to set the effort of a target heading.
 
@@ -1619,8 +1626,8 @@ the raw value for the effort.
 
 For form 2, increment the effort to the next allowed value."
   (if (eq value 'increment)
-  (org-set-effort nil value)
-(org-set-effort value nil)))
+  (org-edna-set-effort value nil)
+(org-edna-set-effort nil value)))
 
 (defun org-edna-action/archive! (_last-entry)
   "Action to archive a target heading.



[elpa] master 1d8bf6e 127/135: Fixed timestamp bug in scheduled! and deadline! actions

2020-02-17 Thread Ian Dunn
branch: master
commit 1d8bf6eca573c055ec670a9da8763b863a46617c
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed timestamp bug in scheduled! and deadline! actions

* org-edna.el (org-edna-timestamp-format): New defcustom.
  (org-edna--determine-timestamp-format): New helper function.
  (org-edna--handle-planning): Use it.
  (org-edna-action/scheduled!):
  (org-edna-action/deadline!): Document the format handling.
  (org-edna-reset-cache): Renamed from org-edna-invalidate-cache.
  (org-edna-action/tag!):
  (org-edna--heading-matches):
  (org-edna-entry-has-tags-p): Updated to use new tag API.

* org-edna-tests.el (org-edna-action-tag): Fixed failing test.
  (org-edna-user-test/time-spec): New test.

* org-edna-tests.org (User Example): New section of tests.

* org-edna.org (Timestamp Format): New section.
  (Finder Cache): Mention reset function.
  (1.0.2): New section.
---
 org-edna-tests.el  |  22 ++---
 org-edna-tests.org |  12 +++
 org-edna.el|  95 +---
 org-edna.info  | 251 -
 org-edna.org   |  37 +++-
 5 files changed, 293 insertions(+), 124 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 331438f..c877321 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -1210,11 +1210,7 @@ This avoids org-id digging into its internal database."
 ;; The second Monday after Mar 12th, 2000 (Mar 20th)
 (org-edna-action/scheduled! nil "float 2 monday Mar 12")
 (should (string-equal (org-entry-get nil "SCHEDULED")
-  "<2000-03-20 Mon 00:00>"))
-;; Back to Saturday for other tests
-(org-edna-action/scheduled! nil "2000-01-15 Sat 00:00")
-(should (string-equal (org-entry-get nil "SCHEDULED")
-  "<2000-01-15 Sat 00:00>"
+  "<2000-03-20 Mon 00:00>"
 
 (ert-deftest org-edna-action-deadline/wkdy ()
   (org-edna-with-test-heading "0d491588-7da3-43c5-b51a-87fbd34f79f7"
@@ -1360,18 +1356,14 @@ This avoids org-id digging into its internal database."
 ;; The second Monday after Mar 12th, 2000 (Mar 20th)
 (org-edna-action/deadline! nil "float 2 monday Mar 12")
 (should (string-equal (org-entry-get nil "DEADLINE")
-  "<2000-03-20 Mon 00:00>"))
-;; Back to Saturday for other tests
-(org-edna-action/deadline! nil "2000-01-15 Sat 00:00")
-(should (string-equal (org-entry-get nil "DEADLINE")
-  "<2000-01-15 Sat 00:00>"
+  "<2000-03-20 Mon 00:00>"
 
 (ert-deftest org-edna-action-tag ()
   (org-edna-with-test-heading org-edna-test-id-heading-one
 (org-edna-action/tag! nil "tag")
 (should (equal (org-get-tags) '("tag")))
 (org-edna-action/tag! nil "")
-(should (equal (org-get-tags) '("")
+(should (equal (org-get-tags) nil
 
 (ert-deftest org-edna-action-property ()
   (org-edna-with-test-heading org-edna-test-id-heading-one
@@ -2037,6 +2029,14 @@ the relative finders all still work while cache is 
enabled."
   ;; Verify that 3 is no longer blocked.
   (should (not (org-edna-test-check-block third-pom "Check after 
Both"))
 
+(ert-deftest org-edna-user-test/time-spec ()
+  (org-edna-doc-test-setup "5b63293c-23ef-40e7-ad8e-093e4c1e1464"
+(pcase-let* ((`(,first-pom ,second-pom ,third-pom) 
(org-edna-test-children-marks)))
+  (org-edna-test-mark-done first-pom)
+  ;; Test time is 2000-01-15, so this should be a week later
+  (should (string-equal (org-entry-get second-pom "SCHEDULED")
+"<2000-01-22 Sat>")
+
 (provide 'org-edna-tests)
 
 ;;; org-edna-tests.el ends here
diff --git a/org-edna-tests.org b/org-edna-tests.org
index 8553cc4..e58ac0f 100644
--- a/org-edna-tests.org
+++ b/org-edna-tests.org
@@ -361,3 +361,15 @@ DEADLINE: <2000-01-15 Sat +1d>
 :PROPERTIES:
 :BLOCKER:  previous-sibling !done? ids(1942caf2-caad-4757-b689-3c0029c1d8a5) 
!done?
 :END:
+* User Examples
+** Test to show undesired time spec added to generated SCHEDULED datestamp
+:PROPERTIES:
+:ID:   5b63293c-23ef-40e7-ad8e-093e4c1e1464
+:END:
+*** TODO task 1
+DEADLINE: <2019-02-15 Fri +1y -2w>
+:PROPERTIES:
+:TRIGGER:  next-sibling scheduled!("++7d")
+:END:
+*** TODO task 2
+*** TODO task 3
diff --git a/org-edna.el b/org-edna.el
index f050af7..b2398c7 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -62,6 +62,35 @@ properties used during actions or conditions."
   :group 'org-edna
   :type 'boolean)
 
+(defcustom org-edna-timestamp-format 'short
+  "Default timestamp format for sche

[elpa] master 311e980 065/135: Compile targets before running tests

2020-02-17 Thread Ian Dunn
branch: master
commit 311e980d67da0a494c0cc00b57db573bb9efad59
Author: Ian D 
Commit: Ian D 

Compile targets before running tests

* Makefile (check): Added "compile" as a prerequisite
---
 Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Makefile b/Makefile
index 0b504f9..765fe32 100644
--- a/Makefile
+++ b/Makefile
@@ -48,7 +48,7 @@ org-edna-autoloads.el:
 clean:
-rm -f *.elc
 
-check:
+check: compile
@$(EMACS) \
-L "." \
--load "ert" \



[elpa] master 3647cf7 095/135: Overhauled parsing method, and added conditional blocks

2020-02-17 Thread Ian Dunn
branch: master
commit 3647cf7a85d286a5291bb9780ff89405fd467db9
Author: Ian Dunn 
Commit: Ian Dunn 

Overhauled parsing method, and added conditional blocks

Also bumped version to 1.0beta3
---
 org-edna-tests.el | 277 ++
 org-edna.el   | 506 +-
 org-edna.info | 287 +++
 org-edna.org  | 105 ++-
 4 files changed, 940 insertions(+), 235 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index d3911db..a6b3554 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -70,89 +70,293 @@
 
 (ert-deftest org-edna-parse-form-no-arguments ()
   (let* ((input-string "test-string")
- (parsed   (org-edna-parse-form input-string)))
+ (parsed   (org-edna-parse-string-form input-string)))
 (should parsed)
-(should (= (length parsed) 4))
-(pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
-  (should (eq token 'test-string))
+(should (= (length parsed) 2))
+(pcase-let* ((`((,key . ,args) ,pos) parsed))
+  (should (eq key 'test-string))
   (should (not args))
-  (should (not modifier))
   (should (= pos 11)
 
 (ert-deftest org-edna-parse-form-no-arguments-modifier ()
   (let* ((input-string "!test-string")
- (parsed   (org-edna-parse-form input-string)))
+ (parsed   (org-edna-parse-string-form input-string)))
 (should parsed)
-(should (= (length parsed) 4))
-(pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
-  (should (eq token 'test-string))
+(should (= (length parsed) 2))
+(pcase-let* ((`((,key . ,args) ,pos) parsed))
+  (should (eq key '!test-string))
   (should (not args))
-  (should (eq modifier '!))
   (should (= pos 12)
 
 (ert-deftest org-edna-parse-form-single-argument ()
   (let* ((input-string "test-string(abc)")
- (parsed   (org-edna-parse-form input-string)))
+ (parsed   (org-edna-parse-string-form input-string)))
 (should parsed)
-(should (= (length parsed) 4))
-(pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
-  (should (eq token 'test-string))
+(should (= (length parsed) 2))
+(pcase-let* ((`((,key . ,args) ,pos) parsed))
+  (should (eq key 'test-string))
   (should (= (length args) 1))
   (should (symbolp (nth 0 args)))
   (should (eq (nth 0 args) 'abc))
-  (should (not modifier))
   (should (= pos (length input-string))
 
 (ert-deftest org-edna-parse-form-string-argument ()
   (let* ((input-string "test-string(abc \"def (ghi)\")")
- (parsed   (org-edna-parse-form input-string)))
+ (parsed   (org-edna-parse-string-form input-string)))
 (should parsed)
-(should (= (length parsed) 4))
-(pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
-  (should (eq token 'test-string))
+(should (= (length parsed) 2))
+(pcase-let* ((`((,key . ,args) ,pos) parsed))
+  (should (eq key 'test-string))
   (should (= (length args) 2))
   (should (symbolp (nth 0 args)))
   (should (eq (nth 0 args) 'abc))
   (should (stringp (nth 1 args)))
   (should (string-equal (nth 1 args) "def (ghi)"))
-  (should (not modifier))
   (should (= pos (length input-string))
 
 (ert-deftest org-edna-parse-form-multiple-forms ()
   (let ((input-string "test-string1 test-string2")
 pos)
-(pcase-let* ((`(,token1 ,args1 ,modifier1 ,pos1) (org-edna-parse-form 
input-string)))
-  ;; (should (and token1 args1 modifier1 pos1))
-  (should (eq token1 'test-string1))
+(pcase-let* ((`((,key1 . ,args1) ,pos1) (org-edna-parse-string-form 
input-string)))
+  (should (eq key1 'test-string1))
   (should (not args1))
-  (should (not modifier1))
   (should (= pos1 13))
   (setq pos pos1))
-(pcase-let* ((`(,token2 ,args2 ,modifier2 ,pos2) (org-edna-parse-form 
(substring input-string pos
-  (should (eq token2 'test-string2))
+(pcase-let* ((`((,key2 . ,args2) ,pos2) (org-edna-parse-string-form 
(substring input-string pos
+  (should (eq key2 'test-string2))
   (should (not args2))
-  (should (not modifier2))
   (should (= pos2 12)
 
 (ert-deftest org-edna-parse-form-empty-argument-list ()
   (let ((input-string "test-string1()"))
-(pcase-let* ((`(,token1 ,args1 ,modifier1 ,pos1) (org-edna-parse-form 
input-string)))
-  (should (eq token1 'test-string1))
+(pcase-let* ((`((,key1 ,args1) ,pos1) (org-edna-parse-string-form 
input-string)))
+  (should (eq key1 'test-string1))
   (should (not args1))
-  (should (not modifier1))
   (should (= pos1 (length input-string))
 
 (ert-deftest org-edna-parse-form-condition ()
   (let ((input-string "variable-set?()"))
-(pcase-let* ((`(,token1 ,args1 ,modifier1 ,pos1) (o

[elpa] master f560f1b 056/135: Fixed error reporting

2020-02-17 Thread Ian Dunn
branch: master
commit f560f1b0381312b56268e0f3eb289b314650737a
Author: Ian D 
Commit: Ian D 

Fixed error reporting

* org-edna.el (org-edna-run): Fixed error symbol.
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 8c50555..634576a 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -205,7 +205,7 @@ Currently, the following are handled:
  (condition-case err
  ,@body
(error
-(if (eq (car err) 'invalid-syntax-error)
+(if (eq (car err) 'invalid-read-syntax)
 (org-edna--print-syntax-error (cdr err))
   (message "Edna Error: %s" (error-message-string err)))
 (setq org-block-entry-blocking (org-get-heading))



[elpa] master d493232 077/135: Added support for interactive editing of blockers and triggers

2020-02-17 Thread Ian Dunn
branch: master
commit d493232c706aeefc0b4af11b6f53d6fa4eedf86f
Author: Ian Dunn 
Commit: Ian Dunn 

Added support for interactive editing of blockers and triggers
---
 org-edna.el | 205 
 1 file changed, 205 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index aa319d2..bda6ec3 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -762,6 +762,211 @@ one is specified, the last will be used.
 
 
 
+;;; Popout editing
+
+(defvar org-edna-edit-original-marker nil)
+(defvar org-edna-blocker-section-marker nil)
+(defvar org-edna-trigger-section-marker nil)
+
+(defcustom org-edna-edit-buffer-name "*Org Edna Edit Blocker/Trigger*"
+  "Name of the popout buffer for editing blockers/triggers."
+  :type 'string
+  :group 'org-edna)
+
+(defun org-edna-in-edit-buffer-p ()
+  (string-equal (buffer-name) org-edna-edit-buffer-name))
+
+(defun org-edna-replace-newlines (string)
+  "Replace newlines with spaces in STRING."
+  (string-join (split-string string "\n" t) " "))
+
+(defun org-edna-edit-text-between-markers (first-marker second-marker)
+  "Collect the text between FIRST-MARKER and SECOND-MARKER."
+  (buffer-substring (marker-position first-marker)
+(marker-position second-marker)))
+
+(defun org-edna-edit-blocker-section-text ()
+  (when (org-edna-in-edit-buffer-p)
+(let ((original-text (org-edna-edit-text-between-markers
+  org-edna-blocker-section-marker
+  org-edna-trigger-section-marker)))
+  ;; Strip the BLOCKER key
+  (when (string-match "^BLOCKER\n\\(\\(?:.*\n\\)+\\)" original-text)
+(org-edna-replace-newlines (match-string 1 original-text))
+
+(defun org-edna-edit-trigger-section-text ()
+  (when (org-edna-in-edit-buffer-p)
+(let ((original-text (org-edna-edit-text-between-markers
+  org-edna-trigger-section-marker
+  (point-max-marker
+  ;; Strip the TRIGGER key
+  (when (string-match "^TRIGGER\n\\(\\(?:.*\n\\)+\\)" original-text)
+(org-edna-replace-newlines (match-string 1 original-text))
+
+(defvar org-edna-edit-map
+  (let ((map (make-sparse-keymap)))
+(org-defkey map "\C-x\C-s"  'org-edna-edit-finish)
+(org-defkey map "\C-c\C-s"  'org-edna-edit-finish)
+(org-defkey map "\C-c\C-c"  'org-edna-edit-finish)
+(org-defkey map "\C-c'" 'org-edna-edit-finish)
+(org-defkey map "\C-c\C-q"  'org-edna-edit-abort)
+(org-defkey map "\C-c\C-k"  'org-edna-edit-abort)
+map))
+
+(defun org-edna-edit ()
+  "Edit the blockers and triggers for current headline in a separate buffer."
+  (interactive)
+  ;; Move to the start of the current headline
+  (let* ((heading-point (save-excursion
+  (org-back-to-heading)
+  (point-marker)))
+ (blocker (or (org-entry-get heading-point "BLOCKER") ""))
+ (trigger (or (org-entry-get heading-point "TRIGGER") ""))
+ (wc (current-window-configuration))
+ (sel-win (selected-window)))
+(org-switch-to-buffer-other-window org-edna-edit-buffer-name)
+(erase-buffer)
+;; Keep global-font-lock-mode from turning on font-lock-mode
+(let ((font-lock-global-modes '(not fundamental-mode)))
+  (fundamental-mode))
+(use-local-map org-edna-edit-map)
+(setq-local font-lock-global-modes (list 'not major-mode))
+(setq-local org-edna-edit-original-marker heading-point)
+(setq-local org-window-configuration wc)
+(setq-local org-selected-window sel-win)
+(setq-local org-finish-function 'org-edna-edit-finish)
+(insert (substitute-command-keys "\\\
+Edit blockers and triggers in this buffer under their respective sections 
below.
+All lines under a given section will be merged into one when saving back to
+the source buffer.  Finish with `\\[org-ctrl-c-ctrl-c]' or 
`\\[org-edit-special]'.\n\n"))
+(setq-local org-edna-blocker-section-marker (point-marker))
+(insert (format "BLOCKER\n%s\n\n" blocker))
+(setq-local org-edna-trigger-section-marker (point-marker))
+(insert (format "TRIGGER\n%s\n\n" trigger))
+
+;; Change syntax table to make ! and ? symbol constituents
+(modify-syntax-entry ?! "_")
+(modify-syntax-entry ?? "_")
+
+;; Set up completion
+(add-hook 'completion-at-point-functions 'org-edna-completion-at-point nil 
t)))
+
+(defun org-edna-edit-finish ()
+  (interactive)
+  (let ((blocker (org-edna-edit-blocker-section-text))
+(trigger (org-edna-edit-trigger-section-text))
+(pos-marker org-edna-edit-original-marker)
+(wc org-window-configuration)
+(sel-win org-selected-window))
+(set-window-

[elpa] master 3a3ed39 046/135: Various parsing fixes

2020-02-17 Thread Ian Dunn
branch: master
commit 3a3ed391bcdcb7310450d14d1df987d13448e665
Author: Ian D 
Commit: Ian D 

Various parsing fixes

- Don't convert everything to strings
- Don't throw errors that will bog down the user

* org-edna.el (org-edna--syntax-error, org-edna--handle-syntax-error): New
  functions to record and handle errors.
  (org-edna--transform-arg): New function to transform arguments as needed.
  (org-edna-parse-form): Parse arguments space-separated lists.
  (org-edna-process-form): Don't use substring, but keep track of current
  position in form.
  (org-edna-run): Wrap handling inside condition-case and pass errors to
  org-edna--print-syntax-error
  (org-edna-finder/chain-find): Don't alter inputs
  (org-edna-action/todo): Convert symbols to strings.
  (Org-edna-transform-consideration): Remove.

* org-edna-tests.el: Updated tests.
---
 org-edna-tests.el  |  12 +++---
 org-edna-tests.org |   2 +-
 org-edna.el| 113 +++--
 3 files changed, 65 insertions(+), 62 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 5f7ba94..2a523c9 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -58,21 +58,21 @@
 (pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
   (should (eq token 'test-string))
   (should (= (length args) 1))
-  (should (stringp (nth 0 args)))
-  (should (string-equal (nth 0 args) "abc"))
+  (should (symbolp (nth 0 args)))
+  (should (eq (nth 0 args) 'abc))
   (should (not modifier))
   (should (= pos (length input-string))
 
 (ert-deftest org-edna-parse-form-string-argument ()
-  (let* ((input-string "test-string(abc,\"def (ghi)\")")
+  (let* ((input-string "test-string(abc \"def (ghi)\")")
  (parsed   (org-edna-parse-form input-string)))
 (should parsed)
 (should (= (length parsed) 4))
 (pcase-let* ((`(,token ,args ,modifier ,pos) parsed))
   (should (eq token 'test-string))
   (should (= (length args) 2))
-  (should (stringp (nth 0 args)))
-  (should (string-equal (nth 0 args) "abc"))
+  (should (symbolp (nth 0 args)))
+  (should (eq (nth 0 args) 'abc))
   (should (stringp (nth 1 args)))
   (should (string-equal (nth 1 args) "def (ghi)"))
   (should (not modifier))
@@ -145,7 +145,7 @@
   (let* ((org-agenda-files `(,org-edna-test-file))
  (heading (org-id-find "caccd0a6-d400-410a-9018-b0635b07a37e" t))
  (blocker (org-entry-get heading "BLOCKER")))
-(should (string-equal "match(test&1)" blocker))
+(should (string-equal "match(\"test&1\")" blocker))
 (org-with-point-at heading
   (org-edna-process-form blocker 'condition))
 (should (string-equal (substring-no-properties org-block-entry-blocking)
diff --git a/org-edna-tests.org b/org-edna-tests.org
index 0586f08..6f3341c 100644
--- a/org-edna-tests.org
+++ b/org-edna-tests.org
@@ -43,7 +43,7 @@ SCHEDULED: <2017-01-01 Sun>
 ** Match
 *** TODO Blocking Test
 :PROPERTIES:
-:BLOCKER:  match(test&1)
+:BLOCKER:  match("test&1")
 :ID:   caccd0a6-d400-410a-9018-b0635b07a37e
 :LOGGING:  nil
 :END:
diff --git a/org-edna.el b/org-edna.el
index 4806dc2..152cc6a 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -27,6 +27,7 @@
 
 (require 'org)
 (require 'subr-x)
+(require 'seq)
 
 (defgroup org-edna nil
   "Extensible Dependencies 'N' Actions"
@@ -40,43 +41,49 @@ 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))
+(defmacro org-edna--syntax-error (msg form pos)
+  `(signal 'invalid-read-syntax (list :msg msg :form form :pos pos)))
+
+(defun org-edna--handle-syntax-error (error-plist)
+  (let ((msg (plist-get error-plist :msg))
+(form (plist-get error-plist :form))
+(pos (plist-get error-plist :pos)))
+(message
+ "Org Edna Syntax Error: %s\n%s\n%s"
+ msg form (concat (make-string pos ?\ ) "^"
+
+(defun org-edna--transform-arg (arg)
+  "Transform ARG.
+
+Currently, the following are handled:
+
+- UUIDs (as determined by `org-uuidgen-p') are converted to strings"
+  (pcase arg
+((and (pred symbolp)
+  (let (pred org-uuidgen-p) (symbol-name arg)))
+ (symbol-name arg))
+(_
+ arg)))
+
+(defun org-edna-parse-form (form  start)
+  "Parse Edna form FORM."
+  (setq start (or start 0))
+  (pcase-let* ((`(,token . ,pos) (read-from-string form start))
(modifier nil)
(args nil))
 (unless token
-  (signal 'invalid-read-syntax (substring form pos)))
+  (org-edna--syntax-error "Invalid Token" form start))
 ;; Check for either end of string or an opening parenthesis
 (unless (or (equal pos (length form))
 (equal (string-match-p "\\s-" form pos) pos)
 (equal (string-match-p "(" form pos) pos))
-  (signal 'invalid-read-syntax 

[elpa] master a2da465 107/135: Bumped version

2020-02-17 Thread Ian Dunn
branch: master
commit a2da4651ddfbeb362162caca17dd7b1ec6b87fd9
Author: Ian Dunn 
Commit: Ian Dunn 

Bumped version

* org-edna.org: Added entry for cache to changelog
---
 org-edna.el  | 2 +-
 org-edna.org | 2 ++
 2 files changed, 3 insertions(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 5184350..773fd74 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0beta6
+;; Version: 1.0beta7
 
 ;; This file is part of GNU Emacs.
 
diff --git a/org-edna.org b/org-edna.org
index e3422de..31240c9 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1291,6 +1291,8 @@ making any changes:
 :PROPERTIES:
 :DESCRIPTION: List of changes by version
 :END:
+** 1.0beta7
+- Added cache to the finders to improve performance
 ** 1.0beta6
 Lots of parsing fixes.
 



[elpa] master 5aad235 126/135: Added function to invalidate cache

2020-02-17 Thread Ian Dunn
branch: master
commit 5aad235ed85639f5c215af0a2d015de8b9dc201c
Author: Ian Dunn 
Commit: Ian Dunn 

Added function to invalidate cache

* org-edna.el (org-edna-invalidate-cache): New interactive defun.
---
 org-edna.el | 11 +++
 1 file changed, 11 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index d9ebc2b..f050af7 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -593,6 +593,17 @@ following reasons:
 ;; Adds the entry to the cache, and returns the results.
 (org-edna--add-to-finder-cache func-sym args)
 
+(defun org-edna-invalidate-cache ()
+  "Invalidate the finder cache.
+
+Use this only if there's a problem with the cache.
+
+When an Org mode buffer is reverted, the cache will be made
+useless for that buffer.  Therefore, it's a good idea to call
+this after reverting Org mode buffers."
+  (interactive)
+  (setq org-edna--finder-cache (make-hash-table :test 'equal)))
+
 
 ;;; Interactive Functions
 



[elpa] master 3b3625f 064/135: Cleaned up package header and added various docstrings

2020-02-17 Thread Ian Dunn
branch: master
commit 3b3625f94dcf9469260b4f56dac9dc3f9bcc43f8
Author: Ian D 
Commit: Ian D 

Cleaned up package header and added various docstrings

* org-edna.el (package header): Added Maintainer and URL
  (Commentary): Added
  (History): Added empty section
  (org-edna-submit-bug-report): New interactive function.
---
 org-edna.el | 68 ++---
 1 file changed, 65 insertions(+), 3 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index f980ba9..46046ab 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -3,9 +3,11 @@
 ;; Copyright (C) 2017 Ian Dunn
 
 ;; Author: Ian Dunn 
+;; Maintainer: Ian Dunn 
 ;; Keywords: convenience, text, org
-;; Version: 1.0
-;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "8.0"))
+;; URL: https://savannah.nongnu.org/projects/org-edna-el/
+;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
+;; Version: 1.0alpha1
 
 ;; This file is NOT part of GNU Emacs.
 
@@ -23,6 +25,14 @@
 
 ;;; Commentary:
 
+;; Edna provides an extensible means of specifying conditions which must be
+;; fulfilled before a task can be completed and actions to take once it is.
+
+;; Org Edna runs when either the BLOCKER or TRIGGER properties are set on a
+;; headline, and when it is changing from a TODO state to a DONE state.
+
+;;; History:
+
 ;;; Code:
 
 (require 'org)
@@ -47,9 +57,15 @@ properties used during actions or conditions."
   :type 'boolean)
 
 (defmacro org-edna--syntax-error (msg form pos)
+  "Signal an Edna syntax error.
+
+MSG will be reported to the user and should describe the error.
+FORM is the form that generated the error.
+POS is the position in FORM at which the error occurred."
   `(signal 'invalid-read-syntax (list :msg ,msg :form ,form :pos ,pos)))
 
 (defun org-edna--print-syntax-error (error-plist)
+  "Prints the syntax error from ERROR-PLIST."
   (let ((msg (plist-get error-plist :msg))
 (form (plist-get error-plist :form))
 (pos (plist-get error-plist :pos)))
@@ -71,7 +87,7 @@ Currently, the following are handled:
  arg)))
 
 (defun org-edna-parse-form (form  start)
-  "Parse Edna form FORM."
+  "Parse Edna form FORM starting at position START."
   (setq start (or start 0))
   (pcase-let* ((`(,token . ,pos) (read-from-string form start))
(modifier nil)
@@ -98,6 +114,10 @@ Currently, the following are handled:
 (list token args modifier pos)))
 
 (defun org-edna--function-for-key (key)
+  "Determine the Edna function for KEY.
+
+KEY should be a symbol, the keyword for which to find the Edna
+function."
   (cond
;; Just return nil if it's not a symbol; `org-edna-process-form' will handle
;; the rest
@@ -123,6 +143,7 @@ Currently, the following are handled:
 (cons 'finder func-sym))
 
 (defun org-edna--handle-condition (func mod args targets consideration)
+  "Handle a condition."
   ;; Check the condition at each target
   (when-let ((blocks
   (mapcar
@@ -134,6 +155,10 @@ Currently, the following are handled:
 (org-edna-handle-consideration consideration blocks)))
 
 (defun org-edna-process-form (form action-or-condition)
+  "Process FORM.
+
+ACTION-OR-CONDITION is a symbol, either 'action or 'condition,
+indicating whether FORM accepts actions or conditions."
   (let ((targets)
 (blocking-entry)
 (consideration 'all)
@@ -196,6 +221,10 @@ Currently, the following are handled:
 
 
 (defmacro org-edna-run (change-plist  body)
+  "Run a TODO state change.
+
+The state information is held in CHANGE-PLIST.  If the TODO state
+is changing from a TODO state to a DONE state, run BODY."
   (declare (indent 1))
   `(let* ((pos (plist-get ,change-plist :position))
   (type (plist-get ,change-plist :type))
@@ -221,11 +250,21 @@ Currently, the following are handled:
t)))
 
 (defun org-edna-trigger-function (change-plist)
+  "Trigger function work-horse.
+
+See `org-edna-run' for CHANGE-PLIST explanation.
+
+This shouldn't be run from outside of `org-trigger-hook'."
   (org-edna-run change-plist
 (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)
+  "Blocker function work-horse.
+
+See `org-edna-run' for CHANGE-PLIST explanation.
+
+This shouldn't be run from outside of `org-blocker-hook'."
   (org-edna-run change-plist
 (if-let ((form (org-entry-get pos "BLOCKER" org-edna-use-inheritance)))
 (org-edna-process-form form 'condition)
@@ -233,12 +272,19 @@ Currently, the following are handled:
 
 ;;;###autoload
 (defun org-edna-load ()
+  "Setup the hooks necessary for Org Edna to run.
+
+This means adding to `org-trigger-hook' and `org-blocker-hook'."
   (i

[elpa] master c29a951 045/135: Use example instead of src to make HTML export prettier

2020-02-17 Thread Ian Dunn
branch: master
commit c29a951ca2611d08fa8d695f81cc34223c0b95b6
Author: Ian D 
Commit: Ian D 

Use example instead of src to make HTML export prettier

* org-edna.org: Replaced BEGIN_SRC org with BEGIN_EXAMPLE
---
 org-edna.org | 36 ++--
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index f94fa2b..d225adb 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -52,7 +52,7 @@ little late.  Now Org will remind you too early.
 
 Edna can handle this for you like so:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Put clothes in washer
   SCHEDULED: <2017-04-08 Sat 09:00>
   :PROPERTIES:
@@ -73,7 +73,7 @@ Edna can handle this for you like so:
   :TRIGGER: next-sibling scheduled(++1h)
   :BLOCKER:  previous-sibling
   :END:
-#+END_SRC
+#+END_EXAMPLE
 
 After you've put your clothes in the washer and mark the task DONE, Edna will
 schedule the following task for one hour after you set the first headline as
@@ -82,22 +82,22 @@ done.
 Another example might be a checklist that you've done so many times that you do
 part of it on autopilot:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Address all TODOs in code
 ,* TODO Commit Code to Repository
-#+END_SRC
+#+END_EXAMPLE
 
 The last thing anyone wants is to find out that some part of the code on which
 they've been working for days has a surprise waiting for them.  Once again, 
Edna
 can help:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Address all TODOs in code
   :PROPERTIES:
   :BLOCKER: file(main.cpp) file(code.cpp) re-search(TODO)
   :END:
 ,* TODO Commit Code to Repository
-#+END_SRC
+#+END_EXAMPLE
 ** Blockers
 :PROPERTIES:
 :CUSTOM_ID: blockers
@@ -152,7 +152,7 @@ The ~ancestors~ finder returns a list of the current 
headline's ancestors.
 
 For example:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Heading 1
 ,** TODO Heading 2
 ,** TODO Heading 3
@@ -161,7 +161,7 @@ For example:
  :PROPERTIES:
  :BLOCKER:  ancestors
  :END:
-#+END_SRC
+#+END_EXAMPLE
 
 In the above example, "Heading 5" will be blocked until "Heading 1", "Heading
 3", and "Heading 4" are marked "DONE", while "Heading 2" is ignored.
@@ -199,12 +199,12 @@ point in the file.
 Note that with the default condition, ~file~ won't work.  See 
[[#conditions][conditions]] for how
 to set a different condition.  For example:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  file("~/myfile.org") headings
   :END:
-#+END_SRC
+#+END_EXAMPLE
 
 Here, "Test" will block until myfile.org is clear of headlines.
 
@@ -228,12 +228,12 @@ The ~first-child~ finder returns the first child of a 
headline, if any.
 The ~ids~ finder will search for headlines with given IDs, using ~org-id~.  Any
 number of UUIDs may be specified.  For example:
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  
ids(62209a9a-c63b-45ef-b8a8-12e47a9ceed9,6dbd7921-a25c-4e20-b035-365677e00f30)
   :END:
-#+END_SRC
+#+END_EXAMPLE
 
 Here, "Test" will block until the headline with ID
 62209a9a-c63b-45ef-b8a8-12e47a9ceed9 and the headline with ID
@@ -248,12 +248,12 @@ Here, "Test" will block until the headline with ID
 The ~match~ keyword will take any arguments that ~org-map-entries~ usually 
takes.
 In fact, the arguments to ~match~ are passed straight into ~org-map-entries~.
 
-#+BEGIN_SRC org
+#+BEGIN_EXAMPLE
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  match(test,agenda)
   :END:
-#+END_SRC
+#+END_EXAMPLE
 
 "Test" will block until all entries tagged "test" and "mine" in the agenda 
files
 are marked DONE.
@@ -293,10 +293,10 @@ argument.
 Once Edna has collected its targets for a trigger, it will perform actions on
 them.
 *** Scheduled/Deadline
-PLANNING(WKDY[ TIME]) -> Set PLANNING to following weekday WKDY at TIME
-PLANNING(rm|remove) -> Remove PLANNING info
-PLANNING([copy|cp]) -> Copy timestamp verbatim
-PLANNING([+|-][+|-]NTHING) -> Increment(+) or decrement(-) source (double) or 
current (single) PLANNING by N THINGs
+- PLANNING(WKDY[ TIME]) -> Set PLANNING to following weekday WKDY at TIME
+- PLANNING(rm|remove) -> Remove PLANNING info
+- PLANNING([copy|cp]) -> Copy timestamp verbatim
+- PLANNING([+|-][+|-]NTHING) -> Increment(+) or decrement(-) source (double) 
or current (single) PLANNING by N THINGs
 
 PLANNING is either scheduled or deadline
 



[elpa] master eda515d 039/135: Added check and local settings to Makefile

2020-02-17 Thread Ian Dunn
branch: master
commit eda515d20906e2599f6fa90dab0f261b53c501f8
Author: Ian D 
Commit: Ian D 

Added check and local settings to Makefile
---
 .bzrignore  |  3 ++-
 Makefile| 29 -
 Makefile => defaults.mk | 25 +
 3 files changed, 35 insertions(+), 22 deletions(-)

diff --git a/.bzrignore b/.bzrignore
index 016d3b1..507633b 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1 +1,2 @@
-*.elc
\ No newline at end of file
+*.elc
+local.mk
\ No newline at end of file
diff --git a/Makefile b/Makefile
index 74e079a..0b504f9 100644
--- a/Makefile
+++ b/Makefile
@@ -15,11 +15,19 @@
 #  You should have received a copy of the GNU General Public License
 #  along with this program.  If not, see .
 
-EMACS=emacs --batch
+# Load defaults
+include defaults.mk
+
+# Load local definitions
+include local.mk
+
+EMACS=$(emacs) --batch -L $(org_path)
 ALLSRC=org-edna.el
 SOURCE=$(ALLSRC)
 TARGET=$(patsubst %.el,%.elc,$(SOURCE))
 
+.PHONY: clean check local.mk help
+
 all: $(TARGET)
 
 compile: $(TARGET)
@@ -39,3 +47,22 @@ org-edna-autoloads.el:
 
 clean:
-rm -f *.elc
+
+check:
+   @$(EMACS) \
+   -L "." \
+   --load "ert" \
+   --load "org-edna-tests.el" \
+   -f ert-run-tests-batch-and-exit
+
+local.mk:
+   @cp -n defaults.mk local.mk
+
+help:
+   $(info )
+   $(info make all   - Default)
+   $(info make compile   - Compile Emacs Lisp Files)
+   $(info make autoloads - Generate Autoloads)
+   $(info make clean - Remove generated .elc files)
+   $(info make check - Run Tests)
+   @echo ""
diff --git a/Makefile b/defaults.mk
similarity index 63%
copy from Makefile
copy to defaults.mk
index 74e079a..aed4ab3 100644
--- a/Makefile
+++ b/defaults.mk
@@ -15,27 +15,12 @@
 #  You should have received a copy of the GNU General Public License
 #  along with this program.  If not, see .
 
-EMACS=emacs --batch
-ALLSRC=org-edna.el
-SOURCE=$(ALLSRC)
-TARGET=$(patsubst %.el,%.elc,$(SOURCE))
+emacs = emacs
 
-all: $(TARGET)
+prefix = /usr/share
 
-compile: $(TARGET)
+org_path = $(prefix)/emacs/site-lisp/org
 
-%.elc: %.el
-   @$(EMACS) \
-   -L "." \
-   -f batch-byte-compile $<
+info_dir = $(prefix)/info
 
-autoloads: org-edna-autoloads.el
-
-org-edna-autoloads.el:
-   @$(EMACS) \
-   --eval "(require 'package)" \
-   --eval "(setq inhibit-message t)" \
-   --eval "(package-generate-autoloads \"org-edna\" \"$$(pwd)\")"
-
-clean:
-   -rm -f *.elc
+lisp_dir = $(prefix)/emacs/site-lisp/



[elpa] master b4f7033 104/135: Fixed parsing multiple forms inside if/then/else blocks

2020-02-17 Thread Ian Dunn
branch: master
commit b4f70337125425c4ce9e4fccef03404f916591aa
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed parsing multiple forms inside if/then/else blocks

* org-edna.el (org-edna--normalize-forms): New defun.
  (org-edna--normalize-sexp-form): Use it for if-statements
  (org-edna--normalize-all-forms): Use it.

* org-edna-tests.el: Added new parsing tests.
---
 org-edna-tests.el | 86 ---
 org-edna.el   | 61 +--
 org-edna.info | 13 ++---
 org-edna.org  |  5 
 4 files changed, 130 insertions(+), 35 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 01842ec..0a9ddca 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -175,10 +175,10 @@
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
 (should (equal
  sexp
- '(((if ((match "checklist")
- (done?))
-((self)
- (todo! TODO))
+ '(((if (((match "checklist")
+  (done?)))
+(((self)
+  (todo! TODO)))
   nil)))
 
 (ert-deftest org-edna-form-to-sexp-if-else ()
@@ -186,12 +186,78 @@
  (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
 (should (equal
  sexp
- '(((if ((match "checklist")
-  (done?))
-((self)
- (todo! TODO))
-  ((siblings)
-   (todo! DONE)
+ '(((if (((match "checklist")
+  (done?)))
+(((self)
+  (todo! TODO)))
+  (((siblings)
+(todo! DONE))
+
+(ert-deftest org-edna-form-to-sexp-if-multiple-thens ()
+  (let* ((input-string "if match(\"checklist\") done? then self next-sibling 
todo!(TODO) self set-property!(\"COUNTER\" \"0\") endif")
+ (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
+(should (equal
+ sexp
+ '(((if (((match "checklist")
+  (done?)))
+(((self)
+  (next-sibling)
+  (todo! TODO))
+ ((self)
+  (set-property! "COUNTER" "0")))
+  nil)))
+
+(ert-deftest org-edna-form-to-sexp-if-multiple-elses ()
+  (let* ((input-string "if match(\"checklist\") done? then self todo!(TODO) 
else siblings todo!(DONE) self todo!(TODO) endif")
+ (sexp (org-edna-string-form-to-sexp-form input-string 'action)))
+(should (equal
+ sexp
+ '(((if (((match "checklist")
+  (done?)))
+(((self)
+  (todo! TODO)))
+  (((siblings)
+(todo! DONE))
+   ((self)
+(todo! TODO))
+
+(ert-deftest org-edna-form-to-sexp-failed-if ()
+  (pcase-let* ((input-string "if match(\"checklist\") done?")
+   (`(,error . ,data) (should-error 
(org-edna-string-form-to-sexp-form
+input-string 'action)
+   :type 'invalid-read-syntax)))
+(should (eq error 'invalid-read-syntax))
+(should (listp data))
+(should (eq (length data) 6))
+(should (string-equal (plist-get data :msg) "Malformed if-construct; 
expected then terminator"))
+;; Error should point to the start of the if-statement
+(should (eq (plist-get data :error-pos) 0
+
+(ert-deftest org-edna-form-to-sexp-failed-if-then ()
+  (pcase-let* ((input-string "if match(\"checklist\") done? then")
+   (`(,error . ,data) (should-error 
(org-edna-string-form-to-sexp-form
+input-string 'action)
+   :type 'invalid-read-syntax)))
+(should (eq error 'invalid-read-syntax))
+(should (listp data))
+(should (eq (length data) 6))
+(should (string-equal (plist-get data :msg)
+  "Malformed if-construct; expected else or endif 
terminator"))
+;; Error should point to the start of the if-statement
+(should (eq (plist-get data :error-pos) 28
+
+(ert-deftest org-edna-form-to-sexp-failed-if-then-else ()
+  (pcase-let* ((input-string "if match(\"checklist\") done? then todo!(TODO) 
else todo!(TODO)")
+   (`(,error . ,data) (should-error 
(org-edna-string-form-to-sexp-form
+ input-string 'action)
+ 

[elpa] master 6e1f5fb 087/135: Fixed bug in planning action

2020-02-17 Thread Ian Dunn
branch: master
commit 6e1f5fb99e5441f2760a99bc016e0cbb8f4fd8ac
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed bug in planning action

* org-edna.el (org-edna--handle-planning): Bind case-fold-search for
  org-date-read-analyze.
---
 org-edna.el | 7 ---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index d460543..01f13c3 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -7,7 +7,7 @@
 ;; Keywords: convenience, text, org
 ;; URL: https://savannah.nongnu.org/projects/org-edna-el/
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
-;; Version: 1.0beta1
+;; Version: 1.0beta2
 
 ;; This file is part of GNU Emacs.
 
@@ -242,7 +242,7 @@ is changing from a TODO state to a DONE state, run BODY."
   ;; And only from a TODO state to a DONE state
   (member from (cons 'todo org-not-done-keywords))
   (member to (cons 'done org-done-keywords)))
- (condition-case err
+ (condition-case-unless-debug err
  ,@body
(error
 (if (eq (car err) 'invalid-read-syntax)
@@ -1203,7 +1203,8 @@ forward) or the last day of MONTH (backward)."
   ;; use if that time component isn't specified.  Since there's no way to
   ;; tell if a time was specified, tell `org-read-date-analyze' to use nil
   ;; if no time is found.
-  (let* ((parsed-time (org-read-date-analyze arg this-time '(nil nil nil 
nil nil nil)))
+  (let* ((case-fold-search t)
+ (parsed-time (org-read-date-analyze arg this-time '(nil nil nil 
nil nil nil)))
  (have-time (nth 2 parsed-time))
  (final-time (apply 'encode-time (mapcar (lambda (e) (or e 0)) 
parsed-time)))
  (new-ts (format-time-string (if have-time "%F %R" "%F") 
final-time)))



[elpa] master dc20076 112/135: Quick fix for handle finders.

2020-02-17 Thread Ian Dunn
branch: master
commit dc200765c50e884fb9ffbadace8177e37a80ba54
Author: Ian Dunn 
Commit: Ian Dunn 

Quick fix for handle finders.

Attempt to expand empty argument list resulted in calling `quote' with no
arguments.

* org-edna.el (org-edna--handle-finder): Pass arguments as a list.
  (org-edna--expand-single-sexp-form): Don't expand arguments.
---
 org-edna-tests.el |  20 +++
 org-edna.el   |   6 +--
 org-edna.info | 157 +-
 org-edna.org  |   3 +-
 4 files changed, 99 insertions(+), 87 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 890ddd9..da766a9 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -270,7 +270,7 @@
  '(let ((targets1 nil)
 (consideration1 nil)
 (blocking-entry1 nil))
-(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self (quote
+(setq targets1 (org-edna--add-targets targets1 
(org-edna--handle-finder 'org-edna-finder/self 'nil)))
 (setq blocking-entry1
   (or blocking-entry1
   (org-edna--handle-condition 'org-edna-condition/done?
@@ -303,7 +303,7 @@
(blocking-entry2 blocking-entry1))
(setq targets2
  (org-edna--add-targets targets2
-(org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
+(org-edna--handle-finder 
'org-edna-finder/match '("checklist"
(org-edna--handle-action 'org-edna-action/todo!
 targets2
 (point-marker)
@@ -313,7 +313,7 @@
(blocking-entry5 blocking-entry1))
(setq targets5
  (org-edna--add-targets targets5
-(org-edna--handle-finder 
'org-edna-finder/siblings (quote
+(org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
(org-edna--handle-action 'org-edna-action/todo!
 targets5
 (point-marker)
@@ -355,7 +355,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
+ (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -365,7 +365,7 @@
;; Add targets for self finder
(setq targets1
  (org-edna--add-targets targets1
-(org-edna--handle-finder 
'org-edna-finder/self (quote
+(org-edna--handle-finder 
'org-edna-finder/self 'nil)))
;; Mark as TODO
(org-edna--handle-action 'org-edna-action/todo! targets1
 (point-marker)
@@ -375,7 +375,7 @@
  ;; Find siblings
  (setq targets1
(org-edna--add-targets targets1
-  (org-edna--handle-finder 
'org-edna-finder/siblings (quote
+  (org-edna--handle-finder 
'org-edna-finder/siblings 'nil)))
  ;; Mark as DONE
  (org-edna--handle-action 'org-edna-action/todo! targets1
   (point-marker)
@@ -416,7 +416,7 @@
 ;; Add targets for checklist match
 (setq targets3
   (org-edna--add-targets targets3
- (org-edna--handle-finder 
'org-edna-finder/match '"checklist")))
+ (org-edna--handle-finder 
'org-edna-finder/match '("checklist"
 ;; Handle condition
 (setq blocking-entry3
   (or blocking-entry3
@@ -426,7 +426,7 @@
;; Add targets for self finder
(setq targets1
  (org-edna--add-targets targets1
-  

[elpa] master 459ecd4 081/135: Update if-let and when-let to their -let* counterparts

2020-02-17 Thread Ian Dunn
branch: master
commit 459ecd4d567e3bc7809a9f20db459a44d05a1ff6
Author: Ian Dunn 
Commit: Ian Dunn 

Update if-let and when-let to their -let* counterparts

* org-edna.el (if-let*, when-let*): Aliases for <26.1
---
 org-edna.el | 34 --
 1 file changed, 20 insertions(+), 14 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 9a7e043..54c93ba 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -39,6 +39,12 @@
 (eval-when-compile (require 'subr-x))
 (require 'seq)
 
+;; Compatibility for Emacs < 26.1
+(unless (fboundp 'if-let*)
+  (defalias 'if-let* 'if-let))
+(unless (fboundp 'when-let*)
+  (defalias 'when-let* 'when-let))
+
 (defgroup org-edna nil
   "Extensible Dependencies 'N' Actions"
   :group 'org)
@@ -145,12 +151,12 @@ function."
 (defun org-edna--handle-condition (func mod args targets consideration)
   "Handle a condition."
   ;; Check the condition at each target
-  (when-let ((blocks
-  (mapcar
-   (lambda (entry-marker)
- (org-with-point-at entry-marker
-   (apply func mod args)))
-   targets)))
+  (when-let* ((blocks
+   (mapcar
+(lambda (entry-marker)
+  (org-with-point-at entry-marker
+(apply func mod args)))
+targets)))
 ;; Apply consideration
 (org-edna-handle-consideration consideration blocks)))
 
@@ -256,7 +262,7 @@ See `org-edna-run' for CHANGE-PLIST explanation.
 
 This shouldn't be run from outside of `org-trigger-hook'."
   (org-edna-run change-plist
-(when-let ((form (org-entry-get pos "TRIGGER" org-edna-use-inheritance)))
+(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)
@@ -266,7 +272,7 @@ See `org-edna-run' for CHANGE-PLIST explanation.
 
 This shouldn't be run from outside of `org-blocker-hook'."
   (org-edna-run change-plist
-(if-let ((form (org-entry-get pos "BLOCKER" org-edna-use-inheritance)))
+(if-let* ((form (org-entry-get pos "BLOCKER" org-edna-use-inheritance)))
 (org-edna-process-form form 'condition)
   t)))
 
@@ -899,7 +905,7 @@ Edna Syntax: chain!(\"PROPERTY\")
 
 Copy PROPERTY from the source heading to the target heading.
 Does nothing if the source heading has no property PROPERTY."
-  (when-let ((old-prop (org-entry-get last-entry property)))
+  (when-let* ((old-prop (org-entry-get last-entry property)))
 (org-entry-put nil property old-prop)))
 
 
@@ -941,10 +947,10 @@ in a DONE state.
 
 Here, \"Heading 2\" will block if all targets tagged \"target\"
 are not in a DONE state."
-  (when-let ((condition
-  (if neg
-  (member (org-entry-get nil "TODO") org-not-done-keywords)
-(member (org-entry-get nil "TODO") org-done-keywords
+  (when-let* ((condition
+   (if neg
+   (member (org-entry-get nil "TODO") org-not-done-keywords)
+ (member (org-entry-get nil "TODO") org-done-keywords
 (org-get-heading)))
 
 (defun org-edna-condition/todo-state? (neg state)
@@ -1237,7 +1243,7 @@ the source buffer.  Finish with `C-c C-c' or abort with 
`C-c C-k'")
  (cycle-sort-function . identity)))
 
 (defun org-edna-completion-at-point ()
-  (when-let ((bounds (bounds-of-thing-at-point 'symbol)))
+  (when-let* ((bounds (bounds-of-thing-at-point 'symbol)))
 (list (car bounds) (cdr bounds) 'org-edna-completion-table-function)))
 
 



[elpa] master 34e4d86 054/135: Fixed variable-set condition

2020-02-17 Thread Ian Dunn
branch: master
commit 34e4d864bfb78ce6a9e8c5e76444040545618917
Author: Ian D 
Commit: Ian D 

Fixed variable-set condition

* org-edna.el (org-edna-condition/variable-set): Don't treat the input as
  strings.
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index cd83eb7..2a6ab32 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -562,7 +562,7 @@ IDS are all UUIDs as understood by `org-id-find'."
   (buffer-name
 
 (defun org-edna-condition/variable-set (neg var val)
-  (let ((condition (string-equal (symbol-value (intern var)) (read val
+  (let ((condition (equal (symbol-value var) val)))
 (when (org-xor condition neg)
   (format "%s %s= %s" var (or neg "=") val
 



[elpa] master d348102 025/135: Added file for tests

2020-02-17 Thread Ian Dunn
branch: master
commit d348102ee5c8bb5b52f139ad3516740d7ef61360
Author: Ian D 
Commit: Ian D 

Added file for tests
---
 org-edna-tests.org | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/org-edna-tests.org b/org-edna-tests.org
new file mode 100644
index 000..cf2cbff
--- /dev/null
+++ b/org-edna-tests.org
@@ -0,0 +1,18 @@
+* Test Pool
+** TODO Tagged Heading 1:1:test:
+** TODO Tagged Heading 2:1:test:
+** TODO ID Heading 1
+:PROPERTIES:
+:ID:   0d491588-7da3-43c5-b51a-87fbd34f79f7
+:END:
+** TODO ID Heading 2
+:PROPERTIES:
+:ID:   b010cbad-60dc-46ef-a164-eb155e62cbb2
+:END:
+* Finder Tests
+** Match
+*** TODO Blocking Test
+:PROPERTIES:
+:BLOCKER:  match(test&1)
+:ID:   caccd0a6-d400-410a-9018-b0635b07a37e
+:END:



[elpa] master c50f484 106/135: Implemented finder cache

2020-02-17 Thread Ian Dunn
branch: master
commit c50f484fa95d932b5b16bc708fac4b4f39b84271
Author: Ian Dunn 
Commit: Ian Dunn 

Implemented finder cache

* org-edna.el (org-edna--finder-input):
  (org-edna--finder-cache-entry): New structs.
  (org-edna-finder-use-cache): New defcustom to toggle cache.
  (org-edna--finder-cache): Internal cache table.
  (org-edna-finder-cache-timeout): New defcustom to control cache duration.
  (org-edna--add-to-finder-cache): Internal helper function.
  (org-edna--finder-cache-timeout): Placeholder function.
  (org-edna--handle-finder): Handles cache for finders.
  (org-edna--expand-single-sexp-form): Use new finder function.
---
 org-edna.el | 74 -
 1 file changed, 73 insertions(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 9974e3a..5184350 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -387,7 +387,7 @@ correspond to internal variables."
(`(,type . ,func) (org-edna--function-for-key key)))
 (pcase type
   ('finder
-   `(setq ,target-var (org-edna--add-targets ,target-var (,func ,@args
+   `(setq ,target-var (org-edna--add-targets ,target-var 
(org-edna--handle-finder ',func ',args
   ('action
`(org-edna--handle-action ',func ,target-var (point-marker) ',args))
   ('condition
@@ -464,6 +464,78 @@ which of the two types is allowed in STRING-FORM."
   (org-edna-eval-sexp-form
(org-edna-string-form-to-sexp-form string-form action-or-condition)))
 
+;;; Cache
+
+;; Cache works because the returned values of finders are all markers.  Markers
+;; will automatically update themselves when a buffer is edited.
+
+(cl-defstruct org-edna--finder-input
+  func-sym args)
+
+(cl-defstruct org-edna--finder-cache-entry
+  input results last-run-time)
+
+(defvar org-edna--finder-cache (make-hash-table :test 'equal))
+
+(defcustom org-edna-finder-use-cache nil
+  "Whether to use cache for improved performance with finders.
+
+When cache is used for a finder, each finder call will store its
+results for up to `org-edna-finder-cache-timeout' seconds.  The
+results and input are both stored, so the same form for a given
+finder will yield the results of the previous call.
+
+If enough time has passed since the results in cache for a
+specific form were generated, the results will be regenerated and
+stored in cache.
+
+Minor changes to an Org file, such as setting properties or
+adding unrelated headlines, will be taken into account."
+  :group 'org-edna
+  :type 'boolean)
+
+(defcustom org-edna-finder-cache-timeout 300
+  "Maximum age to keep entries in cache, in seconds."
+  :group 'org-edna
+  :type 'number)
+
+(defun org-edna--add-to-finder-cache (func-sym args)
+  (let* ((results (apply func-sym args))
+ (input (make-org-edna--finder-input :func-sym func-sym
+ :args args))
+ (entry (make-org-edna--finder-cache-entry :input input
+   :results results
+   :last-run-time 
(current-time
+(map-put org-edna--finder-cache input entry)))
+
+(defun org-edna--finder-cache-timeout (_func-sym)
+  ;; In the future, we may want to support configurable timeouts on a 
per-finder
+  ;; basis.
+  org-edna-finder-cache-timeout)
+
+(defun org-edna--handle-finder (func-sym args)
+  (if (not org-edna-finder-use-cache)
+  ;; Not using cache, so use the function directly.
+  (apply func-sym args)
+(let* ((input (make-org-edna--finder-input :func-sym func-sym
+   :args args))
+   (entry (map-elt org-edna--finder-cache input)))
+  (cond
+   ;; If we don't have an entry, rerun and make a new one.
+   ((not entry)
+(org-edna--add-to-finder-cache func-sym args))
+   ;; If we do have an entry, but it's timed out, then create a new one.
+   ((>= (float-time (time-subtract (current-time)
+  
(org-edna--finder-cache-entry-last-run-time entry)))
+   (org-edna--finder-cache-timeout func-sym))
+(org-edna--add-to-finder-cache func-sym args))
+   ;; If any element of the results is an invalid marker, then rerun.
+   ((seq-find (lambda (x) (not (markerp x))) 
(org-edna--finder-cache-entry-results entry) nil)
+(org-edna--add-to-finder-cache func-sym args))
+   ;; We have an entry created within the allowed interval.
+   (t
+(org-edna--finder-cache-entry-results entry))
+
 
 
 (defmacro org-edna-run (change-plist  body)



[elpa] master 3a4cca9 003/135: Added Makefile.

2020-02-17 Thread Ian Dunn
branch: master
commit 3a4cca909fdef92f934d09f7ffcc1a9051874138
Author: Ian D 
Commit: Ian D 

Added Makefile.
---
 Makefile | 41 +
 1 file changed, 41 insertions(+)

diff --git a/Makefile b/Makefile
new file mode 100644
index 000..fcac54f
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,41 @@
+# This is part of org-bat
+#
+#  Copyright (C) 2017 Ian Dunn.
+#
+#  This program is free software: you can redistribute it and/or modify
+#  it under the terms of the GNU General Public License as published by
+#  the Free Software Foundation, either version 3 of the License, or
+#  (at your option) any later version.
+#
+#  This program is distributed in the hope that it will be useful,
+#  but WITHOUT ANY WARRANTY; without even the implied warranty of
+#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#  GNU General Public License for more details.
+#
+#  You should have received a copy of the GNU General Public License
+#  along with this program.  If not, see <http://www.gnu.org/licenses/>.
+
+EMACS=emacs --batch
+ALLSRC=org-bat.el
+SOURCE=$(ALLSRC)
+TARGET=$(patsubst %.el,%.elc,$(SOURCE))
+
+all: $(TARGET)
+
+compile: $(TARGET)
+
+%.elc: %.el
+   @$(EMACS) \
+   -L "." \
+   -f batch-byte-compile $<
+
+autoloads: org-bat-autoloads.el
+
+org-bat-autoloads.el:
+   @$(EMACS) \
+   --eval "(require 'package)" \
+   --eval "(setq inhibit-message t)" \
+   --eval "(package-generate-autoloads \"org-bat\" \"$$(pwd)\")"
+
+clean:
+   -rm -f *.elc



[elpa] master 0aa0bf8 082/135: Don't present variables for keyword completion

2020-02-17 Thread Ian Dunn
branch: master
commit 0aa0bf84bdcbb86784358ab087a2805240cb41da
Author: Ian Dunn 
Commit: Ian Dunn 

Don't present variables for keyword completion

* org-edna.el (org-edna--collect-keywords): Check that symbols that match 
the
  patterns are bound as functions.
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 54c93ba..d9c16d4 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1195,7 +1195,7 @@ the source buffer.  Finish with `C-c C-c' or abort with 
`C-c C-k'")
  string-end
 (mapatoms
  (lambda (s)
-   (when (string-match edna-rx (symbol-name s))
+   (when (and (string-match edna-rx (symbol-name s)) (fboundp s))
  (cl-pushnew (concat (match-string-no-properties 1 (symbol-name s)) 
suffix)
  edna-sym-list
 edna-sym-list))



[elpa] master 88b59b3 089/135: Added section to documentation for changes

2020-02-17 Thread Ian Dunn
branch: master
commit 88b59b39f70aff6fc9335adc69b1e41ce42da21e
Author: Ian Dunn 
Commit: Ian Dunn 

Added section to documentation for changes

* org-edna.org (Changelog): New section
---
 org-edna.org | 15 +++
 1 file changed, 15 insertions(+)

diff --git a/org-edna.org b/org-edna.org
index f42e445..9a13a0d 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -963,6 +963,7 @@ If no consideration is given, ALL is assumed.
 ** Setting the properties
 :PROPERTIES:
 :DESCRIPTION: The easy way to set BLOCKER and TRIGGER
+:CUSTOM_ID: xsetting_keywords
 :END:
 
 There are two ways to set the BLOCKER and TRIGGER properties: by hand, or the
@@ -1135,3 +1136,17 @@ There are a few rules to follow:
 - Run 'make check' to verify that your mods don't break anything
 - Avoid additional or altered dependencies if at all possible
   - Exception: New versions of Org mode are allowed
+* Changelog
+** 1.0beta2
+Big release here
+
+*** Added interactive keyword editor with completion
+See [[#setting_keywords][Setting the Properties]] for how to do that
+
+*** New uses of schedule! and deadline!
+- New "float" form that mimics diary-float
+- New "landing" addition to "+1d" and friends to force planning changes to 
land on a certain day or type of day (weekend/weekday)
+
+*** New "relatives" finder
+- Renamed from chain-find with tons of new keywords
+- Modified all other relative finders (previous-sibling, first-child, etc.) to 
use the same keywords



[elpa] master 7379c4f 043/135: Added copyright date to source files

2020-02-17 Thread Ian Dunn
branch: master
commit 7379c4fbb11966b267c2467ad4a3ed10ea136e31
Author: Ian D 
Commit: Ian D 

Added copyright date to source files
---
 org-edna-tests.el | 2 ++
 org-edna.el   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 636d9af..398fa64 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -1,5 +1,7 @@
 ;;; org-edna-tests.el --- Tests for org-edna
 
+;; Copyright (C) 2017 Ian Dunn
+
 ;; Author: Ian Dunn 
 ;; Keywords: convenience, text, org
 ;; Version: 1.0
diff --git a/org-edna.el b/org-edna.el
index 0911ff8..e5889ba 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1,5 +1,7 @@
 ;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
+;; Copyright (C) 2017 Ian Dunn
+
 ;; Author: Ian Dunn 
 ;; Keywords: convenience, text, org
 ;; Version: 1.0



[elpa] master 6470c5f 033/135: Added test for todo action

2020-02-17 Thread Ian Dunn
branch: master
commit 6470c5faa3850de00bfb4beea40f1e85bce78762
Author: Ian D 
Commit: Ian D 

Added test for todo action
---
 org-edna-tests.el | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 3444096..d304c2a 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -132,6 +132,24 @@
 (should (string-equal (substring-no-properties org-block-entry-blocking)
   "TODO Tagged Heading 1 :1:test:"
 
+
+;; Actions
+
+(ert-deftest org-edna-action/todo-test ()
+  (let* ((org-agenda-files `(,org-edna-test-file))
+ (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t)))
+(org-with-point-at target
+  (org-edna-action/todo nil "DONE")
+  (should (string-equal (org-entry-get nil "TODO") "DONE"))
+  (org-edna-action/todo nil "TODO")
+  (should (string-equal (org-entry-get nil "TODO") "TODO")
+
+
+;; Conditions
+
+
+;; Consideration
+
 (provide 'org-edna-tests)
 
 ;;; org-edna-tests.el ends here



[elpa] master 21d2019 006/135: Added has-property condition

2020-02-17 Thread Ian Dunn
branch: master
commit 21d20195722474f3588864e2beb77432bd0dedc2
Author: Ian D 
Commit: Ian D 

Added has-property condition

* org-bat.el (org-bat-condition/has-property): New function.
---
 org-bat.el | 5 +
 1 file changed, 5 insertions(+)

diff --git a/org-bat.el b/org-bat.el
index 23dd096..af4b828 100644
--- a/org-bat.el
+++ b/org-bat.el
@@ -387,6 +387,11 @@ IDS are all UUIDs as understood by `org-id-find'."
 (when (org-bat--xor condition neg)
   (format "%s %s= %s" var (or neg "=") val
 
+(defun org-bat-condition/has-property (neg prop val)
+  (let ((condition (string-equal (org-entry-get nil prop) val)))
+(when (org-bat--xor condition neg)
+  (org-get-heading
+
 
 
 (defun org-bat-transform-consideration (consideration)



[elpa] master 71e00e4 036/135: Fixed consideration handling

2020-02-17 Thread Ian Dunn
branch: master
commit 71e00e49385bd4433926fdc44a280b34aef09004
Author: Ian D 
Commit: Ian D 

Fixed consideration handling

* org-edna.el (org-edna-handle-consideration): Use >= instead of > when
  comparing fulfilled to consideration.
---
 org-edna.el | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 50cfe54..440c4d9 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -526,9 +526,9 @@ IDS are all UUIDs as understood by `org-id-find'."
 
 (defun org-edna-transform-consideration (consideration)
   (pcase consideration
-;; Leave symbols alone
+;; Change all into a symbol
 ('"all" (intern consideration))
-;; Change strings into numbers
+;; Change other strings into numbers
 ((pred stringp)
  (string-to-number consideration))
 (_
@@ -545,14 +545,14 @@ IDS are all UUIDs as understood by `org-id-find'."
;; A fixed number of them must be fulfilled, so check how many aren't.
(let* ((unfulfilled (seq-count #'identity blocks))
   (fulfilled   (- total-blocks unfulfilled)))
- (if (> fulfilled consideration)
+ (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)
+ (if (>= (/ fulfilled total-blocks) consideration)
  nil
first-block))
 



[elpa] master f6feccf 084/135: Fix bug in keyword completion

2020-02-17 Thread Ian Dunn
branch: master
commit f6feccf3d480ac5f041c2d8ac1c0592049314d50
Author: Ian Dunn 
Commit: Ian Dunn 

Fix bug in keyword completion

* org-edna.el (org-edna--collect-keywords): Use let* instead of let.
---
 org-edna.el | 20 ++--
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 33ba1cb..c01d354 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1183,16 +1183,16 @@ the source buffer.  Finish with `C-c C-c' or abort with 
`C-c C-k'\n\n")
   (point-max-marker)))
 
 (defun org-edna--collect-keywords (keyword-type  suffix)
-  (let ((suffix (or suffix ""))
-(edna-sym-list)
-(edna-rx (rx-to-string `(and
- string-start
- "org-edna-"
- ,keyword-type
- "/"
- (submatch (one-or-more ascii))
- ,suffix
- string-end
+  (let* ((suffix (or suffix ""))
+ (edna-sym-list)
+ (edna-rx (rx-to-string `(and
+  string-start
+  "org-edna-"
+  ,keyword-type
+  "/"
+  (submatch (one-or-more ascii))
+  ,suffix
+  string-end
 (mapatoms
  (lambda (s)
(when (and (string-match edna-rx (symbol-name s)) (fboundp s))



[elpa] master 03bafb0 061/135: Documented delete-property! action

2020-02-17 Thread Ian Dunn
branch: master
commit 03bafb03f7a06ad346b9a75dfe18460627a7
Author: Ian D 
Commit: Ian D 

Documented delete-property! action

* org-edna.org (Property): Added delete-property! documentation.
---
 org-edna.org | 4 
 1 file changed, 4 insertions(+)

diff --git a/org-edna.org b/org-edna.org
index fc999a1..1d1f17a 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -534,6 +534,10 @@ Syntax: set-property!("PROPERTY","VALUE")
 
 Sets the property PROPERTY on all targets to VALUE.
 
+Syntax: delete-property!("PROPERTY")
+
+Deletes the property PROPERTY from all targets.
+
 *** Priority
 
 Syntax: set-priority!(PRIORITY)



[elpa] master 89c2ecf 057/135: Added tests for conditions

2020-02-17 Thread Ian Dunn
branch: master
commit 89c2ecf633cd28e8bd0c0673a84bd3ed991d
Author: Ian D 
Commit: Ian D 

Added tests for conditions

* org-edna.el (org-edna-condition/variable-set?): Fixed handling of NEG.
  (org-edna-condition/re-search?): Same.

* org-edna-tests.el: Added tests for conditions.

* org-edna-tests.org: Added ID Heading 4
---
 org-edna-tests.el  | 94 --
 org-edna-tests.org |  4 +++
 org-edna.el|  4 +--
 3 files changed, 97 insertions(+), 5 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 651f31c..4698e52 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -34,6 +34,9 @@
 (defconst org-edna-test-file
   (expand-file-name "org-edna-tests.org" org-edna-test-dir))
 
+(defconst org-edna-tests-el
+  (expand-file-name "org-edna-tests.el" org-edna-test-dir))
+
 ;; Jan 15, 2000; chosen at random
 (defconst org-edna-test-time
   (encode-time 0 0 0 15 1 2000))
@@ -42,12 +45,14 @@
 (defconst org-edna-test-sibling-two-id   
"72534efa-e932-460b-ae2d-f044a0074815")
 (defconst org-edna-test-sibling-three-id 
"06aca55e-ce09-46df-80d7-5b52e55d6505")
 (defconst org-edna-test-parent-id
"21b8f1f5-14e8-4677-873d-69e0389fdc9e")
+(defconst org-edna-test-id-heading-one   
"0d491588-7da3-43c5-b51a-87fbd34f79f7")
+(defconst org-edna-test-id-heading-two   
"b010cbad-60dc-46ef-a164-eb155e62cbb2")
+(defconst org-edna-test-id-heading-three 
"97e6b0f0-40c4-464f-b760-6e5ca9744eb5")
+(defconst org-edna-test-id-heading-four  
"7d4d564b-18b2-445c-a0c8-b1b3fb9ad29e")
 
 (defun org-edna-find-test-heading (id)
   "Find the test heading with id ID."
-  (with-current-buffer (find-file-noselect org-edna-test-file)
-(goto-char (org-find-entry-with-id id))
-(point-marker)))
+  (org-id-find-id-in-file id org-edna-test-file t))
 
 (ert-deftest org-edna-parse-form-no-arguments ()
   (let* ((input-string "test-string")
@@ -364,6 +369,89 @@
 
 ;; Conditions
 
+(defun org-edna-test-condition-form (func-sym pom-true pom-false block-true 
block-false  args)
+  (org-with-point-at pom-true
+(should-not (apply func-sym t args))
+(should (equal (apply func-sym nil args) block-true)))
+  (org-with-point-at pom-false
+(should (equal (apply func-sym t args) block-false))
+(should-not (apply func-sym nil args
+
+(ert-deftest org-edna-condition-done ()
+  (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-four))
+ (pom-todo (org-edna-find-test-heading org-edna-test-id-heading-one))
+ (block-done (org-with-point-at pom-done (org-get-heading)))
+ (block-todo (org-with-point-at pom-todo (org-get-heading
+(org-edna-test-condition-form 'org-edna-condition/done?
+  pom-done pom-todo
+  block-done block-todo)))
+
+(ert-deftest org-edna-condition-todo-state-string ()
+  (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-four))
+ (pom-todo (org-edna-find-test-heading org-edna-test-id-heading-one))
+ (block-done (org-with-point-at pom-done (org-get-heading)))
+ (block-todo (org-with-point-at pom-todo (org-get-heading
+(org-edna-test-condition-form 'org-edna-condition/todo-state?
+  pom-todo pom-done
+  block-todo block-done
+  "TODO")))
+
+(ert-deftest org-edna-condition-todo-state-symbol ()
+  (let* ((pom-done (org-edna-find-test-heading org-edna-test-id-heading-four))
+ (pom-todo (org-edna-find-test-heading org-edna-test-id-heading-one))
+ (block-done (org-with-point-at pom-done (org-get-heading)))
+ (block-todo (org-with-point-at pom-todo (org-get-heading
+(org-edna-test-condition-form 'org-edna-condition/todo-state?
+  pom-todo pom-done
+  block-todo block-done
+  'TODO)))
+
+(ert-deftest org-edna-condition-headings ()
+  (pcase-let* ((`(,pom-headings ,block-headings)
+(with-current-buffer (find-file-noselect org-edna-test-file)
+  (list (point-min-marker) (buffer-name
+   (`(,pom-no-headings ,block-no-headings)
+(with-current-buffer (find-file-noselect org-edna-tests-el)
+  (list (point-min-marker) (buffer-name)
+(org-edna-test-condition-form 'org-edna-condition/headings?
+  pom-headings pom-no-headings
+  block-headings block-no-headings)))
+
+(ert-deftest org-edna-condition-variable-set ()
+  (let* ((temp-var t))
+(should-not (org-edna-condition/variable-set? t 'temp-var t))
+(should (equal (org-edna-condition/variable-set? nil 'temp-var t)
+   "temp-var == t"))
+(should (equal (org-edna-condition/variable-set? t 'temp-var nil)
+   

[elpa] master ef302af 070/135: Added more docstrings

2020-02-17 Thread Ian Dunn
branch: master
commit ef302af917f119db7088d4473be33f34a865f1d5
Author: Ian D 
Commit: Ian D 

Added more docstrings
---
 org-edna.el | 72 -
 1 file changed, 67 insertions(+), 5 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index dd8ba6c..380ab87 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -418,8 +418,9 @@ Example:
   :END:
 #+END_SRC
 
-In the above example, Heading 5 will be blocked until Heading 1, Heading
-3, and Heading 4 are marked DONE, while Heading 2 is ignored."
+In the above example, Heading 5 will be blocked until Heading 1,
+Heading 3, and Heading 4 are marked DONE, while Heading 2 is
+ignored."
   (org-with-wide-buffer
(let ((markers))
  (while (org-up-heading-safe)
@@ -438,7 +439,8 @@ Finds the heading given by OLP in FILE.  Both arguments are 
strings.
   :END:
 #+END_SRC
 
-Test will block if the heading \"path/to/heading\" in \"test.org\" is not 
DONE."
+Test will block if the heading \"path/to/heading\" in
+\"test.org\" is not DONE."
   (let ((marker (org-find-olp (cons file (split-string-and-unquote olp "/")
 (when (markerp marker)
   (list marker
@@ -446,17 +448,77 @@ Test will block if the heading \"path/to/heading\" in 
\"test.org\" is not DONE."
 ;; TODO: Clean up the buffer when it's finished
 
 (defun org-edna-finder/file (file)
+  "Find a file by name.
+
+The `file' finder finds a single file, specified as a string.
+The returned target will be the minimum point in the file.
+
+#+BEGIN_SRC org
+,* TODO Test
+  :PROPERTIES:
+  :BLOCKER:  file(\"~/myfile.org\") headings?
+  :END:
+#+END_SRC
+
+Here, \"Test\" will block until myfile.org is clear of headlines.
+
+Note that with the default condition, `file' won't work."
   ;; If there isn't a buffer visiting file, then there's no point in having a
-  ;; marker to the start of the file.
+  ;; marker to the start of the file, so use `find-file-noselect'.
   (with-current-buffer (find-file-noselect file)
 (list (point-min-marker
 
 (defun org-edna-finder/org-file (file)
-  "Finds FILE in `org-directory'."
+  "Find a file in `org-directory'.
+
+A special form of `file', `org-file' will find FILE (a string) in
+`org-directory'.
+
+#+BEGIN_SRC org
+,* TODO Test
+  :PROPERTIES:
+  :BLOCKER:  org-file(\"test.org\")
+  :END:
+#+END_SRC
+
+Note that the file still requires an extension."
   (with-current-buffer (find-file-noselect (expand-file-name file 
org-directory))
 (list (point-min-marker
 
 (defun org-edna-finder/chain-find ( options)
+  "Find a target as org-depend does.
+
+Identical to the chain argument in org-depend, chain-find selects its single
+target using the following method:
+
+1. Creates a list of possible targets
+2. Filters the targets from Step 1
+3. Sorts the targets from Step 2
+
+After this is finished, chain-find selects the first target in the list and
+returns it.
+
+One option from each of the following three categories may be used; if more 
than
+one is specified, the last will be used.
+
+*Selection*
+
+- from-top: Select siblings of the current headline, starting at the top
+- from-bottom:  As above, but from the bottom
+- from-current: Selects siblings, starting from the headline (wraps)
+- no-wrap:  As above, but without wrapping
+
+*Filtering*
+
+- todo-only:  Select only targets with TODO state set that isn't a 
DONE state
+- todo-and-done-only: Select all targets with a TODO state set
+
+*Sorting*
+
+- priority-up:   Sort by priority, highest first
+- priority-down: Same, but lowest first
+- effort-up: Sort by effort, highest first
+- effort-down:   Sort by effort, lowest first"
   ;; sortfun - function to use to sort elements
   ;; filterfun - Function to use to filter elements
   ;; Both should handle positioning point



[elpa] master 975da4b 010/135: Improved org-bat-parse-form to handle new argument types

2020-02-17 Thread Ian Dunn
branch: master
commit 975da4bc12d61cbc8e233c6a1c90d0741d0a4180
Author: Ian D 
Commit: Ian D 

Improved org-bat-parse-form to handle new argument types

Includes quoted arguments, nested parentheses, and arguments with spaces.

* org-bat.el (org-bat-parse-form): Rewrote to use `read-from-string'.
---
 org-bat.el | 46 +++---
 1 file changed, 39 insertions(+), 7 deletions(-)

diff --git a/org-bat.el b/org-bat.el
index e3ca976..d360732 100644
--- a/org-bat.el
+++ b/org-bat.el
@@ -13,13 +13,45 @@
 (require 'subr-x)
 
 (defun org-bat-parse-form (form)
-  "Form should be KEY(ARGS)."
-  (when (string-match "^\\([!]\\)?\\([a-zA-Z-]+\\)\\(?:(\\([^)]+\\))\\)?" form)
-(list (intern (match-string 2 form))
-  (when-let (args (match-string 3 form))
-(save-match-data (split-string args ",")))
-  (match-string 1 form)
-  (match-end 0
+  (pcase-let* ((`(,token . ,pos) (read-from-string form))
+   (modifier nil)
+   (args nil))
+(unless token
+  (signal 'invalid-read-syntax (substring form pos)))
+;; Check for either end of string or an opening parenthesis
+(unless (or (equal pos (length form))
+(equal (string-match-p "(" form pos) pos))
+  (signal 'invalid-read-syntax (substring form pos 1)))
+;; Parse arguments if we have any
+(when (equal (string-match-p "(" form pos) pos)
+  ;; Move past the parenthesis
+  (cl-incf pos)
+  (while (and (< pos (length form))
+  (not (= (string-match-p ")" form pos) pos)))
+(pcase-let* ((`(,arg . ,new-pos) (read-from-string form pos)))
+  (unless arg
+(signal 'invalid-read-syntax (substring form pos)))
+  (let ((new-arg (if (stringp arg) arg (symbol-name arg
+(push new-arg args))
+  (setq pos new-pos)
+  ;; Move past whitespace
+  (when (eq (string-match "\\w+" form pos) pos)
+(setq pos (match-end 0)))
+  ;; The next character should either be a ',' or a ')'
+  (unless (equal (string-match-p "[,)]" form pos) pos)
+(signal 'invalid-read-syntax (substring form pos 1)))
+  ;; Move past a comma if there is one
+  (when (equal (string-match-p "," form pos) pos)
+(cl-incf pos
+  (unless (equal (string-match-p ")" form pos) pos)
+(signal 'invalid-read-syntax (substring form pos 1)))
+  (setq args (seq-reverse args))
+  ;; Move past the closing parenthesis
+  (cl-incf pos))
+(when (string-match "^\\([!]\\)\\(.*\\)" (symbol-name token))
+  (setq modifier (intern (match-string 1 (symbol-name token
+  (setq token(intern (match-string 2 (symbol-name token)
+(list token args modifier pos)))
 
 (defconst org-bat--types
   '(finder action condition)



[elpa] master a71c519 068/135: Added docstrings to some finders

2020-02-17 Thread Ian Dunn
branch: master
commit a71c5191bc316e4b420ddc4747825f32b0996241
Author: Ian D 
Commit: Ian D 

Added docstrings to some finders

* org-edna.el (org-edna-finder/match):
  (org-edna-finder/ids):
  (org-edna-finder/ancestors):
  (org-edna-finder/olp): Added docstrings from org-edna.org
---
 org-edna.el | 53 +
 1 file changed, 45 insertions(+), 8 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 46046ab..883e92d 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -293,15 +293,23 @@ Remove Edna's workers from `org-trigger-hook' and
 
 ;; Tag Finder
 (defun org-edna-finder/match (match-spec  scope skip)
-  "Find entries with match-spec MATCH-SPEC.
+  "Find entries using Org matching.
 
 MATCH-SPEC may be any valid match string; it is passed straight
-into `org-map-entries', with 'agenda as the scope.
+into `org-map-entries'.
 
-SCOPE and SKIP are their counterparts in `org-map-entries', but
-as strings.
+SCOPE and SKIP are their counterparts in `org-map-entries'.
+SCOPE defaults to agenda, and SKIP defaults to nil.
 
-SCOPE defaults to \"agenda\", and SKIP defaults to nil."
+#+BEGIN_SRC org
+,* TODO Test
+  :PROPERTIES:
+  :BLOCKER:  match(\"test\" agenda)
+  :END:
+#+END_SRC
+
+\"Test\" will block until all entries tagged \"test\" and
+\"mine\" in the agenda files are marked DONE."
   (setq scope (or scope 'agenda))
   (org-map-entries
;; Find all entries in the agenda files that match the given tag.
@@ -310,7 +318,7 @@ SCOPE defaults to \"agenda\", and SKIP defaults to nil."
 
 ;; ID finder
 (defun org-edna-finder/ids ( ids)
-  "Find entries with IDs in IDS.
+  "Find a list of headlines with given IDs.
 
 IDS are all UUIDs as understood by `org-id-find'."
   (mapcar (lambda (id) (org-id-find id 'marker)) ids))
@@ -395,14 +403,43 @@ IDS are all UUIDs as understood by `org-id-find'."
 nil 'tree)))
 
 (defun org-edna-finder/ancestors ()
+  "Find a list of ancestors.
+
+Example:
+
+#+BEGIN_SRC org
+,* TODO Heading 1
+,** TODO Heading 2
+,*** TODO Heading 3
+, TODO Heading 4
+,* TODO Heading 5
+  :PROPERTIES:
+  :BLOCKER:  ancestors
+  :END:
+#+END_SRC
+
+In the above example, Heading 5 will be blocked until Heading 1, Heading
+3, and Heading 4 are marked DONE, while Heading 2 is ignored."
   (org-with-wide-buffer
(let ((markers))
  (while (org-up-heading-safe)
(push (point-marker) markers))
  (nreverse markers
 
-(defun org-edna-finder/olp (file path)
-  (let ((marker (org-find-olp (cons file (split-string-and-unquote path 
"/")
+(defun org-edna-finder/olp (file olp)
+  "Find a headline by its outline path.
+
+Finds the heading given by OLP in FILE.  Both arguments are strings.
+
+#+BEGIN_SRC org
+,* TODO Test
+  :PROPERTIES:
+  :BLOCKER:  olp(\"test.org\" \"path/to/heading\")
+  :END:
+#+END_SRC
+
+Test will block if the heading \"path/to/heading\" in \"test.org\" is not 
DONE."
+  (let ((marker (org-find-olp (cons file (split-string-and-unquote olp "/")
 (when (markerp marker)
   (list marker
 



[elpa] master 7e6913b 091/135: Fixed "Setting the Properties" custom_id and title

2020-02-17 Thread Ian Dunn
branch: master
commit 7e6913bfe4ba086791403fba93765001cf881b3f
Author: Ian Dunn 
Commit: Ian Dunn 

Fixed "Setting the Properties" custom_id and title

* org-edna.org (Setting the Properties): Fixed.
---
 org-edna.org | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index e95a909..b6d85eb 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -960,10 +960,10 @@ are complete, and at least two of ID3, ID4, ID5, and ID6 
are complete.
 
 If no consideration is given, ALL is assumed.
 
-** Setting the properties
+** Setting the Properties
 :PROPERTIES:
 :DESCRIPTION: The easy way to set BLOCKER and TRIGGER
-:CUSTOM_ID: xsetting_keywords
+:CUSTOM_ID: setting_keywords
 :END:
 
 There are two ways to set the BLOCKER and TRIGGER properties: by hand, or the



[elpa] master 6b9a676 031/135: Added documentation for each condition

2020-02-17 Thread Ian Dunn
branch: master
commit 6b9a6769f9f96423cae2090cc06260c5dba775da
Author: Ian D 
Commit: Ian D 

Added documentation for each condition
---
 org-edna.org | 139 +++
 1 file changed, 131 insertions(+), 8 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index d76a2b1..7b74340 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -1,6 +1,10 @@
 #+TITLE: Org Edna
 #+AUTHOR: Ian Dunn
 #+EMAIL: du...@gnu.org
+#+DATE: {{{modification-time}}}
+
+#+STARTUP: overview
+#+TODO: FIXME | FIXED
 
 Extensible Dependencies 'N' Actions for Org-Mode tasks
 
@@ -25,11 +29,6 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 :PROPERTIES:
 :CUSTOM_ID: introduction
 :END:
-:TODO:
-- [ ] *Explain how this will make peoples' lives easier*
-- [ ] Stick with one of heading, headline, or entry; don't keep switching 
between them
-:END:
-
 
 Edna provides an extensible means of specifying conditions which must be
 fulfilled before a task can be completed and actions to take once it is.
@@ -44,7 +43,61 @@ and DONE state to indicate any state in ~org-done-keywords~.
 :PROPERTIES:
 :CUSTOM_ID: operation
 :END:
-Explain targets, actions, conditions
+
+Let's start with an example: Say you want to do laundry, but once you've put
+your clothes in the washer, you forget about it.  Even with a tool like
+org-notify or appt, Org won't know when to remind you.  If you've got them
+scheduled for an hour after the other, maybe you forgot one time, or ran a
+little late.  Now Org will remind you too early.
+
+Edna can handle this for you like so:
+
+#+BEGIN_SRC org
+,* TODO Put clothes in washer
+  SCHEDULED: <2017-04-08 Sat 09:00>
+  :PROPERTIES:
+  :TRIGGER: next-sibling scheduled(++1h)
+  :END:
+,* TODO Put clothes in dryer
+  :PROPERTIES:
+  :TRIGGER: next-sibling scheduled(++1h)
+  :BLOCKER:  previous-sibling
+  :END:
+,* TODO Fold laundry
+  :PROPERTIES:
+  :TRIGGER: next-sibling scheduled(++1h)
+  :BLOCKER:  previous-sibling
+  :END:
+,* TODO Put clothes away
+  :PROPERTIES:
+  :TRIGGER: next-sibling scheduled(++1h)
+  :BLOCKER:  previous-sibling
+  :END:
+#+END_SRC
+
+After you've put your clothes in the washer and mark the task DONE, Edna will
+schedule the following task for one hour after you set the first headline as
+done.
+
+Another example might be a checklist that you've done so many times that you do
+part of it on autopilot:
+
+#+BEGIN_SRC org
+,* TODO Address all TODOs in code
+,* TODO Commit Code to Repository
+#+END_SRC
+
+The last thing anyone wants is to find out that some part of the code on which
+they've been working for days has a surprise waiting for them.  Once again, 
Edna
+can help:
+
+#+BEGIN_SRC org
+,* TODO Address all TODOs in code
+  :PROPERTIES:
+  :BLOCKER: file(main.cpp) file(code.cpp) re-search(TODO)
+  :END:
+,* TODO Commit Code to Repository
+#+END_SRC
 ** Blockers
 :PROPERTIES:
 :CUSTOM_ID: blockers
@@ -56,7 +109,28 @@ as DONE.
 :PROPERTIES:
 :CUSTOM_ID: triggers
 :END:
-A trigger is an action triggered by setting a headline to DONE.
+A trigger is an action to take when a headline is set to done.  For example,
+scheduling another task, marking another task as TODO, or renaming a file.
+** Syntax
+:PROPERTIES:
+:CUSTOM_ID: syntax
+:DESCRIPTION: Basic explanation of Edna's syntax
+:END:
+#+cindex: syntax
+
+The basic syntax of Edna's commands is KEYWORD(ARG1,ARG2,...)
+
+KEYWORD can be any valid symbol, such as key-word, KEY_WORD, or keyword?.
+
+Each argument can be one of the following:
+
+- A symbol, such as arg or arg-1
+- A valid lisp form, such as (+ 1 2) or (or a b)
+- A quoted string, such as "hello" or "My name is Edna"
+
+Any quotes should be escaped (e.g. "\"\"").
+
+The parentheses can be omitted for commands with no arguments.
 * Basic Features
 :PROPERTIES:
 :CUSTOM_ID: basic
@@ -262,27 +336,76 @@ that target, then that headline is blocked.
 :PROPERTIES:
 :CUSTOM_ID: done
 :END:
+
+Syntax: done
+
+Blocks the current headline if any target is DONE.
+
 *** headings
 :PROPERTIES:
 :CUSTOM_ID: headings
 :END:
+
+Syntax: headings
+
+Blocks the current headline if any target belongs to a file that has an Org 
heading.
+
+#+BEGIN_EXAMPLE
+org-file(refile.org) headings
+#+END_EXAMPLE
+
+The above example blocks if refile.org has any headings.
+
 *** todo-state
 :PROPERTIES:
 :CUSTOM_ID: todo-state
 :END:
+
+Syntax: todo-state(STATE)
+
+Blocks if any target has a headline with TODO state set to STATE.
+
 *** variable-set
 :PROPERTIES:
 :CUSTOM_ID: variable-set
 :END:
+
+Syntax: variable-set(VARIABLE,VALUE)
+
+Blocks the current headline if VARIABLE is set to VALUE.
+
+#+BEGIN_EXAMPLE
+self variable-set(test-variable,12)
+#+END_EXAMPLE
+
 *** has-property
 :PROPERTIES:
 :CUSTOM_ID: has-property
 :END:
+
+Syntax: has-property(PROPERTY,VALUE)
+
+Tests each target for the property PROPERTY, and blocks if it's set to VALUE.
+
+*** re-search
+:PROPERTIES:
+:CUSTOM_ID: re-search

[elpa] master aa259f0 037/135: Fix considerations

2020-02-17 Thread Ian Dunn
branch: master
commit aa259f0edc351f77bf5fe55500978cb42f2d694a
Author: Ian D 
Commit: Ian D 

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))
 



[elpa] master 5b1c81a 049/135: Fixed error in last commit

2020-02-17 Thread Ian Dunn
branch: master
commit 5b1c81a3cf89d746c05a576dfa0bcf5271331396
Author: Ian D 
Commit: Ian D 

Fixed error in last commit
---
 org-edna.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/org-edna.el b/org-edna.el
index 89cda05..73d2bd0 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -244,7 +244,7 @@ SCOPE and SKIP are their counterparts in `org-map-entries', 
but
 as strings.
 
 SCOPE defaults to \"agenda\", and SKIP defaults to nil."
-  (setq scope (or scope 'agenda)
+  (setq scope (or scope 'agenda))
   (org-map-entries
;; Find all entries in the agenda files that match the given tag.
(lambda nil (point-marker))



[elpa] master 0b0cb67 063/135: Use org source blocks instead of example blocks in documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 0b0cb67450448c4fca6359487478c77641fa48e8
Author: Ian D 
Commit: Ian D 

Use org source blocks instead of example blocks in documentation
---
 org-edna.org | 46 +++---
 1 file changed, 23 insertions(+), 23 deletions(-)

diff --git a/org-edna.org b/org-edna.org
index 3ab9a9e..de72e06 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -72,7 +72,7 @@ little late.  Now Org will remind you too early.
 
 Edna can handle this for you like so:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Put clothes in washer
   SCHEDULED: <2017-04-08 Sat 09:00>
   :PROPERTIES:
@@ -93,7 +93,7 @@ Edna can handle this for you like so:
   :TRIGGER: next-sibling scheduled!("++1h")
   :BLOCKER:  previous-sibling
   :END:
-#+END_EXAMPLE
+#+END_SRC
 
 After you've put your clothes in the washer and mark the task DONE, Edna will
 schedule the following task for one hour after you set the first headline as
@@ -102,22 +102,22 @@ done.
 Another example might be a checklist that you've done so many times that you do
 part of it on autopilot:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Address all TODOs in code
 ,* TODO Commit Code to Repository
-#+END_EXAMPLE
+#+END_SRC
 
 The last thing anyone wants is to find out that some part of the code on which
 they've been working for days has a surprise waiting for them.  Once again, 
Edna
 can help:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Address all TODOs in code
   :PROPERTIES:
   :BLOCKER: file("main.cpp") file("code.cpp") re-search?("TODO")
   :END:
 ,* TODO Commit Code to Repository
-#+END_EXAMPLE
+#+END_SRC
 
 ** Blockers
 :PROPERTIES:
@@ -177,7 +177,7 @@ The ~ancestors~ finder returns a list of the current 
headline's ancestors.
 
 For example:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Heading 1
 ,** TODO Heading 2
 ,** TODO Heading 3
@@ -186,7 +186,7 @@ For example:
  :PROPERTIES:
  :BLOCKER:  ancestors
  :END:
-#+END_EXAMPLE
+#+END_SRC
 
 In the above example, "Heading 5" will be blocked until "Heading 1", "Heading
 3", and "Heading 4" are marked "DONE", while "Heading 2" is ignored.
@@ -207,19 +207,19 @@ returns it.
 One option from each of the following three categories may be used; if more 
than
 one is specified, the last will be used.
 
-<>
+*Selection*
 
 - from-top: Select siblings of the current headline, starting at the top
 - from-bottom:  As above, but from the bottom
 - from-current: Selects siblings, starting from the headline (wraps)
 - no-wrap:  As above, but without wrapping
 
-<>
+*Filtering*
 
 - todo-only:  Select only targets with TODO state set that isn't a 
DONE keyword
 - todo-and-done-only: Select all targets with a TODO state set
 
-<>
+*Sorting*
 
 - priority-up:   Sort by priority, highest first
 - priority-down: Same, but lowest first
@@ -251,7 +251,7 @@ Syntax: descendants
 The ~descendants~ finder returns a list of all descendants of the current
 headline.
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Heading 1
:PROPERTIES:
:BLOCKER:  descendants
@@ -260,7 +260,7 @@ headline.
 ,** TODO Heading 3
 ,*** TODO Heading 4
 , TODO Heading 5
-#+END_EXAMPLE
+#+END_SRC
 
 In the above example, "Heading 1" will block until Headings 2, 3, 4, and 5 are
 DONE.
@@ -279,12 +279,12 @@ will be the minimum point in the file.
 Note that with the default condition, ~file~ won't work.  See 
[[#conditions][conditions]] for how
 to set a different condition.  For example:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  file("~/myfile.org") headings?
   :END:
-#+END_EXAMPLE
+#+END_SRC
 
 Here, "Test" will block until myfile.org is clear of headlines.
 
@@ -309,12 +309,12 @@ Syntax: id(ID1 ID2 ...)
 The ~ids~ finder will search for headlines with given IDs, using ~org-id~.  Any
 number of UUIDs may be specified.  For example:
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  ids(62209a9a-c63b-45ef-b8a8-12e47a9ceed9 
6dbd7921-a25c-4e20-b035-365677e00f30)
   :END:
-#+END_EXAMPLE
+#+END_SRC
 
 Here, "Test" will block until the headline with ID
 62209a9a-c63b-45ef-b8a8-12e47a9ceed9 and the headline with ID
@@ -333,12 +333,12 @@ Syntax: match("MATCH-STRING" SCOPE SKIP)
 The ~match~ keyword will take any arguments that ~org-map-entries~ usually 
takes.
 In fact, the arguments to ~match~ are passed straight into ~org-map-entries~.
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  match("test" agenda)
   :END:
-#+END_EXAMPLE
+#+END_SRC
 
 "Test" will block until all entries tagged "test" and "mine" in the agenda 
files
 are marked DONE.
@@ -365,12 +365,12 @@ Syntax: olp("FILE" "OLP")
 
 Finds the heading given by OLP in FILE.  Both arguments are strings.
 
-#+BEGIN_EXAMPLE
+#+BEGIN_SRC org
 ,* TODO Test
   :PROPERTIES:
   :BLOCKER:  olp("test.org" "path/to/heading")
   :END:
-#+END_EXAMPLE
+#+END_SRC
 
 "Test" will block if the heading "path/to/heading" in "test.org" is not DONE.
 
@@ -383,12 

[elpa] master 3ff308b 055/135: Updated to new syntax

2020-02-17 Thread Ian Dunn
branch: master
commit 3ff308b3a091b3f76e828771c00cdf0a5c89a15b
Author: Ian D 
Commit: Ian D 

Updated to new syntax

Remove ambiguity between types using ? and !

* org-edna.el (org-edna--types): Removed.
  (org-edna--function-for-key): Test for ? and !
  Updated all functions to new naming convention.

* org-edna-tests.el (org-edna-parse-form-condition): New test.
  Updated tests to use new function names.

* org-edna.org: Updated.
---
 org-edna-tests.el |  41 --
 org-edna.el   |  74 +
 org-edna.org  | 158 +-
 3 files changed, 176 insertions(+), 97 deletions(-)

diff --git a/org-edna-tests.el b/org-edna-tests.el
index 46f5f49..651f31c 100644
--- a/org-edna-tests.el
+++ b/org-edna-tests.el
@@ -123,6 +123,17 @@
   (should (not modifier1))
   (should (= pos1 (length input-string))
 
+(ert-deftest org-edna-parse-form-condition ()
+  (let ((input-string "variable-set?()"))
+(pcase-let* ((`(,token1 ,args1 ,modifier1 ,pos1) (org-edna-parse-form 
input-string))
+ (`(,type . ,func) (org-edna--function-for-key token1)))
+  (should (eq token1 'variable-set?))
+  (should (not args1))
+  (should (not modifier1))
+  (should (= pos1 (length input-string)))
+  (should (eq type 'condition))
+  (should (eq func 'org-edna-condition/variable-set?)
+
 
 ;; Finders
 
@@ -285,13 +296,13 @@
   (let* ((org-agenda-files `(,org-edna-test-file))
  (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t)))
 (org-with-point-at target
-  (org-edna-action/todo nil "DONE")
+  (org-edna-action/todo! nil "DONE")
   (should (string-equal (org-entry-get nil "TODO") "DONE"))
-  (org-edna-action/todo nil "TODO")
+  (org-edna-action/todo! nil "TODO")
   (should (string-equal (org-entry-get nil "TODO") "TODO"))
-  (org-edna-action/todo nil 'DONE)
+  (org-edna-action/todo! nil 'DONE)
   (should (string-equal (org-entry-get nil "TODO") "DONE"))
-  (org-edna-action/todo nil 'TODO)
+  (org-edna-action/todo! nil 'TODO)
   (should (string-equal (org-entry-get nil "TODO") "TODO")
 
 (ert-deftest org-edna-action-scheduled/wkdy ()
@@ -300,15 +311,15 @@
  (org-agenda-files `(,org-edna-test-file))
  (target (org-id-find "0d491588-7da3-43c5-b51a-87fbd34f79f7" t)))
 (org-with-point-at target
-  (org-edna-action/scheduled nil "Mon")
+  (org-edna-action/scheduled! nil "Mon")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-17 Mon>"))
-  (org-edna-action/scheduled nil 'rm)
+  (org-edna-action/scheduled! nil 'rm)
   (should (not (org-entry-get nil "SCHEDULED")))
-  (org-edna-action/scheduled nil "Mon 9:00")
+  (org-edna-action/scheduled! nil "Mon 9:00")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-17 Mon 09:00>"))
-  (org-edna-action/scheduled nil 'rm)
+  (org-edna-action/scheduled! nil 'rm)
   (should (not (org-entry-get nil "SCHEDULED"))
 
 (ert-deftest org-edna-action-scheduled/cp ()
@@ -320,10 +331,10 @@
 (org-with-point-at target
   (dolist (pair pairs)
 ;; (message "Pair: %s" pair)
-(org-edna-action/scheduled source (car pair))
+(org-edna-action/scheduled! source (car pair))
 (should (string-equal (org-entry-get nil "SCHEDULED")
   "<2000-01-15 Sat 00:00>"))
-(org-edna-action/scheduled source (cdr pair))
+(org-edna-action/scheduled! source (cdr pair))
 (should (not (org-entry-get nil "SCHEDULED")))
 
 (ert-deftest org-edna-action-scheduled/inc ()
@@ -334,19 +345,19 @@
 (org-with-point-at target
   ;; Time started at Jan 15, 2000
   ;; Increment 1 minute
-  (org-edna-action/scheduled nil "+1M")
+  (org-edna-action/scheduled! nil "+1M")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-15 Sat 00:01>"))
-  (org-edna-action/scheduled nil "-1M")
+  (org-edna-action/scheduled! nil "-1M")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-15 Sat 00:00>"))
-  (org-edna-action/scheduled nil "+1d")
+  (org-edna-action/scheduled! nil "+1d")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-16 Sun 00:00>"))
-  (org-edna-action/scheduled nil "++1h")
+  (org-edna-action/scheduled! nil "++1h")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-15 Sat 01:00>"))
-  (org-edna-action/scheduled nil "2000-01-15 Sat 00:00")
+  (org-edna-action/scheduled! nil "2000-01-15 Sat 00:00")
   (should (string-equal (org-entry-get nil "SCHEDULED")
 "<2000-01-15 Sat 

[elpa] master 13e752b 021/135: Fix uses of substring

2020-02-17 Thread Ian Dunn
branch: master
commit 13e752b14aface86f316278e8d92db1919c6922d
Author: Ian D 
Commit: Ian D 

Fix uses of substring

* org-edna.el (org-edna-parse-form): Third argument to substring is TO, not 
LENGTH
---
 org-edna.el | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 9416aa0..1411982 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -21,7 +21,7 @@
 ;; Check for either end of string or an opening parenthesis
 (unless (or (equal pos (length form))
 (equal (string-match-p "(" form pos) pos))
-  (signal 'invalid-read-syntax (substring form pos 1)))
+  (signal 'invalid-read-syntax (substring form pos (1+ pos
 ;; Parse arguments if we have any
 (when (equal (string-match-p "(" form pos) pos)
   ;; Move past the parenthesis
@@ -39,12 +39,12 @@
 (setq pos (match-end 0)))
   ;; The next character should either be a ',' or a ')'
   (unless (equal (string-match-p "[,)]" form pos) pos)
-(signal 'invalid-read-syntax (substring form pos 1)))
+(signal 'invalid-read-syntax (substring form pos (1+ pos
   ;; Move past a comma if there is one
   (when (equal (string-match-p "," form pos) pos)
 (cl-incf pos
   (unless (equal (string-match-p ")" form pos) pos)
-(signal 'invalid-read-syntax (substring form pos 1)))
+(signal 'invalid-read-syntax (substring form pos (1+ pos
   (setq args (seq-reverse args))
   ;; Move past the closing parenthesis
   (cl-incf pos))



[elpa] master 329b39e 058/135: Added installation and setup instructions to documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 329b39ee765a990599dfa71e71e0efd105474910
Author: Ian D 
Commit: Ian D 

Added installation and setup instructions to documentation

* org-edna.org (Installation and Setup): New section.
---
 org-edna.org | 18 ++
 1 file changed, 18 insertions(+)

diff --git a/org-edna.org b/org-edna.org
index e51c8f2..fc999a1 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -42,6 +42,23 @@ headline, and when it is changing from a TODO state to a 
DONE state.
 For brevity, we use TODO state to indicate any state in 
~org-not-done-keywords~,
 and DONE state to indicate any state in ~org-done-keywords~.
 
+** Installation and Setup
+
+Right now, the only way to install Edna is by cloning the bazaar repo:
+
+#+BEGIN_SRC shell
+bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna
+#+END_SRC
+
+After that, add the following to your init file (typically .emacs):
+
+#+BEGIN_SRC emacs-lisp
+(add-to-list 'load-path "/full/path/to/org-edna/")
+(org-edna-load)
+#+END_SRC
+
+If you ever want to disable Edna, run ~org-edna-unload~.
+
 ** Basic Operation
 :PROPERTIES:
 :CUSTOM_ID: operation
@@ -101,6 +118,7 @@ can help:
   :END:
 ,* TODO Commit Code to Repository
 #+END_EXAMPLE
+
 ** Blockers
 :PROPERTIES:
 :CUSTOM_ID: blockers



[elpa] master 7618794 066/135: Added in-buffer settings and new sections to Documentation

2020-02-17 Thread Ian Dunn
branch: master
commit 76187948c67e9fc63eec1d538aa5ae7b750181a8
Author: Ian D 
Commit: Ian D 

Added in-buffer settings and new sections to Documentation

* org-edna.org (Contributing): New section

* .bzrignore: Ignore generated documentation files
---
 .bzrignore   |   6 ++-
 org-edna.org | 133 ---
 2 files changed, 123 insertions(+), 16 deletions(-)

diff --git a/.bzrignore b/.bzrignore
index 507633b..ec97837 100644
--- a/.bzrignore
+++ b/.bzrignore
@@ -1,2 +1,6 @@
 *.elc
-local.mk
\ No newline at end of file
+local.mk
+org-edna-autoloads.el
+org-edna.info
+org-edna.texi
+org-edna.html
\ No newline at end of file
diff --git a/org-edna.org b/org-edna.org
index de72e06..da9237a 100644
--- a/org-edna.org
+++ b/org-edna.org
@@ -4,10 +4,14 @@
 #+DATE: {{{modification-time}}}
 
 #+STARTUP: overview
+#+STARTUP: indent
 #+TODO: FIXME | FIXED
-#+OPTIONS: toc:2
+#+OPTIONS: toc:2 num:nil timestamp:nil \n:nil |:t ':t email:t
+#+OPTIONS: *:t <:t d:nil todo:nil pri:nil tags:not-in-toc
 
-Extensible Dependencies 'N' Actions for Org-Mode tasks
+#+TEXINFO_DIR_CATEGORY: Emacs
+#+TEXINFO_DIR_TITLE: Org Edna: (edna)
+#+TEXINFO_DIR_DESC: Extensible Dependencies 'N' Actions for Org Mode tasks
 
 * Copying
 Copyright (C) 2017 Ian Dunn
@@ -29,9 +33,10 @@ along with this program.  If not, see 
<http://www.gnu.org/licenses/>.
 * Introduction
 :PROPERTIES:
 :CUSTOM_ID: introduction
+:DESCRIPTION: A Brief Introduction to Edna
 :END:
 
-[[https://savannah.nongnu.org/projects/org-edna-el/][Source Code on Savannah]]
+Extensible Dependencies 'N' Actions (EDNA) for Org Mode tasks
 
 Edna provides an extensible means of specifying conditions which must be
 fulfilled before a task can be completed and actions to take once it is.
@@ -43,17 +48,28 @@ For brevity, we use TODO state to indicate any state in 
~org-not-done-keywords~,
 and DONE state to indicate any state in ~org-done-keywords~.
 
 ** Installation and Setup
+:PROPERTIES:
+:DESCRIPTION: How to install Edna
+:END:
+
+*Requirements*
+
+| Emacs |  25.1 |
+| seq   |  2.19 |
+| org   | 9.0.5 |
 
 Right now, the only way to install Edna is by cloning the bazaar repo:
 
 #+BEGIN_SRC shell
 bzr branch https://bzr.savannah.gnu.org/r/org-edna-el/ org-edna
+make -C org-edna compile autoloads
 #+END_SRC
 
 After that, add the following to your init file (typically .emacs):
 
 #+BEGIN_SRC emacs-lisp
 (add-to-list 'load-path "/full/path/to/org-edna/")
+(load "/path/to/org-edna/org-edna-autoloads.el")
 (org-edna-load)
 #+END_SRC
 
@@ -62,6 +78,7 @@ If you ever want to disable Edna, run ~org-edna-unload~.
 ** Basic Operation
 :PROPERTIES:
 :CUSTOM_ID: operation
+:DESCRIPTION: How to use Edna
 :END:
 
 Let's start with an example: Say you want to do laundry, but once you've put
@@ -122,16 +139,22 @@ can help:
 ** Blockers
 :PROPERTIES:
 :CUSTOM_ID: blockers
+:DESCRIPTION: Blocking a TODO Item
 :END:
+
 A blocker indicates conditions which must be met in order for a headline to be
 marked as DONE.  Typically, this will be a list of headlines that must be 
marked
 as DONE.
+
 ** Triggers
 :PROPERTIES:
 :CUSTOM_ID: triggers
+:DESCRIPTION: Triggering actions after completing a task
 :END:
+
 A trigger is an action to take when a headline is set to done.  For example,
 scheduling another task, marking another task as TODO, or renaming a file.
+
 ** Syntax
 :PROPERTIES:
 :CUSTOM_ID: syntax
@@ -157,8 +180,16 @@ The parentheses can be omitted for commands with no 
arguments.
 * Basic Features
 :PROPERTIES:
 :CUSTOM_ID: basic
+:DESCRIPTION: Finders and Actions
 :END:
+
+The most basic features of Edna are *finders* and *actions*.
+
 ** Finders
+:PROPERTIES:
+:DESCRIPTION: How to find targets
+:CUSTOM_ID: finders
+:END:
 A finder specifies locations from which to test conditions or perform actions.
 These locations are referred to as "targets".
 
@@ -180,17 +211,22 @@ For example:
 #+BEGIN_SRC org
 ,* TODO Heading 1
 ,** TODO Heading 2
-,** TODO Heading 3
-,*** TODO Heading 4
-, TODO Heading 5
- :PROPERTIES:
- :BLOCKER:  ancestors
- :END:
+,*** TODO Heading 3
+, TODO Heading 4
+,* TODO Heading 5
+  :PROPERTIES:
+  :BLOCKER:  ancestors
+  :END:
 #+END_SRC
 
 In the above example, "Heading 5" will be blocked until "Heading 1", "Heading
 3", and "Heading 4" are marked "DONE", while "Heading 2" is ignored.
+
 *** chain-find
+:PROPERTIES:
+:CUSTOM_ID: chain-find
+:DESCRIPTION: Find a target as org-depend does
+:END:
 
 Syntax: chain-find(OPTION OPTION...)
 
@@ -228,8 +264,8 @@ one is specified, the last will be used.
 
 *** children
 :PROPERTIES:
-:DESCRIPTION: Find all immediate children
 :CUSTOM_ID: children
+:DESCRIPTION: Find all immediate children
 :END:
 
 Syntax: children
@@ -242,8 +278,8 @@ In order to get all levels of children of the current 
headline, use the
 
 *** descendants
 :PROPERTIE

[elpa] master e793f3c 047/135: Fixed bugs from last commit

2020-02-17 Thread Ian Dunn
branch: master
commit e793f3c4ae45469198ec54ada25183e3bdb3b298
Author: Ian D 
Commit: Ian D 

Fixed bugs from last commit

* org-edna.el (org-edna--syntax-error): Back-quote arguments
  (org-edna--print-syntax-error): Fixed name.
---
 org-edna.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index 152cc6a..370b50a 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -42,9 +42,9 @@ properties used during actions or conditions."
   :type 'boolean)
 
 (defmacro org-edna--syntax-error (msg form pos)
-  `(signal 'invalid-read-syntax (list :msg msg :form form :pos pos)))
+  `(signal 'invalid-read-syntax (list :msg ,msg :form ,form :pos ,pos)))
 
-(defun org-edna--handle-syntax-error (error-plist)
+(defun org-edna--print-syntax-error (error-plist)
   (let ((msg (plist-get error-plist :msg))
 (form (plist-get error-plist :form))
 (pos (plist-get error-plist :pos)))



[elpa] master 9d26430 072/135: Fixed copyright strings.

2020-02-17 Thread Ian Dunn
branch: master
commit 9d26430eeea173bb487dba20d3d0d82ec5ae0502
Author: Ian D 
Commit: Ian D 

Fixed copyright strings.
---
 org-edna.el | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/org-edna.el b/org-edna.el
index e0d3cc0..d11f5de 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -1,6 +1,6 @@
 ;;; org-edna.el --- Extensible Dependencies 'N' Actions -*- lexical-binding: 
t; -*-
 
-;; Copyright (C) 2017 Ian Dunn
+;; Copyright (C) 2017 Free Software Foundation, Inc.
 
 ;; Author: Ian Dunn 
 ;; Maintainer: Ian Dunn 
@@ -9,7 +9,7 @@
 ;; Package-Requires: ((emacs "25.1") (seq "2.19") (org "9.0.5"))
 ;; Version: 1.0alpha1
 
-;; This file is NOT part of GNU Emacs.
+;; This file is part of GNU Emacs.
 
 ;; This program is free software; you can redistribute it and/or modify it 
under
 ;; the terms of the GNU General Public License as published by the Free 
Software



[elpa] master 30fc4cd 023/135: Created finders for compatibility with org-depend

2020-02-17 Thread Ian Dunn
branch: master
commit 30fc4cdb2c87dc11e801daf73ae3a099c53a4836
Author: Ian D 
Commit: Ian D 

Created finders for compatibility with org-depend

* org-edna.el (org-edna-finder/siblings-wrap):
  (org-edna-finder/rest-of-siblings): New functions
  (org-edna-finder/chain-find): Finder for org-depend's chain-find-next
---
 org-edna.el | 80 +
 1 file changed, 80 insertions(+)

diff --git a/org-edna.el b/org-edna.el
index 720db92..0c00145 100644
--- a/org-edna.el
+++ b/org-edna.el
@@ -237,6 +237,32 @@ IDS are all UUIDs as understood by `org-id-find'."
  (push (point-marker) markers)))
  (nreverse markers
 
+(defun org-edna-finder/siblings-wrap ()
+  (org-with-wide-buffer
+   (let ((self (and (ignore-errors (org-back-to-heading t)) (point)))
+ (markers))
+ ;; Go from this heading to the end
+ (while (org-get-next-sibling)
+   (unless (equal (point) self)
+ (push (point-marker) markers)))
+ ;; Go to the first heading
+ (org-up-heading-safe)
+ (org-goto-first-child)
+ (while (not (equal (point) self))
+   (push (point-marker) markers)
+   (org-get-next-sibling))
+ (nreverse markers
+
+(defun org-edna-finder/rest-of-siblings ()
+  (org-with-wide-buffer
+   (let ((self (and (ignore-errors (org-back-to-heading t)) (point)))
+ (markers))
+ ;; Go from this heading to the end
+ (while (org-get-next-sibling)
+   (unless (equal (point) self)
+ (push (point-marker) markers)))
+ (nreverse markers
+
 (defun org-edna-finder/next-sibling ()
   (org-with-wide-buffer
(and (org-get-next-sibling)
@@ -295,6 +321,60 @@ IDS are all UUIDs as understood by `org-id-find'."
   (with-current-buffer (find-file-noselect (expand-file-name file 
org-directory))
 (list (point-min-marker
 
+(defun org-edna-finder/chain-find ( options)
+  ;; sortfun - function to use to sort elements
+  ;; filterufn - Function to use to filter elements
+  ;; Both should handle positioning point
+  (let (targets sortfun filterfun)
+(dolist (opt options)
+  (pcase (intern opt)
+('from-top
+ (setq targets (org-edna-finder/siblings)))
+('from-bottom
+ (setq targets (seq-reverse (org-edna-finder/siblings
+('from-current
+ (setq targets (org-edna-finder/siblings-wrap)))
+('no-wrap
+ (setq targets (org-edna-finder/rest-of-siblings)))
+('todo-only
+ (setq filterfun
+   (lambda (target)
+ (org-entry-get target "TODO"
+('todo-and-done-only
+ (setq filterfun
+   (lambda (target)
+ (member (org-entry-get target "TODO") org-done-keywords
+('priority-up
+ (setq sortfun
+   (lambda (lhs rhs)
+ (let ((priority-lhs (org-entry-get lhs "PRIORITY"))
+   (priority-rhs (org-entry-get rhs "PRIORITY")))
+   (not (string-lessp priority-lhs priority-rhs))
+('priority-down
+ (setq sortfun
+   (lambda (lhs rhs)
+ (let ((priority-lhs (org-entry-get lhs "PRIORITY"))
+   (priority-rhs (org-entry-get rhs "PRIORITY")))
+   (string-lessp priority-lhs priority-rhs)
+('effort-up
+ (setq sortfun
+   (lambda (lhs rhs)
+ (let ((effort-lhs (org-duration-to-minutes (org-entry-get lhs 
"EFFORT")))
+   (effort-rhs (org-duration-to-minutes (org-entry-get rhs 
"EFFORT"
+   (not (< effort-lhs effort-rhs))
+('effort-down
+ (setq sortfun
+   (lambda (lhs rhs)
+ (let ((effort-lhs (org-duration-to-minutes (org-entry-get lhs 
"EFFORT")))
+   (effort-rhs (org-duration-to-minutes (org-entry-get rhs 
"EFFORT"
+   (< effort-lhs effort-rhs)))
+(when (and targets sortfun)
+  (setq targets (seq-sort sortfun targets)))
+(when (and targets filterfun)
+  (setq targets (seq-filter filterfun targets)))
+(when targets
+  (seq-elt 0 targets
+
 
 
 ;; Set TODO state



[elpa] master ad75461 017/135: Use existing org-xor instead of new function

2020-02-17 Thread Ian Dunn
branch: master
commit ad75461e957ffe427d2c87cc49cb1cbcd13200bd
Author: Ian D 
Commit: Ian D 

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
 
 



[elpa] master 029bc2e 012/135: Cleaned up condition handling

2020-02-17 Thread Ian Dunn
branch: master
commit 029bc2e8fc6a5b91aaae798acfc514b718d542a0
Author: Ian D 
Commit: Ian D 

Cleaned up condition handling

* org-bat.el (org-bat--handle-condition): New function.
  (org-bat-process-form): Use it.
---
 org-bat.el | 37 +
 1 file changed, 17 insertions(+), 20 deletions(-)

diff --git a/org-bat.el b/org-bat.el
index d360732..41c7627 100644
--- a/org-bat.el
+++ b/org-bat.el
@@ -71,6 +71,17 @@
   org-bat--types)))
(cons new-sym (intern (format func-format new-sym)))
 
+(defun org-bat--handle-condition (func mod args targets consideration)
+  ;; Check the condition at each target
+  (when-let ((blocks
+  (mapcar
+   (lambda (entry-marker)
+ (org-with-point-at entry-marker
+   (apply func mod args)))
+   targets)))
+;; Apply consideration
+(org-bat-handle-consideration consideration blocks)))
+
 (defun org-bat-process-form (form action-or-condition)
   (let ((targets)
 (blocking-entry)
@@ -108,17 +119,9 @@
(unless targets
  (message "Warning: Condition specified without targets"))
(setq state 'condition)
-   (unless blocking-entry ;; We're already blocking
- ;; Check the condition at each target
- (when-let ((blocks
- (mapcar
-  (lambda (entry-marker)
-(org-with-point-at entry-marker
-  (apply func mod args)))
-  targets)))
-   ;; Apply consideration
-   (setq blocking-entry
- (org-bat-handle-consideration consideration blocks)
+   (setq blocking-entry
+ (or blocking-entry  ;; We're already blocking
+ (org-bat--handle-condition func mod args targets 
consideration
   ('consideration
;; Consideration must be at the start of the targets, so clear out
;; any old targets.
@@ -130,15 +133,9 @@
 (when (and (eq action-or-condition 'condition) ;; Looking for conditions
(eq state 'finder)  ;; but haven't found any
(not blocking-entry)) ;; ever
-  (when-let ((blocks
-  (mapcar
-   (lambda (entry-marker)
- (org-with-point-at entry-marker
-   (org-bat-condition/done t)))
-   targets)))
-;; Apply consideration
-(setq blocking-entry
-  (org-bat-handle-consideration consideration blocks
+  (setq blocking-entry
+(org-bat--handle-condition 'org-bat-condition/done
+   t nil targets consideration)))
 ;; Only blockers care about the return value, and this will be non-nil if
 ;; the entry should be blocked.
 (setq org-block-entry-blocking blocking-entry)



  1   2   3   4   5   6   >