From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id gDfGNn/9k2AIfQAAgWs5BA (envelope-from ) for ; Thu, 06 May 2021 16:30:23 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id OMZgMn/9k2BBEwAAbx9fmQ (envelope-from ) for ; Thu, 06 May 2021 14:30:23 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 398C41FB92 for ; Thu, 6 May 2021 16:30:23 +0200 (CEST) Received: from localhost ([::1]:48442 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lef1C-0004UC-1E for larch@yhetil.org; Thu, 06 May 2021 10:30:22 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:42226) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1leevJ-0006vF-SW for emacs-orgmode@gnu.org; Thu, 06 May 2021 10:24:18 -0400 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]:37752) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1leevH-000235-Po for emacs-orgmode@gnu.org; Thu, 06 May 2021 10:24:17 -0400 Received: by mail-wm1-x32e.google.com with SMTP id b11-20020a7bc24b0000b0290148da0694ffso5415818wmj.2 for ; Thu, 06 May 2021 07:24:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=acLalIGNaSD6riUWNvAj5k+MGtg3YWhOaYyVxwf3pBo=; b=q7QbFm08NfUlWFzxwPe2CMBtNF7T6aWFvqeGyC4/KcnZmCr12R2UUEwa01dHnoE42k 5HyDFNkLXI5K3YL/jpl4+6mzQIAD0adf9hkpZZUeeB55c9J1hZRtPXn8mGRr2BoVEOn0 EeLzKvFM3nKXPK9uoupFMka1qsys805vYMT7UmFuNoeQhTm8GVWic+zDcHnp8KDQJkNO PcQnltNPTcZ0MsmtMDAqV+J3AP/Q27KsVQHIK6Wafs1Dl1e/iWV3oNdHpG9TiRTaqp+n g0FzLn4NKCSsJS+I/n66ejdLvmPxciQ0PuHYIUSYGkjaNWfzpWmN0P0v9TGko0MFqL36 vsOg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=acLalIGNaSD6riUWNvAj5k+MGtg3YWhOaYyVxwf3pBo=; b=bpvI130SX/NzI5KvQGZCyAbtCvj1TV2aawlNVJlqPBEkndjH+tSxzT+d/JCIdrfBt0 5nuY77xsFxaNdkS9/L7fVrf5V5hRowZwDPQ0W8gZ5fY5dSUh8zizz8CbgazZn5KBfztY VsRNZKGoVjl6ChT+yi6fiV2tUgSUCXuJUKphb8IMNs3fbfCsY+NZsGYa8bphoK2iinib 9aDyfWZmxV4d0WOZ26kvcR5EfwUM0cMK9QDO83lOHw5wWuKbP2hKB++XqeZOAfrtkyP8 rUY/Lir/ARuKrGJGMrwKOBHQPcejefIzQqzK908pIhLCtX/kDtBtT5p7xvI0UMb0EH7V WyoQ== X-Gm-Message-State: AOAM53166MuV92pjgXWasNKu9aJvt+KSCGB6TP9cFdeENHSeShYLTKer 7Lm+8cKT/KHxHgvQiUA0yCYV0xgGHwg3riXNvTUxkwFyLv6Iow== X-Google-Smtp-Source: ABdhPJzF0kEgEAnk7gHpppuPtUFu2sy7Vg1VuGR8wdrUJCnPxZaXo8t0DVKAt9iaVkTN8eyU8RmpzSnDUJviGUupGJw= X-Received: by 2002:a7b:c34a:: with SMTP id l10mr4346537wmj.46.1620311053510; Thu, 06 May 2021 07:24:13 -0700 (PDT) MIME-Version: 1.0 From: Tim Visher Date: Thu, 6 May 2021 10:23:37 -0400 Message-ID: Subject: Refiling All 'Terminal TODO State' Entries to a Particular Heading To: Emacs Org Mode mailing list Content-Type: multipart/alternative; boundary="000000000000c52b4e05c1aa1002" Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=tim.visher@gmail.com; helo=mail-wm1-x32e.google.com X-Spam_score_int: -3 X-Spam_score: -0.4 X-Spam_bar: / X-Spam_report: (-0.4 / 5.0 requ) BAYES_05=-0.5, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, HTML_OBFUSCATE_05_10=0.26, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-orgmode@gnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1620311423; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=acLalIGNaSD6riUWNvAj5k+MGtg3YWhOaYyVxwf3pBo=; b=miO+EDPOE8Rg3aTF0RZLhXmzzD1ApSsNhjfs8YKtVQ4HaVSvJYUFVx5DyU10bGpDd8MgCn 7cJ0jvcjx78hhGAz/HCCtvAR3m6Txumeo9lNQYTahoCBP5SylDQke5ml6UA2BxkcW4Y/mP 5oEK33/++TSgZOoQ5Vib+twrmD7R+qVhhw7le9ehE82pHVlZdWewd8erFLbS+/IdzvVHP7 k4TTxx7rVhzNTAF/V7NtYlKtgQWrvyhGS2dKJc83y9Ins9H0hwm1EHGnT5exMi1b/TA7mF yTqtJ8bzaecv97Wzr/DOXfkHKPv2o00wrzc8f/1m/zJPYCl96ozCP1YTlvW/0w== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1620311423; a=rsa-sha256; cv=none; b=rpKyikuMFzVsfMgrkCzGv5ZklIS8UBveDzeE9VDBLbkPfRkh/54v+lZO+W5Qdvj0S+KcMJ xFtsVoRZGcA/T65uAv3uGM4O3VrfWEyi6NXdyaxOV/hYnh0HWbv8ctNGPeVNGlTtMqGh7Y bnSpKpueQ9EjKk3+hFzVqFrQ2ee8RXBlEJlO++uaGNJVeB9sg52xpxoB6kE7DXrG0GtNmx G7DlnPSVXqEIGjex5BskXnbckvwtztGW+q6YEm/5iAcNkCGPhmoOHIxa+rv/pA3ebQnZ68 9TvXRueI7It+yUBzDe6dmEwR6P+H2htfoHSsKwwkjSjdpBhLheEgZ6NLueMG7g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=q7QbFm08; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Spam-Score: -1.66 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=q7QbFm08; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (aspmx1.migadu.com: domain of emacs-orgmode-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=emacs-orgmode-bounces@gnu.org X-Migadu-Queue-Id: 398C41FB92 X-Spam-Score: -1.66 X-Migadu-Scanner: scn0.migadu.com X-TUID: WjdVuWF9Gidk --000000000000c52b4e05c1aa1002 Content-Type: text/plain; charset="UTF-8" Hi Everyone, Partly because I think it's neat and partly to ask for ways that I could improve it I figured I'd share my latest little snippet of org elisp with the list. I maintain my primary TODO list as an org file with top-level headings like * This Week, * Delegated, * Scheduled, * Deferred, etc. These all contain TODOs or potential TODOs. Anything I intend to work on near term I refile into * This Week and that's then the primary heading that I'm burning down throughout my day. I do weekly reflection/projections and 6 week reflection/projections. When I do a weekly reflection I go through another heading * Done to remind myself what I accomplished in the past week. When I do a 6 week reflection/projection I review the Done heading one more time and then I refile all the entries currently there into an * Archive heading. Then every now and then I actually archive entries in Archive into an *.org_archive file. * Done and * Archive are both tagged with ARCHIVE. In an effort to start automating some of this effort I wrote the following elisp to refile all the Level 2 entries to the Done heading: (defun timvisher-org-refile-done-entry-position () (save-excursion (goto-char (point-min)) (re-search-forward "^\\* Done"))) (defun timvisher-org-refile-done-entry () (org-refile nil (current-buffer) (list "* Done" (buffer-file-name) nil (timvisher-org-refile-done-entry-position)))) (defun timvisher-org-refile-done-entries () (interactive) (length (org-map-entries #'timvisher-org-refile-done-entry "LEVEL=2/+DONE|+CANCELLED" nil 'archive))) I'm doing Level 2 only because for long running projects I tend to have a single Level 2 heading with many subheadings representing the project's breakdown and I don't want them to be refiled out of the project. Opportunities for improvement would be: 1. Is there a better way to find the * Done entry than searching for it every time? 2. Am I using org-refile correctly there? It's functional but it also seems needlessly complicated. Hope this finds you all well. :) -- In Christ, Timmy V. https://blog.twonegatives.com http://five.sentenc.es --000000000000c52b4e05c1aa1002 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable

Hi Ev= eryone,

Partly beca= use I think it's neat and partly to ask for ways that I could improve i= t I figured I'd share my latest little snippet of org elisp with the li= st.

I maintain my p= rimary TODO list as an org file with top-level headings like=C2=A0* T= his Week,=C2=A0* Delegated,=C2=A0* Scheduled,=C2=A0* Deferred, etc. These all contain TODOs or potential= TODOs.

Anything I = intend to work on near term I refile into=C2=A0* This Week=C2= =A0and that's then the primary heading that I'm burning down throug= hout my day.

I do w= eekly reflection/projections and 6 week reflection/projections. When I do a= weekly reflection I go through another heading=C2=A0* Done=C2= =A0to remind myself what I accomplished in the past week. When I do a 6 wee= k reflection/projection I review the Done heading one more time and then I = refile all the entries currently there into an=C2=A0* Archive= =C2=A0heading. Then every now and then I actually archive entries in=C2=A0<= code>Archive=C2=A0into an=C2=A0*.org_archive=C2=A0file.= =C2=A0* Done=C2=A0and=C2=A0* Archive=C2=A0are bot= h tagged with=C2=A0ARCHIVE.

In an effort to start automating some of this effort = I wrote the following elisp to refile all the Level 2 entries to the Done h= eading:

(defun timvisher-org-refile-done-entry-position
    ()
  (save-excursion
    (goto-char (point-min))
    (re-search-forward "^\\* Done=
")))

(defun timvisher-org-refile-done-entry
    ()
  (org-refile nil
              (current-buffer)
              (list "* Done"=

                    (buffer-file-name)
                    nil
                    (timvisher-org-refile-done-entry-position))))

(defun timvisher-org-refile-done-entries
    ()
  (interactive)
  (length
   (org-map-entries #'timvisher-org-refile-done-entry
                    "LEVEL=3D2/+D=
ONE|+CANCELLED"
                    nil
                    'archive)))

I'm do= ing Level 2 only because for long running projects I tend to have a single = Level 2 heading with many subheadings representing the project's breakd= own and I don't want them to be refiled out of the project.

Opportunities for improvement = would be:

  1. Is there a better way to find the=C2=A0* Done=C2=A0entry than searching for it every time?
  2. Am I using=C2=A0org-refile=C2=A0correctly there? It's functional but it also = seems needlessly complicated.

Hope this finds you all well. :)

--

In Christ,

Timmy V.

= https://blog.twonegatives.com=
http://five.sentenc.es

--000000000000c52b4e05c1aa1002--