emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Matthew Lundin <mdl@imapmail.org>
To: David Maus <maus.david@gmail.com>
Cc: Matt Lundin <mdl@imapmail.org>, emacs-orgmode@gnu.org
Subject: Re: Re: Remove scheduled date when switch TODO states
Date: Mon, 22 Feb 2010 17:23:33 -0500	[thread overview]
Message-ID: <87k4u4di56.fsf@fastmail.fm> (raw)
In-Reply-To: <87pr3wlxpw.wl%maus.david@gmail.com> (David Maus's message of "Mon, 22 Feb 2010 23:19:55 +0100")

David Maus <maus.david@gmail.com> writes:

> Matt Lundin wrote:
>>Nathaniel Flath <flat0103@gmail.com> writes:
>
>>> I have a todo state, PENDING, that I organize tasks that I cannot
>>> perform immediately.  Is there a way to configure org-todoconfigure so
>>> that when a task is switched to PENDING, if it has a scheduled date
>>> that date is removed?
>
>>You could use the hook org-after-todo-state-change-hook. E.g.
>
>>--8<---------------cut here---------------start------------->8---
>>(defun my-org-pending-remove-deadline ()
>>  (when (equal (org-entry-get nil "TODO") "PENDING")
>>    (org-remove-timestamp-with-keyword org-deadline-string)))
>
>>(add-hook 'org-after-todo-state-change-hook 'my-org-pending-remove-deadline)
>>--8<---------------cut here---------------end--------------->8---
>
> You can actually skip the `org-entry-get' as "The new state (a string
> with a TODO keyword, or nil) is available in the Lisp variable
> `state'"[1].
>
> ,----
> | (defun my-org-pending-remove-deadline ()
> |   (when (string= state "PENDING")
> |     (org-remove-timestamp-with-keyword org-deadline-string)))
> `----

Good to know. Thanks!

- Matt

      reply	other threads:[~2010-02-22 22:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-20 20:13 Remove scheduled date when switch TODO states Nathaniel Flath
2010-02-21  5:18 ` Manish
2010-02-22 18:10 ` Matt Lundin
2010-02-22 22:19   ` David Maus
2010-02-22 22:23     ` Matthew Lundin [this message]

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  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=87k4u4di56.fsf@fastmail.fm \
    --to=mdl@imapmail.org \
    --cc=emacs-orgmode@gnu.org \
    --cc=maus.david@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

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).