emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Phil Chrapka <pchrapka@gmail.com>
To: emacs-orgmode@gnu.org
Subject: Clear non-repeated scheduled time when deadline is repeated
Date: Sun, 27 Jul 2014 17:02:53 -0400	[thread overview]
Message-ID: <CAONUFyyRug+fSW0eMh_P3XVcam2OOOkZ52W=2ktwgNyu8ecN1A@mail.gmail.com> (raw)

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

I'm having the exact same issue as this question on stackoverflow
and I've copied it below.

The solution provided to the question modifies the source, which I'd like
to avoid if possible. Is there a better way of doing this like by setting a
variable or a hook? Or does anyone have better ideas about this type of


> I use org-mode to manage some deadlines for repeated tasks. For example, I
> may have something like the following:
> * TODO My Weekly Task
>   DEADLINE <2013-08-10 Sat +1w>
> If I mark the task as DONE, then the deadline automatically increments to
> the next week as expected. However, I also like to use the SCHEDULED time
> to indicate when during the week I would like to actually do that task, for
> example:
> * TODO My Weekly Task
>   DEADLINE <2013-08-10 Sat +1w> SCHEDULED: <2013-08-08 Thu>
> This makes the task show up in the agenda for today (Thursday). However
> when I mark the task DONE, I end up with the following:
> * TODO My Weekly Task
>   DEADLINE <2013-08-17 Sat +1w> SCHEDULED: <2013-08-08 Thu>
> ...and the task still appears in the agenda view for today, even though it
> has been completed.
> Is it possible, for tasks that have a repeated DEADLINE, to get Org-Mode
> to clear the non-repeated SCHEDULED date?


> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -12835,7 +12835,8 @@ This function is run automatically after each
> state change to a DONE state."
>     (setq type (if (match-end 1) org-scheduled-string
>              (if (match-end 3) org-deadline-string "Plain:"))
>           ts (match-string (if (match-end 2) 2 (if (match-end 4) 4 0))))
> -   (when (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts)
> +   (if (not (string-match "\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts))
> +       (org-remove-timestamp-with-keyword org-scheduled-string)
>       (setq n (string-to-number (match-string 2 ts))
>         what (match-string 3 ts))
>       (if (equal what "w") (setq n (* n 7) what "d"))


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

             reply	other threads:[~2014-07-27 21:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-27 21:02 Phil Chrapka [this message]
2014-07-27 21:44 ` Clear non-repeated scheduled time when deadline is repeated Bastien

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='CAONUFyyRug+fSW0eMh_P3XVcam2OOOkZ52W=2ktwgNyu8ecN1A@mail.gmail.com' \
    --to=pchrapka@gmail.com \
    --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).