emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: "Peter Hardy" <peter@hardy.dropbear.id.au>
To: emacs-orgmode@gnu.org
Subject: Re: Question About Nuking The Priority Of A Task After Its Been Marked As 'DONE'
Date: Sat, 11 Dec 2021 09:51:05 +1100	[thread overview]
Message-ID: <23892070-6740-49b5-8d91-5405f9f461cd@www.fastmail.com> (raw)
In-Reply-To: <3c86bbd6-89d7-46b5-9bb5-60ca414b4516@www.fastmail.com>

[-- Attachment #1: Type: text/plain, Size: 711 bytes --]

On Sat, 11 Dec 2021, at 5:55 AM, Samuel Banya wrote:
> 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?


The org documentation (https://orgmode.org/worg/doc.html) includes a list of all of the hooks it supports. If you search it you'll find `org-after-todo-state-change-hook`, which seems to be exactly what you need. Keep digging, and you'll find the `org-priority` function to set an item's priority.

Looks like all you'd need to do is write a hook function to check the new state, and then change the priority.


[-- Attachment #2: Type: text/html, Size: 1157 bytes --]

  reply	other threads:[~2021-12-10 22:53 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-10 18:55 Question About Nuking The Priority Of A Task After Its Been Marked As 'DONE' Samuel Banya
2021-12-10 22:51 ` Peter Hardy [this message]
2021-12-11 12:49 ` Samuel Loury
2021-12-11 17:51   ` Samuel Banya
2021-12-17 18:38     ` Samuel Banya

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=23892070-6740-49b5-8d91-5405f9f461cd@www.fastmail.com \
    --to=peter@hardy.dropbear.id.au \
    --cc=emacs-orgmode@gnu.org \


* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).