emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Dieter Van Eessen <dieter.van.eessen@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Re: org-todo-recursive
Date: Mon, 19 Jan 2015 11:17:06 +0100	[thread overview]
Message-ID: <CAC2TPPj-7K7s_4FWV74W2pCUMb0yrgrPi8doHBZpbfS=JNFg4w@mail.gmail.com> (raw)
In-Reply-To: <ysufvb8ifku.fsf@fencepost.gnu.org>

[-- 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 --]

      parent reply	other threads:[~2015-01-19 10:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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     ` Dieter Van Eessen [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAC2TPPj-7K7s_4FWV74W2pCUMb0yrgrPi8doHBZpbfS=JNFg4w@mail.gmail.com' \
    --to=dieter.van.eessen@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).