emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Clear non-repeated scheduled time when deadline is repeated
@ 2014-07-27 21:02 Phil Chrapka
  2014-07-27 21:44 ` Bastien
  0 siblings, 1 reply; 2+ messages in thread
From: Phil Chrapka @ 2014-07-27 21:02 UTC (permalink / raw)
  To: emacs-orgmode

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

Hi,
I'm having the exact same issue as this question on stackoverflow
http://stackoverflow.com/questions/18123972/emacs-org-mode-clear-non-repeated-scheduled-time-when-deadline-is-repeated
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
workflow?

Question:

> 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?


Solution:

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


Thanks,
Phil

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Clear non-repeated scheduled time when deadline is repeated
  2014-07-27 21:02 Clear non-repeated scheduled time when deadline is repeated Phil Chrapka
@ 2014-07-27 21:44 ` Bastien
  0 siblings, 0 replies; 2+ messages in thread
From: Bastien @ 2014-07-27 21:44 UTC (permalink / raw)
  To: Phil Chrapka; +Cc: emacs-orgmode

Hi Phil,

Phil Chrapka <pchrapka@gmail.com> writes:

>     Is it possible, for tasks that have a repeated DEADLINE, to get
>     Org-Mode to clear the non-repeated SCHEDULED date?

Simply add a repeater to the scheduled date too:

* TODO My Weekly Task
  DEADLINE <2013-08-10 Sat +1w> SCHEDULED: <2013-08-08 Thu +1w>

You may also want to have a look at this option:

C-h v org-agenda-skip-deadline-prewarning-if-scheduled RET

-- 
 Bastien

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-07-28 17:25 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-07-27 21:02 Clear non-repeated scheduled time when deadline is repeated Phil Chrapka
2014-07-27 21:44 ` Bastien

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