From mboxrd@z Thu Jan 1 00:00:00 1970 From: mediapathic steen Subject: Need help understanding how to limit a function to a tree Date: Wed, 28 Feb 2018 16:36:26 -0800 Message-ID: Mime-Version: 1.0 (Mac OS X Mail 11.2 \(3445.5.20\)) Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:47629) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1erCD5-0007si-7W for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 19:36:36 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1erCD0-0005CI-BI for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 19:36:35 -0500 Received: from mail-pf0-x229.google.com ([2607:f8b0:400e:c00::229]:45317) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1erCD0-0005Bd-4u for emacs-orgmode@gnu.org; Wed, 28 Feb 2018 19:36:30 -0500 Received: by mail-pf0-x229.google.com with SMTP id h19so844022pfd.12 for ; Wed, 28 Feb 2018 16:36:29 -0800 (PST) Received: from [10.33.74.96] (h-66-134-242-90.snva.ca.globalcapacity.com. [66.134.242.90]) by smtp.gmail.com with ESMTPSA id 10sm4696408pgg.73.2018.02.28.16.36.27 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 28 Feb 2018 16:36:27 -0800 (PST) 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" To: emacs-orgmode@gnu.org I have a subtree that contains a daily list of things to do (which I = keep as TODOs rather than checklist form for more granular time = tracking). I want to reset all of the DONE to TODO every day when I = start it. Right now I have this piece of code I copypasted from = somewhere now lost (possibly this very group): (org-map-entries (lambda () (when (string=3D (nth 2 (org-heading-components)) "DONE") (org-todo "TODO")))) This more or less makes sense to me. I have this code sitting in the = subtree, and in order to do my daily reset, I edit the subtree in an = indirect buffer, eval-region the code, then kill the buffer.=20 What I would like to accomplish:=20 1) Can you help me understand how to modify this code so that it only = applies to the subtree it's run in (parents also would be fine in this = case but not necessary and seems more of a challenge)? Doing the = indirect buffer thing seems more hassle than is reasonable.=20 2) I think I understand how to put this in my init in such a way that I = can C-x invoke it, rather than having to eval-region it, but I'm not = certain. Can you point me toward a reasonable tutorial or hints on how = to do that in general? Thanks in advance, -- Steen=