From mboxrd@z Thu Jan 1 00:00:00 1970 From: Dieter Van Eessen Subject: Re: org-todo-recursive Date: Mon, 19 Jan 2015 11:17:06 +0100 Message-ID: References: <87h9vpbp05.fsf@gmx.us> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a1133d978d377e6050cfe9fbb Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:59671) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD9OS-0008R6-Ai for emacs-orgmode@gnu.org; Mon, 19 Jan 2015 05:17:13 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YD9OQ-0003rr-WD for emacs-orgmode@gnu.org; Mon, 19 Jan 2015 05:17:12 -0500 Received: from mail-yk0-x230.google.com ([2607:f8b0:4002:c07::230]:45721) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YD9OQ-0003qd-0O for emacs-orgmode@gnu.org; Mon, 19 Jan 2015 05:17:10 -0500 Received: by mail-yk0-f176.google.com with SMTP id 20so2333082yks.7 for ; Mon, 19 Jan 2015 02:17:06 -0800 (PST) In-Reply-To: List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a1133d978d377e6050cfe9fbb Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 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))) () ) (message "Must be on heading")) ;else Have fun, Dieter On Sun, Jan 18, 2015 at 10:49 AM, David Arroyo Menendez wrote: > Rasmus writes: > > > Hi, > > > > davidam@es.gnu.org (David Arroyo Men=C3=A9ndez) 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. > > --=20 gtz, Dieter VE --001a1133d978d377e6050cfe9fbb Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: base64 PGRpdiBkaXI9Imx0ciI+PGRpdj48ZGl2PkhlbGxvLDxicj48YnI+PC9kaXY+SSBkb24mIzM5O3Qg aGF2ZSBnb29kIGVsaXNwIHNraWxscywgYnV0IHRoZSBmb2xsb3dpbmcgbWlnaHQgZ2l2ZSB5b3Ug YW4gaWRlYSBob3cgdG8gc3RhcnQ6PGJyPjxicj4oZGVmdW4gb3JnLXRvZG8tcmVjdXJzaXZlIChl bGVtZW50LWF0LXBvaW50KTxicj7CoCAoaW50ZXJhY3RpdmU8YnI+wqDCoMKgIChsZXQgKGVsZW1l bnQtYXQtcG9pbnQpPGJyPsKgwqDCoMKgwqAgKGZvcndhcmQtY2hhcikgO3RvIG1ha2Ugc3VyZSB5 b3UgaGF2ZSBpdGVtIChubyBwbGFpbi1saXN0KcKgwqDCoMKgwqDCoMKgwqDCoMKgwqDCoMKgwqDC oMKgwqDCoMKgwqDCoMKgwqDCoM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