From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp1 ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id aO6/DP6etGGQSQAAgWs5BA (envelope-from ) for ; Sat, 11 Dec 2021 13:52:14 +0100 Received: from aspmx1.migadu.com ([2001:41d0:8:6d80::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp1 with LMTPS id cPNSCP6etGEuSAAAbx9fmQ (envelope-from ) for ; Sat, 11 Dec 2021 12:52:14 +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 C64A92F2F2 for ; Sat, 11 Dec 2021 13:52:13 +0100 (CET) Received: from localhost ([::1]:60842 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mw1rI-0001Sy-5k for larch@yhetil.org; Sat, 11 Dec 2021 07:52:12 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33356) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mw1pJ-0001Rb-2s for emacs-orgmode@gnu.org; Sat, 11 Dec 2021 07:50:09 -0500 Received: from [2a00:1450:4864:20::432] (port=36446 helo=mail-wr1-x432.google.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mw1pH-0007fS-4d for emacs-orgmode@gnu.org; Sat, 11 Dec 2021 07:50:08 -0500 Received: by mail-wr1-x432.google.com with SMTP id u17so19316057wrt.3 for ; Sat, 11 Dec 2021 04:50:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:in-reply-to:references:date:message-id:mime-version; bh=6+0l7eGgOO7AijjqTnfaArcnQeWbNMT7vcDHPYMEg7w=; b=NSfW6Gv2f/GlAbaPMZuxhWkq/eUH4aBanoG+J0Wdcj6JS/RIizCm0KPO5WUqU2QvNW xRPygPn0u/ol/2s2gXMrEUmxupMGtqfqByX/62/3dT1oSX5ZoQU7JBAweBt6jUE6V/g4 geirFepwOssHTMMEEU9CRPcEPue2RunygapWfpfo/9p3cHJMGjoHkVJqrzLrFqueaCp9 XktCHdIv448GusVN2bWIfFJXA1lp4OI7VyRp4AS2w1GXY1bk4+wDRvClVRpmcEskj2TB PCZrWr3udorH2h+gf6fEuX9W6gkZGhsC/Ob8Ac0fW2Yn6UnT8XRKO94Gf4PNKvwBVQ+Q 80TQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:in-reply-to:references:date :message-id:mime-version; bh=6+0l7eGgOO7AijjqTnfaArcnQeWbNMT7vcDHPYMEg7w=; b=WDUYPyyX+oX6KiIqYeKnDXtX1pGUuBtc89+JjBJvweWtaq93sNKiBNEmodIEUxL/QW tBKkH3t+mnYiNA/aNI5crYGPuUC37Kg/XESdYcVkXWGPc5KACdn2zrDsBZfO4aaEN/gx gTbk0JfUjniUx5pVAl5Sl+MX0a9EhdRpF0iz20QASc9zVNxbKKay2MrrShN70YdUWj7G b4WMAXFJzaMBS5sbPZDBkKpzyOr9WIHvcIo+6/EAl5WDJox24K+m9FHZP2sE5uxbHvRx UlfAPAeRSKl0iU1C8iDuwzQl9hHqGsfo+ofQQ2DQ6XisgajXLxZxsMWNsknYpEkWW6cr LeSQ== X-Gm-Message-State: AOAM531rKleRJtLxWq8jaGHQJuPn0Ul7GDe6v3sRgroPRo5v7xwPFdes djWFXUlBZl1m0fvZ/1L8u7I= X-Google-Smtp-Source: ABdhPJwVhGhLUAHXYipoN2E+LwJkpfwltvbaZ2dkWM7U2p0ZsMz3AFyunBheRzRGv6PtG1/lNF0bWg== X-Received: by 2002:a5d:69ce:: with SMTP id s14mr20544998wrw.25.1639227001608; Sat, 11 Dec 2021 04:50:01 -0800 (PST) Received: from localhost (131-199-28-81.ftth.cust.kwaoo.net. [81.28.199.131]) by smtp.gmail.com with ESMTPSA id t17sm1460469wmq.15.2021.12.11.04.50.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 11 Dec 2021 04:50:00 -0800 (PST) From: Samuel Loury To: Samuel Banya , emacs-orgmode@gnu.org Subject: Re: Question About Nuking The Priority Of A Task After Its Been Marked As 'DONE' In-Reply-To: <3c86bbd6-89d7-46b5-9bb5-60ca414b4516@www.fastmail.com> References: <3c86bbd6-89d7-46b5-9bb5-60ca414b4516@www.fastmail.com> Date: Sat, 11 Dec 2021 13:49:43 +0100 Message-ID: <87v8zvs3vc.fsf@gmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="=-=-="; micalg=pgp-sha512; protocol="application/pgp-signature" X-Host-Lookup-Failed: Reverse DNS lookup failed for 2a00:1450:4864:20::432 (failed) Received-SPF: pass client-ip=2a00:1450:4864:20::432; envelope-from=konubinix@gmail.com; helo=mail-wr1-x432.google.com X-Spam_score_int: -12 X-Spam_score: -1.3 X-Spam_bar: - X-Spam_report: (-1.3 / 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, RCVD_IN_DNSWL_NONE=-0.0001, RDNS_NONE=0.793, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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=1639227133; 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=6+0l7eGgOO7AijjqTnfaArcnQeWbNMT7vcDHPYMEg7w=; b=L74qP7yHhBtLmcoCGQs8ReZRoLAM7+kCS6XlJg/ODPiGpk7LmFtQrY55MrwTKbk4FpPOcX qBD6izMCw+9lqLGYxUun+RPKiUAHctRz/n0fDqEQl8H/bX09SJ8DL9pjlg5jzMSnvgWVRE lr+qYFVlNzSvf1PQ6Z8UXbsGNLj+7a0Lo3J7kFfOsWwpL1r92DW43A4V3QHJaGiqT7qzx7 WQBh0OE8paap/xE1p7ERfxqFl9ChFAfNMGd1gkzCj5Fm7FqEV+QMDi/DjzI1HWudq3MWM9 pw/58FK4fENqJKONgHcIe0L3yld8i3k9/2ABSRVOApaUJaYvxjk9WOlhB8wzFQ== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1639227133; a=rsa-sha256; cv=none; b=k7qb9fRjVs/HcvTFUJGS+rdVTVoOVlRETsX8Bt1fA2kQ0d0Yt/f/Mfo+BWeJhha75vJJt9 Onps8D5iDjxDpVYxKC8OyLDXTjv4xAcD0thX4AK2qVonwZA84eqHjRh1IrRJOR+HLtXzDp CigHWKRj7+5dQ07aDTddyinRKVUtHL05XtwB282aippj6s4xDk0nYrewKtS8yImsYGh3jX ygLV9S5iSC2Zj+AwfgKnDrUjsYW4HpIJ6WxnZZfyIN2lLPycIRsGITgHbCq2AWzADjpGRp 6gP+T2+jsAerUCTzBM21Pz24F8NEDO0tuDUMuh1puDmRSrcp+S4W2T456r6m6g== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NSfW6Gv2; dmarc=pass (policy=none) header.from=gmail.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: -5.76 Authentication-Results: aspmx1.migadu.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=NSfW6Gv2; dmarc=pass (policy=none) header.from=gmail.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: C64A92F2F2 X-Spam-Score: -5.76 X-Migadu-Scanner: scn1.migadu.com X-TUID: KSwAwnN2VVOs --=-=-= Content-Type: text/plain Content-Transfer-Encoding: quoted-printable "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: =2D-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) =2D-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 =2D-8<---------------cut here---------------start------------->8--- * NEXT [#B] some task :PROPERTIES: :TRIGGER: self() set-priority!(" ") :END: =2D-8<---------------cut here---------------end--------------->8--- Closing it would result in =2D-8<---------------cut here---------------start------------->8--- * DONE some task CLOSED: [2021-12-11 Sat 13:38] :PROPERTIES: :TRIGGER: self() set-priority!(" ") :END: =2D-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, =2D-=20 Konubinix GPG Key : 7439106A Fingerprint: 5993 BE7A DA65 E2D9 06CE 5C36 75D2 3CED 7439 106A --=-=-= Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCgAdFiEEWZO+etpl4tkGzlw2ddI87XQ5EGoFAmG0nmcACgkQddI87XQ5 EGrLMAgAigeaXB5hsjk4flFKZeFl6Qli+o4HCmrop+nV+osdmTiy7oxH20+htTmC bP63sI+tKXEYSrn1GHgGY3HU2SI+mHvOCANrqtPDnXEbWwAlvjgTVoS/ZROTvToz qJXoBvH4cueF9dRHXV9W3v5jMjxJ5Dg7nmKUaPhBKH/uFc9zZ7orv1otVqJmEobN ZmlKsFWg4u7upioznjnftNHSnJF2WyZyz/bhuv0zp9T6LGzRbLxJdcEkXEAdnHMK MPqH1AM2UB81szRFr4a2X9r3eIzdLLP+giZxkyqCRRTjHIvFmkVmlbd73Jf590oF xCCWSQ4Y6C1aSbA8GMO3Be+FvUT54Q== =3L41 -----END PGP SIGNATURE----- --=-=-=--