From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 6LFOAxKRs19BEgAA0tVLHw (envelope-from ) for ; Tue, 17 Nov 2020 09:00:02 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id ILzZOhGRs1/XbwAA1q6Kng (envelope-from ) for ; Tue, 17 Nov 2020 09:00:01 +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 05C6A940538 for ; Tue, 17 Nov 2020 09:00:00 +0000 (UTC) Received: from localhost ([::1]:47320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kewqC-00020A-Mn for larch@yhetil.org; Tue, 17 Nov 2020 03:59:56 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:39500) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kewpB-0001zw-PS for emacs-orgmode@gnu.org; Tue, 17 Nov 2020 03:58:53 -0500 Received: from mail-lj1-x231.google.com ([2a00:1450:4864:20::231]:42363) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kewp8-0007gb-CR for emacs-orgmode@gnu.org; Tue, 17 Nov 2020 03:58:53 -0500 Received: by mail-lj1-x231.google.com with SMTP id p12so23379491ljc.9 for ; Tue, 17 Nov 2020 00:58:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=xaIUpIgllcxlG7D/GDj739MnpQJhzGdjVM9Ga83LjDs=; b=jEWjP2oXwT0hv+Z+RoW5ishomnw0oottXSg+sMd1sGRYIS2pL4uqqZ8xaryzCqaf4b zhzeyZ2mEFYxLL8dBP4cCXRN0HNRiEmiRNa8AiYRuAmNrzhTiYCl176q+6L95g21NPXF J/ljR3+pkw1hw9E4SOMCMnDiYm3IjrOxskHdxZvONjxx+akRSWK3miiYKSHqxqqQ0YFO HYwGsrN6kn9xb2rboiRN+56ROkGxBF0gAMPpf3O4jUk9u/WwrZ7q8RHbW7Cn29HXhzOP 37A9uD4sQ5T5ElQvSyVw6778JkiquoU64wxOjcb742+HkwLgMolxwEVDBfvE0DXxFmxi NSSw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=xaIUpIgllcxlG7D/GDj739MnpQJhzGdjVM9Ga83LjDs=; b=K0i/9RaB8wuv8oY2evFMFZMDMkG5P/3xxYfj4k9ZLliluV/VuxEJYF+X3eUMv7b8ig tGMCOI2DqnAJs/8gjCrNMIQ8Nh745bRsUQhJrHKxTcpFaa6xzbySEFgBQqIHtuGIEVFy rdQb8NvqaTQeuUB5QVf1SloXCPrgmMxvZ5dQMsDmp1BP0q8zH+oS9YlQU/cUSlaFf+lV aQW7jpiQ1z6/U+dPkWezvQEBG+bcK6/9BzNr2dqzte6FmvRPUFGSYUl1bx/eapWGRPo3 HVsQpTtXaCkPeB/bpfGtJfUfSRJHJh7bS+MQlpd1dgAutzMI03B/fFN+tzXbnsvqh5RQ hUKQ== X-Gm-Message-State: AOAM5338u1nTWdJ9IrxoD2F6YEL4mjeWNR1ncba6HDpJyPMbkRgpaNo1 PRNKZfSwVBM098+zfiZmYMqvKpQT8QXBoK6RF0M= X-Google-Smtp-Source: ABdhPJzIRi+sJKu28eC0fft9Yxgur56+eAtqkqqtGrIEjqwlQyeEIwkzB1InvIzFF/RmqR2OsJkmkUDCu02h8jQIMk8= X-Received: by 2002:a2e:9b44:: with SMTP id o4mr1551889ljj.143.1605603528538; Tue, 17 Nov 2020 00:58:48 -0800 (PST) MIME-Version: 1.0 References: <87lffj7zss.fsf@localhost> <87zh3mlvj7.fsf@localhost> In-Reply-To: From: Gerardo Moro Date: Tue, 17 Nov 2020 10:58:37 +0200 Message-ID: Subject: Re: Archiving repeated tasks under corresponding date tree for each repeated item To: Ihor Radchenko Content-Type: multipart/alternative; boundary="000000000000f7fb0c05b449b344" Received-SPF: pass client-ip=2a00:1450:4864:20::231; envelope-from=gerardomoro37@gmail.com; helo=mail-lj1-x231.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -17 X-Spam_score: -1.8 X-Spam_bar: - X-Spam_report: (-1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, HTML_MESSAGE=0.001, 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: , Cc: emacs-orgmode Errors-To: emacs-orgmode-bounces+larch=yhetil.org@gnu.org Sender: "Emacs-orgmode" X-Scanner: ns3122888.ip-94-23-21.eu Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20161025 header.b=jEWjP2oX; 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-Spam-Score: -1.71 X-TUID: ZlPEcfNR97qV --000000000000f7fb0c05b449b344 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi again, I actually now realized that your function will not unfortunately archive each logged item (those located in the logbook) in its corresponding date (!). What it will do is to archive the whole tree under today's date without deleting it from the original org file. For instance, * TODO REPEATED TASK SAMPLE SCHEDULED: <2020-11-30 Mon +20d> :PROPERTIES: :STYLE: habit :LAST_REPEAT: [2020-11-09 Mon 22:28] :END: :LOGBOOK: - State "DONE" from "TODO" [2020-11-15 Sun 22:28] - State "DONE" from "STARTED" [2020-11-14 Sat 22:17] - State "DONE" from "STARTED" [2020-11-13 Fri 22:17] - State "DONE" from "STARTED" [2020-11-11 Wed 22:17] If I position myself in any point in this entry, when I execute the function it will archive the whole tree+subtree under today's date (the date when it was archived). The behaviour I was expecting is to archive each of the logged tasks under their corresponding date (on the 11th, 13th, 14th and 15th of November). Just to be clear :) G El lun., 16 nov. 2020 a las 17:21, Gerardo Moro () escribi=C3=B3: > Wow, I=E2=80=99m impressed by your help, you are very kind! > I am also impressed by your researching skills, I gave a long go at tryin= g > to find some code online unsuccessfully. > > Yes, I agree that the agenda is a nice way to go to visualize my past > events (with v A). > My idea of not relying on the agenda interface is just to be free and hav= e > an archive org file with all my entries, easier to scroll from any device > without the need of Emacs. > > As for the function to archive the individual repeated tasks into their > corresponding tree: > I=E2=80=99m not an emacs lisp programmer (or any kind of!). As I see, thi= s > function works only =E2=80=9Cat point=E2=80=9D. > The way I work is I mark tasks as DONE during a couple weeks, and then I > call this function that tracks all my org file and archives all DONE / > CANCELLED items. > This is great because I don=E2=80=99t have to do it one by one. > > (defun my/org-archive-done-tasks-file () > (interactive) > (org-map-entries > (lambda () > (org-archive-subtree) > (setq org-map-continue-from (outline-previous-heading))) > "TODO=3D\"DONE\"|TODO=3D\"CANCELED\\"" 'file)) > > Do you think there is a way to combine these two functions so that when I > call the fucntion, I get to archive all DONE/CANCELLED & repeated > DONE/CANCELLED tasks (the latter without deleting the logged task or its > respective heading)? > > Best, > G. > > El jue., 12 nov. 2020 a las 12:28, Ihor Radchenko () > escribi=C3=B3: > >> > Hope it is clear now, thanks so much for any help! >> >> Sorry for not making my previous email more clear. I actually understood >> what you want to achieve. My suggestion was rather an alternative >> approach to "revisit the past" - you can always build agenda view for a >> specific date (or range of dates) in the past. That way, you would not >> need to look into archive file manually at all. >> >> On your actual question, I think I found some old reddit comment [1] tha= t >> may be relevant. The code provides a new command to archive an org >> headline without actually deleting it. That way, you will get a copy of >> your headline on the date of archival. Below is the original code with >> me adding docstrings for more clarity. >> >> (defun my/org-archive-delete-logbook () >> "Delete LOGBOOK of the entry at point. It is obsolete once the copy of >> the item is moved to the archive file." >> (save-excursion >> (org-end-of-meta-data) >> (let ((elm (org-element-at-point))) >> (when (and >> (equal (org-element-type elm) 'drawer) >> (equal (org-element-property :drawer-name elm) "LOGBOOK")) >> (delete-region (org-element-property :begin elm) >> (org-element-property :end elm)))))) >> >> (defun my/org-archive-without-delete () >> "Archive item at point, but do not actually delete it." >> (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil))) >> (org-archive-subtree))) >> >> (defun my/org-archive-logbook () >> "Create an archive copy of subtree at point and delete LOGBOOK in the >> first headline of the subtree." >> (interactive) >> (my/org-archive-without-delete) >> (my/org-archive-delete-logbook)) >> >> I think you can modify the last function and call it in >> org-trigger-hook, so that repeating items would be archived without >> deleting every time you mark the item DONE. >> >> [1] >> https://old.reddit.com/r/orgmode/comments/dg43hs/can_i_archive_a_propert= y_drawer/f3frk2n/ >> >> Best, >> Ihor >> >> Gerardo Moro writes: >> >> > Thanks, Ihor. >> > Indeed, that is an excellent feature of agenda. I use it sometimes to >> > visualize what I have DONE during the week on the sopt. >> > What I aim to accomplish however is a more systematic log of all the >> DONE >> > tasks, this is, to have an archive file where to archive all tasks. >> > This file is in the format: >> > >> > 2020 >> > 2020-01-01 DONE task1 >> > 2020-01-12 DONE task2 >> > 2020-02-01 CANCELLED task3 >> > >> > So it is indeed a datetree file where I can revisit the past :) if you >> will. >> > The problem with habits and repeated tasks is that they don't get >> archived >> > when DONE... >> > They get archived once the task is cancelled or completed as a whole, >> all >> > under the day the task stopped continuing, under which I have all the >> > logged individual completion. >> > It would be desirable to have each "completion" archived under its >> > corresponding datetree, it is more meaningful :) >> > >> > Hope it is clear now, thanks so much for any help! >> > GM >> > So even if I have beeng doing the task every wednesday for a year, it >> won't >> > be archived >> > >> > El mar., 3 nov. 2020 a las 7:53, Ihor Radchenko () >> > escribi=C3=B3: >> > >> >> > It would be great if each of these individual "task >> >> > happenings" were archived under the date and time they were complet= ed >> >> > individually, and not just all as one block. This way I could get >> weekly >> >> > reviews that take those into account. >> >> >> >> What about trying to do your weekly review using org-agenda? You can >> >> show the task every day you complete it by enabling org-agenda-log-mo= de >> >> in your weekly agenda (v l). If your tasks are also archived regularl= y, >> >> you may also need "v A" to include archive files into agenda view. >> >> >> >> Best, >> >> Ihor >> >> >> >> >> >> Gerardo Moro writes: >> >> >> >> > Dear all, >> >> > >> >> > I am resending this as I believe it's a useful concept to implement= , >> >> > especially by those who track their tasks and do weekly/monthly >> reviews. >> >> > >> >> > When I archive a repeated task (let's say, a learning project of 15 >> >> minutes >> >> > every Wednesday day for 2 months), the task gets archived in a date >> tree >> >> > all under the day it was closed (cancelled) as a whole. This means >> that >> >> all >> >> > the LOGGED individual instances of repetition are archived on the >> day the >> >> > project got completed. It would be great if each of these individua= l >> >> "task >> >> > happenings" were archived under the date and time they were complet= ed >> >> > individually, and not just all as one block. This way I could get >> weekly >> >> > reviews that take those into account. Not sure if I made myself >> >> understood! >> >> > :)) >> >> > >> >> > Thanks! >> >> > G >> >> >> > --000000000000f7fb0c05b449b344 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi again,=C2=A0

I actually now realized= that your function will not unfortunately archive each logged item (those = located in the logbook) in its corresponding date (!).
What it wi= ll do is to archive the whole tree under today's date without deleting = it from the original org file.

For instance,=C2=A0=

* TODO REPEATED TASK SAMPLE
=C2=A0 SCHEDULED: = <2020-11-30 Mon +20d>
=C2=A0 :PROPERTIES:
=C2=A0 :STYLE: =C2=A0= =C2=A0habit
=C2=A0 :LAST_REPEAT: [2020-11-09 Mon 22:28]
=C2=A0 :END:=
:LOGBOOK:
- State "DONE" =C2=A0 =C2=A0 =C2=A0 from "T= ODO" =C2=A0 =C2=A0 =C2=A0 [2020-11-15 Sun 22:28]
- State "DONE= " =C2=A0 =C2=A0 =C2=A0 from "STARTED" =C2=A0 =C2=A0[2020-11-= 14 Sat 22:17]
- State "DONE" =C2=A0 =C2=A0 =C2=A0 from "S= TARTED" =C2=A0 =C2=A0[2020-11-13 Fri 22:17]
- State "DONE"= ; =C2=A0 =C2=A0 =C2=A0 from "STARTED" =C2=A0 =C2=A0[2020-11-11 We= d 22:17]

If I position myself in any point in = this entry, when I execute the function it will archive the whole tree+subt= ree under today's date (the date when it was archived).
The b= ehaviour I was expecting is to archive each of the logged tasks under their= corresponding date (on the 11th, 13th, 14th and 15th of November).
Just to be clear :)
G

El lun., 16 nov. 2020 a las 17:21, = Gerardo Moro (<gerardomoro37@= gmail.com>) escribi=C3=B3:
Wow, I=E2=80=99m impres= sed by your help, you are very kind!
I am also impressed by your researc= hing skills, I gave a long go at trying to find some code online unsuccessf= ully.

Yes, I agree that the agenda is a nice way to go to visualize = my past events (with v A).
My idea of not relying on= =C2=A0the agenda interface is just to be free and have an archive org file = with all my entries, easier to scroll from any device without the need of E= macs.

As for the function to archive the individu= al repeated tasks into their corresponding tree:
I=E2=80=99m not an emac= s lisp programmer (or any kind of!). As I see, this function works only =E2= =80=9Cat point=E2=80=9D.
The way I work is I mark tasks as DONE during a= couple weeks, and then I call this function that tracks all my org file an= d archives all DONE / CANCELLED items.
This is great because I don=E2=80= =99t have to do it one by one.

(defun my/org-archive-done-tasks-file= ()
=C2=A0 (interactive)
=C2=A0 (org-map-entries
=C2=A0 =C2=A0(lam= bda ()
=C2=A0 =C2=A0 =C2=A0(org-archive-subtree)
=C2=A0 =C2=A0 =C2=A0= (setq org-map-continue-from (outline-previous-heading)))
=C2=A0 =C2=A0 = =C2=A0"TODO=3D\"DONE\"|TODO=3D\"CANCELED\\"" = 'file))

Do you think there is a way to combine these two functio= ns so that when I call the fucntion, I get to archive all DONE/CANCELLED &a= mp; repeated DONE/CANCELLED tasks (the latter without deleting the logged t= ask or its respective heading)?

Best,=C2=A0
G.
El jue.,= 12 nov. 2020 a las 12:28, Ihor Radchenko (<yantar92@gmail.com>) escribi=C3=B3:
<= /div>
> Hope it is clea= r now, thanks so much for any help!

Sorry for not making my previous email more clear. I actually understood what you want to achieve. My suggestion was rather an alternative
approach to "revisit the past" - you can always build agenda view= for a
specific date (or range of dates) in the past. That way, you would not
need to look into archive file manually at all.

On your actual question, I think I found some old reddit comment [1] that may be relevant. The code provides a new command to archive an org
headline without actually deleting it. That way, you will get a copy of
your headline on the date of archival. Below is the original code with
me adding docstrings for more clarity.

(defun my/org-archive-delete-logbook ()
"Delete LOGBOOK of the entry at point. It is obsolete once the copy of=
the item is moved to the archive file."
=C2=A0 (save-excursion
=C2=A0 =C2=A0(org-end-of-meta-data)
=C2=A0 =C2=A0(let ((elm (org-element-at-point)))
=C2=A0 =C2=A0 =C2=A0(when (and
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (equal (org-element-type elm) = 9;drawer)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (equal (org-element-property :dra= wer-name elm) "LOGBOOK"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0(delete-region (org-element-property :begin elm)=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 (org-element-property :end elm))))))

(defun my/org-archive-without-delete ()
"Archive item at point, but do not actually delete it."
=C2=A0 (cl-letf (((symbol-function 'org-cut-subtree) (lambda () nil)))<= br> =C2=A0 =C2=A0 (org-archive-subtree)))

(defun my/org-archive-logbook ()
"Create an archive copy of subtree at point and delete LOGBOOK in the<= br> first headline of the subtree."
=C2=A0 (interactive)
=C2=A0 (my/org-archive-without-delete)
=C2=A0 (my/org-archive-delete-logbook))

I think you can modify the last function and call it in
org-trigger-hook, so that repeating items would be archived without
deleting every time you mark the item DONE.

[1] https:/= /old.reddit.com/r/orgmode/comments/dg43hs/can_i_archive_a_property_drawer/f= 3frk2n/

Best,
Ihor

Gerardo Moro <gerardomoro37@gmail.com> writes:

> Thanks, Ihor.
> Indeed, that is an excellent feature of agenda. I use it sometimes=C2= =A0 to
> visualize what I have DONE during the week on the sopt.
> What I aim to accomplish however is a more systematic log of all the D= ONE
> tasks, this is, to have an archive file where to archive all tasks. > This file is in the format:
>
> 2020
>=C2=A0 =C2=A0 2020-01-01 DONE task1
>=C2=A0 =C2=A0 2020-01-12 DONE task2
>=C2=A0 =C2=A0 2020-02-01 CANCELLED task3
>
> So it is indeed a datetree file where I can revisit the past :) if you= will.
> The problem with habits and repeated tasks is that they don't get = archived
> when DONE...
> They get archived once the task is cancelled or completed as a whole, = all
> under the day the task stopped continuing, under which I have all the<= br> > logged individual completion.
> It would be desirable to have each "completion" archived und= er its
> corresponding datetree, it is more meaningful :)
>
> Hope it is clear now, thanks so much for any help!
> GM
> So even if I have beeng doing the task every wednesday for a year, it = won't
> be archived
>
> El mar., 3 nov. 2020 a las 7:53, Ihor Radchenko (<yantar92@gmail.com>)
> escribi=C3=B3:
>
>> > It would be great if each of these individual "task
>> > happenings" were archived under the date and time they w= ere completed
>> > individually, and not just all as one block. This way I could= get weekly
>> > reviews that take those into account.
>>
>> What about trying to do your weekly review using org-agenda? You c= an
>> show the task every day you complete it by enabling org-agenda-log= -mode
>> in your weekly agenda (v l). If your tasks are also archived regul= arly,
>> you may also need "v A" to include archive files into ag= enda view.
>>
>> Best,
>> Ihor
>>
>>
>> Gerardo Moro <gerardomoro37@gmail.com> writes:
>>
>> > Dear all,
>> >
>> > I am resending this as I believe it's a useful concept to= implement,
>> > especially by those who track their tasks and do weekly/month= ly reviews.
>> >
>> > When I archive a repeated task (let's say, a learning pro= ject of 15
>> minutes
>> > every Wednesday day for 2 months), the task gets archived in = a date tree
>> > all under the day it was closed (cancelled) as a whole. This = means that
>> all
>> > the LOGGED individual instances of repetition are archived on= the day the
>> > project got completed. It would be great if each of these ind= ividual
>> "task
>> > happenings" were archived under the date and time they w= ere completed
>> > individually, and not just all as one block. This way I could= get weekly
>> > reviews that take those into account. Not sure if I made myse= lf
>> understood!
>> > :))
>> >
>> > Thanks!
>> > G
>>
--000000000000f7fb0c05b449b344--