Browse Source

Dependencies: Key bindings and Menu entries

This commit adds a key (`C-c C-x o') to toggle the ORDERED property of
a tree.  And it adds menu entries for doing this, which also reflect
the current state of the tree.
Carsten Dominik 17 years ago
parent
commit
e793fd8831
4 changed files with 38 additions and 0 deletions
  1. 3 0
      ORGWEBPAGE/Changes.org
  2. 6 0
      doc/org.texi
  3. 6 0
      lisp/ChangeLog
  4. 23 0
      lisp/org.el

+ 3 - 0
ORGWEBPAGE/Changes.org

@@ -48,6 +48,9 @@ DONE.  Here is an example:
 ,** TODO c, needs to wait for (a) and (b)
 ,** TODO c, needs to wait for (a) and (b)
 #+end_src
 #+end_src
 
 
+The command =C-c C-x o= toggles the value of the =ORDERED=
+property.
+
 The variable =org-agenda-dim-blocked-tasks= controls how blocked
 The variable =org-agenda-dim-blocked-tasks= controls how blocked
 entries should appear in the agenda, where they can be dimmed or
 entries should appear in the agenda, where they can be dimmed or
 even made invisible.
 even made invisible.

+ 6 - 0
doc/org.texi

@@ -3335,6 +3335,12 @@ blocked until all earlier siblings are marked DONE.  Here is an example:
 ** TODO c, needs to wait for (a) and (b)
 ** TODO c, needs to wait for (a) and (b)
 @end example
 @end example
 
 
+@table @kbd
+@kindex C-c C-x o
+@item C-c C-x o
+Toggle the @code{ORDERED} property of the current entry.
+@end table
+
 If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
 If you set the variable @code{org-agenda-dim-blocked-tasks}, TODO entries
 that cannot be closed because of such dependencies will be shown in a dimmed
 that cannot be closed because of such dependencies will be shown in a dimmed
 font or even made invisible in agenda views (@pxref{Agenda Views}).
 font or even made invisible in agenda views (@pxref{Agenda Views}).

+ 6 - 0
lisp/ChangeLog

@@ -1,3 +1,9 @@
+2009-01-29  Carsten Dominik  <carsten.dominik@gmail.com>
+
+	* org.el (org-toggle-ordered-property): New function.
+	(org-mode-map): Add a key for `org-toggle-ordered-property'.
+	(org-org-menu): Add menu entries for TODO dependencies.
+
 2009-01-28  Carsten Dominik  <carsten.dominik@gmail.com>
 2009-01-28  Carsten Dominik  <carsten.dominik@gmail.com>
 
 
 	* org.el (org-default-properties): Add ORDERED to the default
 	* org.el (org-default-properties): Add ORDERED to the default

+ 23 - 0
lisp/org.el

@@ -8561,6 +8561,18 @@ changes.  Such blocking occurs when:
 		    (throw 'dont-block nil)))))))
 		    (throw 'dont-block nil)))))))
     t))					; don't block
     t))					; don't block
 
 
+(defun org-toggle-ordered-property ()
+  "Toggle the ORDERED property of the current entry."
+  (interactive)
+  (save-excursion
+    (org-back-to-heading)
+    (if (org-entry-get nil "ORDERED")
+	(progn
+	  (org-delete-property "ORDERED")
+	  (message "Subtasks can be completed in arbitrary order or parallel"))
+      (org-entry-put nil "ORDERED" "t")
+      (message "Subtasks must be completed in sequence"))))
+
 (defun org-update-parent-todo-statistics ()
 (defun org-update-parent-todo-statistics ()
   "Update any statistics cookie in the parent of the current headline."
   "Update any statistics cookie in the parent of the current headline."
   (interactive)
   (interactive)
@@ -12876,6 +12888,7 @@ The images can be removed again with \\[org-ctrl-c-ctrl-c]."
 (org-defkey org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
 (org-defkey org-mode-map "\C-c\C-x\C-l" 'org-preview-latex-fragment)
 (org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
 (org-defkey org-mode-map "\C-c\C-x\C-b" 'org-toggle-checkbox)
 (org-defkey org-mode-map "\C-c\C-xp"    'org-set-property)
 (org-defkey org-mode-map "\C-c\C-xp"    'org-set-property)
+(org-defkey org-mode-map "\C-c\C-xo"    'org-toggle-ordered-property)
 (org-defkey org-mode-map "\C-c\C-xi"    'org-insert-columns-dblock)
 (org-defkey org-mode-map "\C-c\C-xi"    'org-insert-columns-dblock)
 
 
 (org-defkey org-mode-map "\C-c\C-x."    'org-timer)
 (org-defkey org-mode-map "\C-c\C-x."    'org-timer)
@@ -13715,6 +13728,16 @@ See the individual commands for more information."
      ["Show TODO Tree" org-show-todo-tree t]
      ["Show TODO Tree" org-show-todo-tree t]
      ["Global TODO list" org-todo-list t]
      ["Global TODO list" org-todo-list t]
      "--"
      "--"
+     ["Enforce dependencies" (customize-variable 'org-enforce-todo-dependencies)
+      :selected org-enforce-todo-dependencies :style toggle :active t]
+     "Settings for tree at point"
+     ["Do Children sequentially" org-toggle-ordered-property :style radio
+      :selected (ignore-errors (org-entry-get nil "ORDERED"))
+      :active org-enforce-todo-dependencies :keys "C-c C-x o"]
+     ["Do Children parallel" org-toggle-ordered-property :style radio
+      :selected (ignore-errors (not (org-entry-get nil "ORDERED")))
+      :active org-enforce-todo-dependencies :keys "C-c C-x o"]
+     "--"
      ["Set Priority" org-priority t]
      ["Set Priority" org-priority t]
      ["Priority Up" org-shiftup t]
      ["Priority Up" org-shiftup t]
      ["Priority Down" org-shiftdown t])
      ["Priority Down" org-shiftdown t])