From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id uJj2HGHltGGPAQEAgWs5BA (envelope-from ) for ; Sat, 11 Dec 2021 18:52:33 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id YGFsGGHltGHHDgAAbx9fmQ (envelope-from ) for ; Sat, 11 Dec 2021 17:52:33 +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 3865E2983D for ; Sat, 11 Dec 2021 18:52:32 +0100 (CET) Received: from localhost ([::1]:59090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw6Xu-0002QA-3P for larch@yhetil.org; Sat, 11 Dec 2021 12:52:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33452) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw6XE-0002Pq-4c for emacs-orgmode@gnu.org; Sat, 11 Dec 2021 12:51:48 -0500 Received: from out1-smtp.messagingengine.com ([66.111.4.25]:56767) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw6XC-0003SU-5D for emacs-orgmode@gnu.org; Sat, 11 Dec 2021 12:51:47 -0500 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 788FB5C00CD; Sat, 11 Dec 2021 12:51:45 -0500 (EST) Received: from imap49 ([10.202.2.99]) by compute3.internal (MEProxy); Sat, 11 Dec 2021 12:51:45 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fastmail.com; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm1; bh=fEO33JY2Hl4eBbEVmpy2ShsyoKdX6oq wYqEoH/JRfbE=; b=U3J7eKBc6qhrZLjbS328xHP6NiyEt9h0SjTTu9hQqC1fUwQ caCbcW68SsVH4dTXz7yMX7dcACAtQdvCNy7rFi2kVtq9GGZOJRmfvBmuWfQm+3hb Z1laxa6v1bOTbF+ejXfb9q/KvmbN56zKDlRhjujZJ5jyCSSSl0kMQFFB/+7cGdoc a4za4Y1ckMeW62POUMVKP3S0mhsb0jVYPubxuXtt4lunt88rr/gcB+rNkxhOUmvg 7xn3/7y9Rhv8v+kaXZyBba9SsLLOJPdf8T894gBE9Q5zimH6UkYsleJpVb1EwUx5 XH6YSLG5et4ZsYPbOrU7y2qt8fwyye/bIR7kTtw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=fEO33J Y2Hl4eBbEVmpy2ShsyoKdX6oqwYqEoH/JRfbE=; b=bD5rHi79VHkvDUawxeb2bp zoRnA5flsjrPFJ4NFl1KmyIEau3joql+PeZnAuyW+aXTk11oUekTffkOKBaDN3In PXYnWc3pXBtrJWSQCYHmoj1xrxuOCR02wxkkA/TnJYw6FQ/8GWglbTL8ZOR9gX/9 e36jQqaw2FcG2EeLrbjoPYxxWWyNTzh/LMzn+8Rhh+YhWGVlAI0zEFtS11HhLGgO qxPVbMbg8+7S77cXS0kK7BpuN6SYUpVx8D9Ewzk1CER2gmj6o+fvIc8TVxdYm3mJ X/AXONJF5uH0wk05qaL4S27o6iKfrSvES8HGCQ0P4TRElfXFuk2gkISi+9ieFvKg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrkeeggddutdduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfufgrmhhuvghluceurghnhigrfdcuoehssggrnhihrges fhgrshhtmhgrihhlrdgtohhmqeenucggtffrrghtthgvrhhnpedvudefgefhueeiiedtff fhgfehhffgleelfffhtdffuedtffetieevtddvjeeiieenucevlhhushhtvghrufhiiigv pedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehssggrnhihrgesfhgrshhtmhgrihhlrd gtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 49F8DF60073; Sat, 11 Dec 2021 12:51:45 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4514-g2bdc19e04f-fm-20211209.002-g2bdc19e0 Mime-Version: 1.0 Message-Id: In-Reply-To: <87v8zvs3vc.fsf@gmail.com> References: <3c86bbd6-89d7-46b5-9bb5-60ca414b4516@www.fastmail.com> <87v8zvs3vc.fsf@gmail.com> Date: Sat, 11 Dec 2021 12:51:25 -0500 From: "Samuel Banya" To: "Samuel Loury" , "Charles Berry" Subject: Re: Question About Nuking The Priority Of A Task After Its Been Marked As 'DONE' Content-Type: multipart/alternative; boundary=af4c8d2fcfe143b7bc5da8e7b7c2bb8c Received-SPF: pass client-ip=66.111.4.25; envelope-from=sbanya@fastmail.com; helo=out1-smtp.messagingengine.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.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_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-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.29 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=1639245153; 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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=fEO33JY2Hl4eBbEVmpy2ShsyoKdX6oqwYqEoH/JRfbE=; b=k29dCzPs9l8fF12MqDYpOzcsOhK6ai9oqrYKy/xNNyrVAs7uFllfI/tdjir9PCgGXxBN7z FxRowa0NwDn8pNTUjHl2mJiakqw4HH5+YAxfPCMzhVWp2Pmy+DHJwCxZpOu0y2p05qVFIc BRvkL/TGkD4cp9OF1Gt46dee/raB5JNqsWDvLvw/eTKXfIfIqhp6BqVtXASGztCpKs+OSQ Y7hcQt3viqxQ+YIGqg5NGAfwPLCOE9ehqQEbonUc6ffWqp1j6rKsdotGeK2CR2woqUPaRp luST0oLzebaoBNvc4rLNkx2g7oEo7AZfmLJ46rG7I2dxk4p8jmqUDDB0gev+7g== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639245153; a=rsa-sha256; cv=none; b=gFwbety9yxlcvzdQENqwmZVvF8FtIIHkXZgVK3XMVKB1sNan2auInT+2AYCr6tzcGO6Bk8 ZeYdNEEOQckoeXhr89vjSnBeuTVEO0RRK/XmJY4+qnGzWBopFm0LUzTS/W8C+m+uDwv0hr SOY/jFVknK1DgXMAV8+Nl+jY/7e48xABjfGq6H/qEzMnaLAX7h0lVVAep5mSGGE6+vM4Mz y0aSdrqX6psBUVv1SJ8Io0DlK9HAbppICHek8CSrKPDY44B8qeHQtIoT+hcgzGys0645kb TyHw5EFwYj+KxTtW+XmVF4mvIQEijk/Sj4urJ+vFg4EubYjgGrMjZcKG0sUk/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm1 header.b=U3J7eKBc; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=bD5rHi79; dmarc=pass (policy=none) header.from=fastmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Spam-Score: -4.25 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=fastmail.com header.s=fm1 header.b=U3J7eKBc; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=bD5rHi79; dmarc=pass (policy=none) header.from=fastmail.com; spf=pass (aspmx1.migadu.com: domain of "emacs-orgmode-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="emacs-orgmode-bounces+larch=yhetil.org@gnu.org" X-Migadu-Queue-Id: 3865E2983D X-Spam-Score: -4.25 X-Migadu-Scanner: scn1.migadu.com X-TUID: grTAsIpGvWx9 --af4c8d2fcfe143b7bc5da8e7b7c2bb8c Content-Type: text/plain Hey Konibunix! Thanks a ton for this, this looks fun as heck to implement :) I'll have to try this on my config sometime next week. Thanks a ton for this, bookmarking this post for now. Love it :) On Sat, Dec 11, 2021, at 7:49 AM, Samuel Loury wrote: > "Samuel Banya" writes: > > > I often change states of my todo list items to 'DONE', 'CANCELLED', etc. > > > > However, one thing I would want to know is this: > > - Is it possible to automatically delete the '#' priority value of a task after a task has been marked as 'DONE', 'CANCELLED', etc? > > > > Is this done via a hook function? > > To do it globally: > > --8<---------------cut here---------------start------------->8--- > (defun my/org-trigger-hook (change-plist) > (let* ((type (plist-get change-plist :type)) > (pos (plist-get change-plist :position)) > (from (substring-no-properties (or (plist-get change-plist :from) ""))) > (to (substring-no-properties (or (plist-get change-plist :to) ""))) > ) > (when (and > (eq type 'todo-state-change) > (member to org-done-keywords) > (member from org-not-done-keywords) > ) > (org-priority (string-to-char " ")) > ) > ) > ) > > (add-hook #'org-trigger-hook > #'my/org-trigger-hook) > --8<---------------cut here---------------end--------------->8--- > > > But if, like me, you want to define this behavior per task, this is one > of the purposes of org-edna. I suggest you try it. > > I your particular example, you would simply set the TRIGGER property of > the task for which you want to delete the priority to this content > > --8<---------------cut here---------------start------------->8--- > * NEXT [#B] some task > :PROPERTIES: > :TRIGGER: self() set-priority!(" ") > :END: > --8<---------------cut here---------------end--------------->8--- > > Closing it would result in > > --8<---------------cut here---------------start------------->8--- > * DONE some task > CLOSED: [2021-12-11 Sat 13:38] > :PROPERTIES: > :TRIGGER: self() set-priority!(" ") > :END: > --8<---------------cut here---------------end--------------->8--- > > Of course, it also work for repeated task or any complicated scenario > I have tried so far. > > I hope that helps, > -- > Konubinix > GPG Key : 7439106A > Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A > > > *Attachments:* > * signature.asc --af4c8d2fcfe143b7bc5da8e7b7c2bb8c Content-Type: text/html Content-Transfer-Encoding: quoted-printable
Hey Konibunix!<= br>

Thanks a ton for this, this looks fun as he= ck to implement :)

