From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id 24wgJcTftF+ibgAA0tVLHw (envelope-from ) for ; Wed, 18 Nov 2020 08:48:04 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 6IN4IMTftF99LQAAB5/wlQ (envelope-from ) for ; Wed, 18 Nov 2020 08:48:04 +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 D8B729400D3 for ; Wed, 18 Nov 2020 08:48:03 +0000 (UTC) Received: from localhost ([::1]:57754 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kfJ8D-0005xn-Kn for larch@yhetil.org; Wed, 18 Nov 2020 03:48:01 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:51436) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kfIwG-0006Pe-Qi for emacs-orgmode@gnu.org; Wed, 18 Nov 2020 03:35:40 -0500 Received: from mail-lj1-x234.google.com ([2a00:1450:4864:20::234]:36518) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kfIwE-0005BF-If for emacs-orgmode@gnu.org; Wed, 18 Nov 2020 03:35:40 -0500 Received: by mail-lj1-x234.google.com with SMTP id i17so1426346ljd.3 for ; Wed, 18 Nov 2020 00:35:38 -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=J9O7JbFlGOX6RslZhKvZkjW2YnjPqZes8kWZD3pE0cU=; b=Tt1hG/LlSTcfOH7uaDto6Qz8CjmCE+ecbyeM6wAiTLy4synn7puOfmxj31YgBjbBwG 7ZSSfdg46NfAYqTZxj8fScGvrh7i1vMLEn8YvjY/we3k2320ICksCjPcSRDj7HoDph1h mYwqbHzt+64mT4rSlOtQ3OTx6jHSTJvsfoyUwg4DuKtwxzwvwOc0VlfzSIU0ni3vrFWu JPwB/R4SqUHvfQXVDAi7PBu++YbJ+jKSQx5o99mDmzSyVJ6Fb1Z+b7nT2zEHWC35RW90 HT7Lfzzqfmkb8cAN2+9gifT2U4Z3XEKkd6wSDqGDOio5cxTj5WVTggxkpCYTYY3UW5DX wPLA== 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=J9O7JbFlGOX6RslZhKvZkjW2YnjPqZes8kWZD3pE0cU=; b=N/UOcZ+PaV3AZDqrpZaL9NhZO0AHTca+s6S1h0Emvk1Wakznpjkr2Q/PTqg0WpAg52 xIM/JzYrIhxvY2BYqPCpz9B/fBAUCUa+iGHuXbUpUQgpe773+ccUC7R0x87wGnNVNaHy gYE5lSbozcVsqq7YenVCeixktwK/rFnfWfd8Dg5178geBzRtJhobSnguIRGasOIuz5SZ RLzzUrrorQ0CTrkbvAef9nX9pWrBUf6jdAWXZyfo161EehYHEegjURLUeXhpGb9/+bF2 jb7JodICWmak6+g+6YNDIg3Lfz3ztwxYdDUyBH+lYTlWIRlIdElrDKaS79mTCglfFiaN Wqrw== X-Gm-Message-State: AOAM5335R4Tb0l4LFDWJ5c36aBd1JPXlTkMT0NQIVmbpQl04085faiML uGscPqTtrokTnayEKVQf+rFlO90+RhXZbr40Xa0= X-Google-Smtp-Source: ABdhPJzEnRPSlAfNvoZ9XRPtbiUc18LRDF+mszXU4X6DTFUTuLQYTnlmKlCcdFhx0htuW3e5AP5YTv9RpxFe+6dUmt0= X-Received: by 2002:a05:651c:11cd:: with SMTP id z13mr3306847ljo.65.1605688536489; Wed, 18 Nov 2020 00:35:36 -0800 (PST) MIME-Version: 1.0 References: <87lffj7zss.fsf@localhost> <87zh3mlvj7.fsf@localhost> <87ft58nxck.fsf@localhost> <87d00cnp0i.fsf@localhost> <87a6vgnn4q.fsf@localhost> <874klonfdi.fsf@localhost> <87y2izmdks.fsf@localhost> In-Reply-To: <87y2izmdks.fsf@localhost> From: Gerardo Moro Date: Wed, 18 Nov 2020 10:35:25 +0200 Message-ID: Subject: Re: Archiving repeated tasks under corresponding date tree for each repeated item To: Ihor Radchenko Content-Type: multipart/alternative; boundary="000000000000d6637805b45d7eb2" Received-SPF: pass client-ip=2a00:1450:4864:20::234; envelope-from=gerardomoro37@gmail.com; helo=mail-lj1-x234.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=Tt1hG/Ll; 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: 72wjNyxvzFFp --000000000000d6637805b45d7eb2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Indeed. I will try to work on it in my spare time, it will take maybe up to a year, but as soon as I have it, I will let the maillist know in case it's of interest. Again, thanks for all your help. GM El mi=C3=A9., 18 nov. 2020 a las 7:37, Ihor Radchenko (= ) escribi=C3=B3: > > So from now on, all the DONE tasks would be archived straight away on t= he > > day they are DONE. > > Not all the tasks, but all the tasks with repeater. > > > Is there a way to do the same with all the logged items under the > :LOGBOOK: > > that have been DONE before? > > It is certainly possible, but require more complicated function. > > Best, > Ihor > > Gerardo Moro writes: > > > Thank you! Ok, now it works. I had to restart my Emacs, probably that w= as > > the problem. > > > > So from now on, all the DONE tasks would be archived straight away on t= he > > day they are DONE. What about the previously LOGGED tasks? > > Is there a way to do the same with all the logged items under the > :LOGBOOK: > > that have been DONE before? > > > > I have thousands of such instances, and I wonder if a function would fi= nd > > all those items inside the LOGBOOKS and archive them individually under > > their own DONE date in the org archive file. Maybe too much to ask! :) > > GM > > > > > > El mar., 17 nov. 2020 a las 18:00, Ihor Radchenko (= ) > > escribi=C3=B3: > > > >> > Now I get the error: "wrong number of arguments..." :D > >> > >> It does not happen in my Emacs. It would be helpful if you shared the > >> whole error message. > >> > >> I used the following code for testing: > >> > >> (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 org-archive-repeated-task (arg) > >> "Add a copy of the recurring task marked DONE to archive." > >> (when (and (eq (plist-get arg :type) 'todo-state-change) > >> (string=3D (plist-get arg :to) "DONE")) ;; The state is > changed > >> to DONE > >> (let* ((pos (plist-get arg :position)) > >> (repeater (org-with-point-at pos (org-get-repeat)))) > >> (when repeater ;; Only consider tasks with repeater timestamp > >> anywhere in the task body > >> (my/org-archive-without-delete))))) > >> > >> (add-hook 'org-trigger-hook #'org-archive-repeated-task) > >> > >> Best, > >> Ihor > >> > >> Gerardo Moro writes: > >> > >> > Now I get the error: "wrong number of arguments..." :D > >> > > >> > El mar., 17 nov. 2020 a las 15:13, Ihor Radchenko (< > yantar92@gmail.com>) > >> > escribi=C3=B3: > >> > > >> >> > I tried this but I get: "symbol's function definition is void: > >> >> > org-trigger-doing" > >> >> > >> >> Oops. That's the old function name. Should be > >> >> > >> >> (add-hook 'org-trigger-hook #'org-archive-repeated-task) > >> >> > >> >> Best, > >> >> Ihor > >> >> > >> >> > >> >> Gerardo Moro writes: > >> >> > >> >> > Thanks for the prompt reply! > >> >> > I tried this but I get: "symbol's function definition is void: > >> >> > org-trigger-doing" > >> >> > > >> >> > El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko (< > >> yantar92@gmail.com>) > >> >> > escribi=C3=B3: > >> >> > > >> >> >> > Thanks, I don't know how to go about doing that, so I would > have to > >> >> rely > >> >> >> on > >> >> >> > others wanting to help me if they consider this to be also > useful > >> to > >> >> them > >> >> >> > (which I definitely think it is!). > >> >> >> > >> >> >> Try the following code. It should archive any repeated task once > it > >> is > >> >> >> marked DONE. > >> >> >> > >> >> >> (defun org-archive-repeated-task (arg) > >> >> >> "Add a copy of the recurring task marked DONE to archive." > >> >> >> (when (and (eq (plist-get arg :type) 'todo-state-change) > >> >> >> (string=3D (plist-get arg :to) "DONE")) ;; The stat= e is > >> >> changed > >> >> >> to DONE > >> >> >> (let* ((pos (plist-get arg :position)) > >> >> >> (repeater (org-with-point-at pos (org-get-repeat)))) > >> >> >> (when repeater ;; Only consider tasks with repeater > timestamp > >> >> >> anywhere in the task body > >> >> >> (my/org-archive-without-delete))))) > >> >> >> (add-hook 'org-trigger-hook #'org-trigger-doing) > >> >> >> > >> >> >> Best, > >> >> >> Ihor > >> >> >> > >> >> > >> > --000000000000d6637805b45d7eb2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Indeed. I will try to work on it in my spare time, it will= take maybe up to a year, but as soon as I have it, I will let the maillist= =C2=A0know in case it's of interest.
Again, thanks for all your hel= p.
GM

