1
0
mirror of https://git.savannah.gnu.org/git/emacs/org-mode.git synced 2024-11-29 07:58:21 +00:00

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.
This commit is contained in:
Carsten Dominik 2010-06-25 09:00:19 +02:00
parent 732884dbeb
commit a547c1048b
2 changed files with 6 additions and 2 deletions

View File

@ -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."

View File

@ -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.