I'll have to try this on= my config sometime next week. Thanks a ton for this, bookmarking this p= ost for now.

Love it :)

<= /div>
On Sat, Dec 11, 2021, at 7:49 AM, Samuel Loury wrote:
"Samuel Banya" <= sbanya@fastmail.com> write= s:

> I often change states of my todo li= st items to 'DONE', 'CANCELLED', etc.
>
&= gt; However, one thing I would want to know is this:
> = - Is it possible to automatically delete the '#' priority value of a tas= k after a task has been marked as 'DONE', 'CANCELLED', etc?
>
> Is this done via a hook function?

To do it globally:

--8<= ---------------cut here---------------start------------->8---
(defun my/org-trigger-hook (change-plist)
  (l= et* ((type (plist-get change-plist :type))
  &nb= sp;      (pos (plist-get change-plist :position= ))
         (from = (substring-no-properties (or (plist-get change-plist :from) "")))
         (to (substring-= no-properties (or (plist-get change-plist :to) "")))
 = ;        )
  =   (when (and
      &nbs= p;    (eq type 'todo-state-change)
 &n= bsp;         (member to org-done= -keywords)
        = ;   (member from org-not-done-keywords)
 &n= bsp;         )
&nb= sp;     (org-priority (string-to-char " "))
      )
    = )
  )

(add-hook #'org-tr= igger-hook
        = ;  #'my/org-trigger-hook)
--8<---------------cut h= ere---------------end--------------->8---


But if, like me, you want to define this behavior per t= ask, this is one
of the purposes of org-edna. I suggest yo= u try it.

I your particular example, you wo= uld simply set the TRIGGER property of
the task for which = you want to delete the priority to this content

=
--8<---------------cut here---------------start------------->= 8---
* NEXT [#B] some task
:PROPERTIES:
<= /div>
:TRIGGER: self() set-priority!(" ")
:END:
--8<---------------cut here---------------end---------------&= gt;8---

Closing it would result in

--8<---------------cut here---------------start-= ------------>8---
* DONE some task
 = CLOSED: [2021-12-11 Sat 13:38]
:PROPERTIES:
:TRIGGER: self() set-priority!(" ")
:END:
-= -8<---------------cut here---------------end--------------->8---

Of course, it also work for repeated task or= any complicated scenario
I have tried so far.

I hope that helps,
-- 
Konubinix
GPG Key    : 7439106A
=
Fingerprint: 5993 BE7A DA65 E2D9 06CE  5C36 75D2 3CED 7439 106= A


Attachments:
  • signature.asc

--af4c8d2fcfe143b7bc5da8e7b7c2bb8c--