emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* org-todo-recursive
@ 2015-01-17 10:19 David Arroyo Menéndez
  2015-01-17 11:55 ` org-todo-recursive Rasmus
  0 siblings, 1 reply; 5+ messages in thread
From: David Arroyo Menéndez @ 2015-01-17 10:19 UTC (permalink / raw)
  To: emacs-orgmode


Hello!

How can I do a org-todo-recursive? The idea is replace TODO by DONE in
a tree. Someone with a snippet?

Regards.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-todo-recursive
  2015-01-17 10:19 org-todo-recursive David Arroyo Menéndez
@ 2015-01-17 11:55 ` Rasmus
  2015-01-18  9:49   ` org-todo-recursive David Arroyo Menendez
  0 siblings, 1 reply; 5+ messages in thread
From: Rasmus @ 2015-01-17 11:55 UTC (permalink / raw)
  To: emacs-orgmode

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,
Rasmus

-- 
Governments should be afraid of their people

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-todo-recursive
  2015-01-17 11:55 ` org-todo-recursive Rasmus
@ 2015-01-18  9:49   ` David Arroyo Menendez
  2015-01-18 13:35     ` org-todo-recursive Rasmus
  2015-01-19 10:17     ` org-todo-recursive Dieter Van Eessen
  0 siblings, 2 replies; 5+ messages in thread
From: David Arroyo Menendez @ 2015-01-18  9:49 UTC (permalink / raw)
  To: Rasmus; +Cc: emacs-orgmode

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.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-todo-recursive
  2015-01-18  9:49   ` org-todo-recursive David Arroyo Menendez
@ 2015-01-18 13:35     ` Rasmus
  2015-01-19 10:17     ` org-todo-recursive Dieter Van Eessen
  1 sibling, 0 replies; 5+ messages in thread
From: Rasmus @ 2015-01-18 13:35 UTC (permalink / raw)
  To: davidam; +Cc: emacs-orgmode

Hi David,

David Arroyo Menendez <davidam@gnu.org> 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]
>>
> 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.

Can you give a simple example of what you have got in mind?  Do you want
to change the TODO-state of all subheadings relative to the current heading?

—Rasmus

-- 
Summon the Mothership!

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: org-todo-recursive
  2015-01-18  9:49   ` org-todo-recursive David Arroyo Menendez
  2015-01-18 13:35     ` org-todo-recursive Rasmus
@ 2015-01-19 10:17     ` Dieter Van Eessen
  1 sibling, 0 replies; 5+ messages in thread
From: Dieter Van Eessen @ 2015-01-19 10:17 UTC (permalink / raw)
  To: emacs-orgmode

[-- Attachment #1: Type: text/plain, Size: 2278 bytes --]

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

[-- Attachment #2: Type: text/html, Size: 4306 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2015-01-19 10:17 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-01-17 10:19 org-todo-recursive David Arroyo Menéndez
2015-01-17 11:55 ` org-todo-recursive Rasmus
2015-01-18  9:49   ` org-todo-recursive David Arroyo Menendez
2015-01-18 13:35     ` org-todo-recursive Rasmus
2015-01-19 10:17     ` org-todo-recursive Dieter Van Eessen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).