Commit d4bbb0d7baf4

Vincent Demeester <vincent@sbr.pm>
2017-08-06 14:12:10
Fix org-summary-todo to only update todo state if state present
Signed-off-by: Vincent Demeester <vincent@sbr.pm>
1 parent 735d384
Changed files (2)
.emacs.d/emacs.el
@@ -943,7 +943,9 @@ point reaches the beginning or end of the buffer, stop there."
 (defun org-summary-todo (n-done n-not-done)
   "Switch entry to DONE when all subentries are done, to PROGRESS otherwise."
   (let (org-log-done org-log-states)   ; turn off logging
-    (org-todo (if (= n-not-done 0) "DONE" "PROGRESS"))))
+    (if (not (string-blank-p (org-get-todo-state)))
+        (org-todo (if (= n-not-done 0) "DONE" "PROGRESS")))
+    ))
 
 (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
 
.emacs.d/emacs.org
@@ -1811,7 +1811,9 @@
      (defun org-summary-todo (n-done n-not-done)
        "Switch entry to DONE when all subentries are done, to PROGRESS otherwise."
        (let (org-log-done org-log-states)   ; turn off logging
-         (org-todo (if (= n-not-done 0) "DONE" "PROGRESS"))))
+         (if (not (string-blank-p (org-get-todo-state)))
+             (org-todo (if (= n-not-done 0) "DONE" "PROGRESS")))
+         ))
 
      (add-hook 'org-after-todo-statistics-hook 'org-summary-todo)
    #+END_SRC