summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarsten Dominik <carsten.dominik@gmail.com>2010-06-25 09:00:19 +0200
committerCarsten Dominik <carsten.dominik@gmail.com>2010-06-25 09:01:40 +0200
commita547c1048b6a195fb4d3ae79697753b3e69e3398 (patch)
treef27bc94acd99e9b6edaa98efeb5589eca34438a6
parent732884dbeb1a0f939b6f436a9d2bab9dcc9e3f8e (diff)
downloadorg-mode-a547c1048b6a195fb4d3ae79697753b3e69e3398.tar.gz
Fix issue with turning off ORDERED property
* lisp/org-macs.el (org-not-nil): New function. * lisp/org.el (org-block-todo-from-children-or-siblings-or-parent): Use `org-not-nil' to interpret a property value of nil. Robert Goldman writes: > I have found what I believe to be a bug in handling ordered subtasks. > Here is the behavior: > > I have a top level set of tasks that is ordered. > > One of the outline items below the top level set is a grab bag of tasks > that will be performed in parallel. So this task is NOT ordered > (ORDERED: nil). > > The problem is that the blocking behavior from ordered tasks seems to be > inherited from the top level task list into the second level of the > outline, even though the ORDERED property at the second level is > explicitly overridden. > > I am attaching an org file that displays this issue. To see the > problem, put your cursor on the "Bar" task and attempt to change its > status to DONE. The problem was here that the value of the property is the string "nil", which is of course not nil. This patches introduces a special case to interpret "nil" as nil.
-rw-r--r--lisp/org-macs.el4
-rw-r--r--lisp/org.el4
2 files changed, 6 insertions, 2 deletions
diff --git a/lisp/org-macs.el b/lisp/org-macs.el
index 65a8647..ad1fab5 100644
--- a/lisp/org-macs.el
+++ b/lisp/org-macs.el
@@ -43,6 +43,10 @@
"Return the value of symbol VAR if it is bound, else nil."
`(and (boundp (quote ,var)) ,var))
+(defun org-not-nil (v)
+ "Is V not nil, and also not the string \"nil\"?"
+ (and v (not (equal v "nil"))))
+
(defmacro org-unmodified (&rest body)
"Execute body without changing `buffer-modified-p'.
Also, do not record undo information."
diff --git a/lisp/org.el b/lisp/org.el
index 21a1467..7bb4f45 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -10881,7 +10881,7 @@ changes. Such blocking occurs when:
(let* ((pos (point))
(parent-pos (and (org-up-heading-safe) (point))))
(if (not parent-pos) (throw 'dont-block t)) ; no parent
- (when (and (org-entry-get (point) "ORDERED")
+ (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
(forward-line 1)
(re-search-forward org-not-done-heading-regexp pos t))
(throw 'dont-block nil)) ; block, there is an older sibling not done.
@@ -10893,7 +10893,7 @@ changes. Such blocking occurs when:
(setq pos (point))
(setq parent-pos (and (org-up-heading-safe) (point)))
(if (not parent-pos) (throw 'dont-block t)) ; no parent
- (when (and (org-entry-get (point) "ORDERED")
+ (when (and (org-not-nil (org-entry-get (point) "ORDERED"))
(forward-line 1)
(re-search-forward org-not-done-heading-regexp pos t))
(throw 'dont-block nil)))))))) ; block, older sibling not done.