El mi=C3=A9., 18 nov. 2020 a las 7:37, Ihor Radchenko = (<yantar92@gmail.com>) escr= ibi=C3=B3:
> = So from now on, all the DONE tasks would be archived straight away on the > day they are DONE.

Not all the tasks, but all the tasks with repeater.

> Is there a way to do the same with all the logged items under the :LOG= BOOK:
> that have been DONE before?

It is certainly possible, but require more complicated function.

Best,
Ihor

Gerardo Moro <gerardomoro37@gmail.com> writes:

> Thank you! Ok, now it works. I had to restart my Emacs, probably that = was
> the problem.
>
> So from now on, all the DONE tasks would be archived straight away on = the
> day they are DONE. What about the previously LOGGED tasks?
> Is there a way to do the same with all the logged items under the :LOG= BOOK:
> that have been DONE before?
>
> I have thousands of such instances, and I wonder if a function would f= ind
> all those items inside the LOGBOOKS and archive them individually unde= r
> their own DONE date in the org archive file. Maybe too much to ask! :)=
> GM
>
>
> El mar., 17 nov. 2020 a las 18:00, Ihor Radchenko (<yantar92@gmail.com>)
> escribi=C3=B3:
>
>> > Now I get the error: "wrong number of arguments..."= :D
>>
>> It does not happen in my Emacs. It would be helpful if you shared = the
>> whole error message.
>>
>> I used the following code for testing:
>>
>> (defun my/org-archive-without-delete ()
>>=C2=A0 =C2=A0"Archive item at point, but do not actually delet= e it."
>>=C2=A0 =C2=A0(cl-letf (((symbol-function 'org-cut-subtree) (lam= bda () nil)))
>>=C2=A0 =C2=A0 =C2=A0(org-archive-subtree)))
>>
>> (defun org-archive-repeated-task (arg)
>>=C2=A0 =C2=A0"Add a copy of the recurring task marked DONE to = archive."
>>=C2=A0 =C2=A0(when (and (eq (plist-get arg :type) 'todo-state-c= hange)
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (string=3D (plist-= get arg :to) "DONE")) ;; The state is changed
>> to DONE
>>=C2=A0 =C2=A0 =C2=A0(let* ((pos (plist-get arg :position))
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (repeater (org-with-point= -at pos (org-get-repeat))))
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0(when repeater ;; Only consider tasks wi= th repeater timestamp
>> anywhere in the task body
>>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(my/org-archive-without-delete)))= ))
>>
>> (add-hook 'org-trigger-hook #'org-archive-repeated-task) >>
>> Best,
>> Ihor
>>
>> Gerardo Moro <gerardomoro37@gmail.com> writes:
>>
>> > Now I get the error: "wrong number of arguments..."= :D
>> >
>> > El mar., 17 nov. 2020 a las 15:13, Ihor Radchenko (<yantar92@gmail.com>= ;)
>> > escribi=C3=B3:
>> >
>> >> > I tried this but I get: "symbol's function = definition is void:
>> >> >=C2=A0 org-trigger-doing"
>> >>
>> >> Oops. That's the old function name. Should be
>> >>
>> >> (add-hook 'org-trigger-hook #'org-archive-repeate= d-task)
>> >>
>> >> Best,
>> >> Ihor
>> >>
>> >>
>> >> Gerardo Moro <gerardomoro37@gmail.com> writes:
>> >>
>> >> > Thanks for the prompt reply!
>> >> > I tried this but I get: "symbol's function = definition is void:
>> >> >=C2=A0 org-trigger-doing"
>> >> >
>> >> > El mar., 17 nov. 2020 a las 14:32, Ihor Radchenko (&= lt;
>> yantar92@g= mail.com>)
>> >> > escribi=C3=B3:
>> >> >
>> >> >> > Thanks, I don't know how to go about do= ing that, so I would have to
>> >> rely
>> >> >> on
>> >> >> > others wanting to help me if they consider = this to be also useful
>> to
>> >> them
>> >> >> > (which I definitely think it is!).
>> >> >>
>> >> >> Try the following code. It should archive any re= peated task once it
>> is
>> >> >> marked DONE.
>> >> >>
>> >> >> (defun org-archive-repeated-task (arg)
>> >> >>=C2=A0 =C2=A0"Add a copy of the recurring ta= sk marked DONE to archive."
>> >> >>=C2=A0 =C2=A0(when (and (eq (plist-get arg :type)= 'todo-state-change)
>> >> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 = (string=3D (plist-get arg :to) "DONE")) ;; The state is
>> >> changed
>> >> >> to DONE
>> >> >>=C2=A0 =C2=A0 =C2=A0(let* ((pos (plist-get arg :p= osition))
>> >> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (repeat= er (org-with-point-at pos (org-get-repeat))))
>> >> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0(when repeater ;; Only= consider tasks with repeater timestamp
>> >> >> anywhere in the task body
>> >> >>=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(my/org-archive= -without-delete)))))
>> >> >> (add-hook 'org-trigger-hook #'org-trigge= r-doing)
>> >> >>
>> >> >> Best,
>> >> >> Ihor
>> >> >>
>> >>
>>
--000000000000d6637805b45d7eb2--