From mboxrd@z Thu Jan 1 00:00:00 1970 From: Phil Chrapka Subject: Clear non-repeated scheduled time when deadline is repeated Date: Sun, 27 Jul 2014 17:02:53 -0400 Message-ID: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=001a11c13e7e419ce004ff332106 Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:49190) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBVat-00044X-23 for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 17:03:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XBVao-00031I-5f for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 17:02:59 -0400 Received: from mail-qa0-x232.google.com ([2607:f8b0:400d:c00::232]:33385) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XBVan-00031C-Vq for emacs-orgmode@gnu.org; Sun, 27 Jul 2014 17:02:54 -0400 Received: by mail-qa0-f50.google.com with SMTP id s7so6852044qap.23 for ; Sun, 27 Jul 2014 14:02:53 -0700 (PDT) List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: emacs-orgmode@gnu.org --001a11c13e7e419ce004ff332106 Content-Type: text/plain; charset=UTF-8 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 --001a11c13e7e419ce004ff332106 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Hi,=C2=A0
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 sour= ce, 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 idea= s about this type of workflow?

Question:
I use org-mo= de to manage some deadlines for repeated tasks. For example, I may have som= ething like the following:
* TODO My Weekly Task
=C2=A0 DEADLINE <2013-08-10 Sat +1w>
If I= mark the task as DONE, then the deadline automatically increments to the n= ext week as expected. However, I also like to use the SCHEDULED time to ind= icate when during the week I would like to actually do that task, for examp= le:
* TODO My Weekly Task
=C2=A0 DEADLINE <2013-08-10 Sat +1w> SCHEDUL= ED: <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 fol= lowing:
* TODO My Weekly Task
=C2=A0 DEADLINE <2013-08-17 Sat +1w> SCHEDUL= ED: <2013-08-08 Thu>
...and the task still appears in the agenda v= iew for today, even though it has been completed.
Is it possible, for ta= sks that have a repeated DEADLINE, to get Org-Mode to clear the non-repeate= d 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."
=C2=A0 =C2=A0 (setq type (if (match-end 1= ) org-scheduled-string
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0(= if (match-end 3) org-deadline-string "Plain:"))
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 ts (match-string (if (match-end 2) 2 (if= (match-end 4) 4 0))))
- =C2=A0 (when (string-match "\\([.+]\\)?\\(= \\+[0-9]+\\)\\([hdwmy]\\)" ts)
+ =C2=A0 (if (not (string-match &quo= t;\\([.+]\\)?\\(\\+[0-9]+\\)\\([hdwmy]\\)" ts))
+ =C2=A0 =C2=A0 =C2=A0 (org-remove-timestamp-with-keyword org-scheduled-str= ing)
=C2=A0 =C2=A0 =C2=A0 (setq n (string-to-number (match-string 2 ts))=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 what (match-string 3 ts))
=C2=A0 =C2=A0 = =C2=A0 (if (equal what "w") (setq n (* n 7) what "d"))= =C2=A0

Thanks,
Phil
--001a11c13e7e419ce004ff332106--