diff options
author | Carsten Dominik <carsten.dominik@gmail.com> | 2010-08-11 11:16:11 +0200 |
---|---|---|
committer | Carsten Dominik <carsten.dominik@gmail.com> | 2010-08-11 11:16:11 +0200 |
commit | 2f9d0956176bb4e155c6d51a94f745c30f82f556 (patch) | |
tree | 27e846a83b2b7989985699a8a0e1d8b78cfc818e | |
parent | 0633c6aa094ac77df1981e21a1cd863f1138b01f (diff) | |
download | org-mode-2f9d0956176bb4e155c6d51a94f745c30f82f556.tar.gz |
org-depend: Fix blocking logic
* contrib/lisp/org-depend.el (org-depend-block-todo): Fix blocking logic.
Paul Sexton writes:
> The value returned by org-depend-block-todo determines whether an item
> is considered "blocked", and thus whether it is shown dimmed (because
> this function is added to org-blocker-hook).
>
> o-d-b-t only returns true in a very limited set of conditions, so very
> often items which should show up as blocked, do not. To be honest I
> don't remember the exact details, but it did not work before I applied
> the patch, and has worked correctly ever since.
-rw-r--r-- | contrib/lisp/org-depend.el | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/contrib/lisp/org-depend.el b/contrib/lisp/org-depend.el index eb38aa0..089a6a0 100644 --- a/contrib/lisp/org-depend.el +++ b/contrib/lisp/org-depend.el @@ -224,12 +224,13 @@ this ID property, that entry is also checked." blocker blockers bl p1 (proceed-p (catch 'return - (unless (eq type 'todo-state-change) - ;; We are not handling this kind of change - (throw 'return t)) - (unless (and (not from) (member to org-not-done-keywords)) - ;; This is not a change from nothing to TODO, ignore it - (throw 'return t)) + ;; If this is not a todo state change, or if this entry is + ;; DONE, do not block + (when (or (not (eq type 'todo-state-change)) + (member from (cons 'done org-done-keywords)) + (member to (cons 'todo org-not-done-keywords)) + (not to)) + (throw 'return t)) ;; OK, the plan is to switch from nothing to TODO ;; Lets see if we will allow it. Find the BLOCKER property |