Hello,

I don't have good elisp skills, but the following might give you an idea how to start:

(defun org-todo-recursive (element-at-point)
  (interactive
    (let (element-at-point)
      (forward-char) ;to make sure you have item (no plain-list)                                                                              
      (setq element-at-point (org-element-at-point))
      (list element-at-point)))

  (if (eq 'headline (org-element-type element-at-point))
      (progn    ; then                                                                                                                        
        (narrow-to-region
         (org-element-property ':begin element-at-point)
         (org-element-property ':end elemen-at-point))
        (setq headline-content-list
              (cdr (car (org-element-contents
                    (org-element-parse-buffer)))))
        ;; Need to use cdr, as first thing in list is a plist with properties
        ;; Need to use car, as 'contents' is between an extra pair of brackets                                                                
        ;; Now you got a list with org-elements of form                                                                                          
        ;; ((section (...))(headline (...))(headline (...)))                                                                                 
        ;; Perhaps run over them in a while loop, if type is headline, then (org-element-put-property current ':todo-keyword ...)             
        (while (not (eq <lenghth of list> 0))
          ((setq current (car (headline-content-list)))
           (setq headline-content-list (cdr (headline-content-list)))
           (if (eq 'headline (org-element-type current))
               (let ((todo-keyword (org-element-property
                                    ':todo-keyword current)))
                 (<Change the property depending on current state>)
        )
      (message "Must be on heading")) ;else   


Have fun,
Dieter                                                                                       




On Sun, Jan 18, 2015 at 10:49 AM, David Arroyo Menendez <davidam@gnu.org> wrote:
Rasmus <rasmus@gmx.us> writes:

> Hi,
>
> davidam@es.gnu.org (David Arroyo Menéndez) writes:
>
>> How can I do a org-todo-recursive? The idea is replace TODO by DONE in
>> a tree. Someone with a snippet?
>
> Does org-depend.el do what you need?  [Your message is not very clear]
>
> Cheers,
> Rasmuse

I'm not an user of org-depend.el, but from my point of view, org-depend
is for triggers, I want make a request to a full subtree in org, not triggers.

Cheers.




--
gtz,
Dieter VE