emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Repeating TODO are shown every day in the agenda
@ 2011-01-29 18:26 Carl Bolduc
  2011-01-29 20:08 ` Matt Lundin
  0 siblings, 1 reply; 10+ messages in thread
From: Carl Bolduc @ 2011-01-29 18:26 UTC (permalink / raw)
  To: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 487 bytes --]

I have a TODO that is repeating every day like this:
DEADLINE: <2011-01-29 Tue +1d>

Currently, I see this item on every future days in the agenda.

Would there be a way to see this TODO on the day that it is due (today) and
on the past days where this TODO wasn't done? For example, lets say that I
forget to do this TODO today. Tomorrow, I would see this TODO in the agenda
only on January 29th and 30th, I would not see it on January 31st and all
the other future days.

Thanks,
Carl

[-- Attachment #1.2: Type: text/html, Size: 587 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Repeating TODO are shown every day in the agenda
  2011-01-29 18:26 Repeating TODO are shown every day in the agenda Carl Bolduc
@ 2011-01-29 20:08 ` Matt Lundin
  2011-01-29 20:22   ` Jeff Horn
  0 siblings, 1 reply; 10+ messages in thread
From: Matt Lundin @ 2011-01-29 20:08 UTC (permalink / raw)
  To: Carl Bolduc; +Cc: emacs-orgmode

Carl Bolduc <carlbolduc@gmail.com> writes:

> I have a TODO that is repeating every day like this:
> DEADLINE: <2011-01-29 Tue +1d>
>
> Currently, I see this item on every future days in the agenda.
>
> Would there be a way to see this TODO on the day that it is due (today)
> and on the past days where this TODO wasn't done? For example, lets say
> that I forget to do this TODO today. Tomorrow, I would see this TODO in
> the agenda only on January 29th and 30th, I would not see it on January
> 31st and all the other future days.

(setq org-agenda-repeating-timestamp-show-all nil)

Best,
Matt

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-01-29 20:08 ` Matt Lundin
@ 2011-01-29 20:22   ` Jeff Horn
  2011-01-31  7:58     ` Detlef Steuer
  0 siblings, 1 reply; 10+ messages in thread
From: Jeff Horn @ 2011-01-29 20:22 UTC (permalink / raw)
  To: Matt Lundin; +Cc: emacs-orgmode, Carl Bolduc

On Sat, Jan 29, 2011 at 3:08 PM, Matt Lundin <mdl@imapmail.org> wrote:
> (setq org-agenda-repeating-timestamp-show-all nil)

Matt,

Is there a way to set this on a per-todo basis? I want some repeating
items (e.g. class schedules) to repeat, but not others (like my daily
review).

Jeff

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

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

* Re: Repeating TODO are shown every day in the agenda
  2011-01-29 20:22   ` Jeff Horn
@ 2011-01-31  7:58     ` Detlef Steuer
  2011-02-02  9:39       ` Bastien
  0 siblings, 1 reply; 10+ messages in thread
From: Detlef Steuer @ 2011-01-31  7:58 UTC (permalink / raw)
  To: emacs-orgmode

On Sat, 29 Jan 2011 15:22:32 -0500
Jeff Horn <jrhorn424@gmail.com> wrote:

> On Sat, Jan 29, 2011 at 3:08 PM, Matt Lundin <mdl@imapmail.org> wrote:
> > (setq org-agenda-repeating-timestamp-show-all nil)
> 
> Matt,
> 
> Is there a way to set this on a per-todo basis? I want some repeating
> items (e.g. class schedules) to repeat, but not others (like my daily
> review).

And if this is not currently possible, that would be a welcome addition
to org-mode's features! 
I definitely have use cases for such a setting.

That`s only a humble question of course :-) There are already so many
features I don`t know ...

Detlef

> 
> Jeff
> 
> -- 
> Jeffrey Horn
> http://www.failuretorefrain.com/jeff/
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-01-31  7:58     ` Detlef Steuer
@ 2011-02-02  9:39       ` Bastien
  2011-02-02 18:18         ` Jeff Horn
  2011-02-04  9:58         ` Bastien
  0 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2011-02-02  9:39 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

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

Detlef Steuer <detlef.steuer@gmx.de> writes:

> And if this is not currently possible, that would be a welcome
> addition to org-mode's features!  I definitely have use cases for such
> a setting.

The attached patch implements it.

When org-agenda-repeating-timestamp-show-all is set to a list of TODO
keywords, repeating agenda items will only be displayed if they have
this TODO keywords.

Unless anyone objects against this change, I'm willing to commit it.

In the meantime, I welcome tests/feedback.

Thanks to you and Jeff for this idea!


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: repeating-timestamp.patch --]
[-- Type: text/x-patch, Size: 5563 bytes --]

From f121bc5e72ac356f00f1cb31a10d2f042785667a Mon Sep 17 00:00:00 2001
From: Bastien Guerry <bzg@altern.org>
Date: Wed, 2 Feb 2011 10:35:56 +0100
Subject: [PATCH] Make org-agenda-repeating-timestamp-show-all aware of TODO keywords.

* org-agenda.el (org-agenda-repeating-timestamp-show-all):
Allow to use a list of TODO keywords as the value of this
variable.  The agenda will show repeating stamps for entries
matching these TODO keywords.
(org-agenda-get-timestamps, org-agenda-get-deadlines)
(org-agenda-get-scheduled): Allow the use of a list of
keywords in `org-agenda-repeating-timestamp-show-all'.

---
This was suggested by Jeff Horn and supported by Detlef Steuer.
---
 lisp/org-agenda.el |   40 ++++++++++++++++++++++++++--------------
 1 files changed, 26 insertions(+), 14 deletions(-)

diff --git a/lisp/org-agenda.el b/lisp/org-agenda.el
index bbe9d8a..312482e 100644
--- a/lisp/org-agenda.el
+++ b/lisp/org-agenda.el
@@ -1066,10 +1066,15 @@ This option is deprecated, it is better to define a block agenda instead."
 
 (defcustom org-agenda-repeating-timestamp-show-all t
   "Non-nil means show all occurrences of a repeating stamp in the agenda.
-When nil, only one occurrence is shown, either today or the
-nearest into the future."
+When set to a list of strings, only show occurrences of repeating
+stamps for these TODO keywords.  When nil, only one occurrence is
+shown, either today or the nearest into the future."
   :group 'org-agenda-daily/weekly
-  :type 'boolean)
+  :type '(choice
+	  (const :tag "Show repeating stamps" t)
+	  (repeat :tag "Show repeating stamps for these TODO keywords"
+		  (string :tag "TODO Keyword"))
+	  (const :tag "Don't show repeating stamps" nil)))
 
 (defcustom org-scheduled-past-days 10000
   "No. of days to continue listing scheduled items that are not marked DONE.
@@ -4669,14 +4674,17 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
     (goto-char (point-min))
     (while (setq end-of-match (re-search-forward regexp nil t))
       (setq b0 (match-beginning 0)
-	    b3 (match-beginning 3) e3 (match-end 3))
+	    b3 (match-beginning 3) e3 (match-end 3)
+	    todo-state (save-match-data (ignore-errors (org-get-todo-state)))
+	    show-all (or (eq org-agenda-repeating-timestamp-show-all t)
+			 (member todo-state 
+				 org-agenda-repeating-timestamp-show-all)))
       (catch :skip
 	(and (org-at-date-range-p) (throw :skip nil))
 	(org-agenda-skip)
 	(if (and (match-end 1)
 		 (not (= d1 (org-time-string-to-absolute
-			     (match-string 1) d1 nil
-			     org-agenda-repeating-timestamp-show-all))))
+			     (match-string 1) d1 nil show-all))))
 	    (throw :skip nil))
 	(if (and e3
 		 (not (org-diary-sexp-entry (buffer-substring b3 e3) "" date)))
@@ -4693,7 +4701,6 @@ This function is invoked if `org-agenda-todo-ignore-deadlines',
 	      clockp (and org-agenda-include-inactive-timestamps
 			  (or (string-match org-clock-string tmp)
 			      (string-match "]-+\\'" tmp)))
-	      todo-state (ignore-errors (org-get-todo-state))
 	      donep (member todo-state org-done-keywords))
 	(if (or scheduledp deadlinep closedp clockp
 		(and donep org-agenda-skip-timestamp-if-done))
@@ -4904,7 +4911,7 @@ be skipped."
 	 (d1 (calendar-absolute-from-gregorian date))  ; DATE bound by calendar
 	 d2 diff dfrac wdays pos pos1 category tags
 	 suppress-prewarning
-	 ee txt head face s todo-state upcomingp donep timestr)
+	 ee txt head face s todo-state show-all upcomingp donep timestr)
     (goto-char (point-min))
     (while (re-search-forward regexp nil t)
       (setq suppress-prewarning nil)
@@ -4922,9 +4929,12 @@ be skipped."
 	(setq s (match-string 1)
 	      txt nil
 	      pos (1- (match-beginning 1))
+	      todo-state (save-match-data (org-get-todo-state))
+	      show-all (or (eq org-agenda-repeating-timestamp-show-all t)
+			   (member todo-state 
+				    org-agenda-repeating-timestamp-show-all))
 	      d2 (org-time-string-to-absolute
-		  (match-string 1) d1 'past
-		  org-agenda-repeating-timestamp-show-all)
+		  (match-string 1) d1 'past show-all)
 	      diff (- d2 d1)
 	      wdays (if suppress-prewarning
 			(let ((org-deadline-warning-days suppress-prewarning))
@@ -4939,7 +4949,7 @@ be skipped."
 			  (and todayp (not org-agenda-only-exact-dates)))
 		     (= diff 0)))
 	    (save-excursion
-	      (setq todo-state (org-get-todo-state))
+	      ;; (setq todo-state (org-get-todo-state))
 	      (setq donep (member todo-state org-done-keywords))
 	      (if (and donep
 		       (or org-agenda-skip-deadline-if-done
@@ -5024,9 +5034,12 @@ FRACTION is what fraction of the head-warning time has passed."
 	(setq s (match-string 1)
 	      txt nil
 	      pos (1- (match-beginning 1))
+	      todo-state (save-match-data (org-get-todo-state))
+	      show-all (or (eq org-agenda-repeating-timestamp-show-all t)
+			   (member todo-state
+				   org-agenda-repeating-timestamp-show-all))
 	      d2 (org-time-string-to-absolute
-		  (match-string 1) d1 'past
-		  org-agenda-repeating-timestamp-show-all)
+		  (match-string 1) d1 'past show-all)
 	      diff (- d2 d1))
 	(setq pastschedp (and todayp (< diff 0)))
 	;; When to show a scheduled item in the calendar:
@@ -5036,7 +5049,6 @@ FRACTION is what fraction of the head-warning time has passed."
 		       (and todayp (not org-agenda-only-exact-dates)))
 		  (= diff 0))
 	  (save-excursion
-	    (setq todo-state (org-get-todo-state))
 	    (setq donep (member todo-state org-done-keywords))
 	    (if (and donep
 		     (or org-agenda-skip-scheduled-if-done
-- 
1.7.3.5


[-- Attachment #3: Type: text/plain, Size: 14 bytes --]


-- 
 Bastien

[-- Attachment #4: Type: text/plain, Size: 201 bytes --]

_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
Emacs-orgmode@gnu.org
http://lists.gnu.org/mailman/listinfo/emacs-orgmode

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-02-02  9:39       ` Bastien
@ 2011-02-02 18:18         ` Jeff Horn
  2011-02-02 18:35           ` Bastien
  2011-02-04  9:58         ` Bastien
  1 sibling, 1 reply; 10+ messages in thread
From: Jeff Horn @ 2011-02-02 18:18 UTC (permalink / raw)
  To: Bastien; +Cc: Detlef Steuer, emacs-orgmode

On Wed, Feb 2, 2011 at 4:39 AM, Bastien <bastien.guerry@wikimedia.fr> wrote:
> Detlef Steuer <detlef.steuer@gmx.de> writes:
>
>> And if this is not currently possible, that would be a welcome
>> addition to org-mode's features!  I definitely have use cases for such
>> a setting.
>
> The attached patch implements it.
>
> When org-agenda-repeating-timestamp-show-all is set to a list of TODO
> keywords, repeating agenda items will only be displayed if they have
> this TODO keywords.
>
> Unless anyone objects against this change, I'm willing to commit it.
>
> In the meantime, I welcome tests/feedback.
>
> Thanks to you and Jeff for this idea!

Bastien,

I like this change. But for me, when I mark a repeating task with the
keyword "APPT" as DONE, the task is re-scheduled with the TODO keyword
instead of APPT. It usually isn't a big deal, but I means I can't use
the patch as intended.

Would it be difficult to add a "REPEAT_VISIBLE" property that defaults
to t, but when nil hides a repeating task for all future days?

Maybe I have something setup incorrectly that is making repeated tasks
TODO instead of their original keyword. If so, I could modify my
configuration and the patch would work as expected (for my use case,
anyway).

Thanks again!

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-02-02 18:18         ` Jeff Horn
@ 2011-02-02 18:35           ` Bastien
  2011-02-02 18:39             ` Jeff Horn
  2011-02-03  8:24             ` Detlef Steuer
  0 siblings, 2 replies; 10+ messages in thread
From: Bastien @ 2011-02-02 18:35 UTC (permalink / raw)
  To: Jeff Horn; +Cc: Detlef Steuer, emacs-orgmode

Hi Jeff,

Jeff Horn <jrhorn424@gmail.com> writes:

> I like this change. But for me, when I mark a repeating task with the
> keyword "APPT" as DONE, the task is re-scheduled with the TODO keyword
> instead of APPT. It usually isn't a big deal, but I means I can't use
> the patch as intended.

Have a look at `org-todo-repeat-to-state':

,----[ org-todo-repeat-to-state ]
| The TODO state to which a repeater should return the repeating task.
| By default this is the first task in a TODO sequence, or the previous state
| in a TODO_TYP set.  But you can specify another task here.
| alternatively, set the :REPEAT_TO_STATE: property of the entry.
`----

> Would it be difficult to add a "REPEAT_VISIBLE" property that defaults
> to t, but when nil hides a repeating task for all future days?

I'd rather use the solution I implemented.  But I still wait for
comments from others.

HTH,

-- 
 Bastien

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-02-02 18:35           ` Bastien
@ 2011-02-02 18:39             ` Jeff Horn
  2011-02-03  8:24             ` Detlef Steuer
  1 sibling, 0 replies; 10+ messages in thread
From: Jeff Horn @ 2011-02-02 18:39 UTC (permalink / raw)
  To: Bastien; +Cc: Detlef Steuer, emacs-orgmode

On Wed, Feb 2, 2011 at 1:35 PM, Bastien <bastien.guerry@wikimedia.fr> wrote:
> Have a look at `org-todo-repeat-to-state':
>
> ,----[ org-todo-repeat-to-state ]
> | The TODO state to which a repeater should return the repeating task.
> | By default this is the first task in a TODO sequence, or the previous state
> | in a TODO_TYP set.  But you can specify another task here.
> | alternatively, set the :REPEAT_TO_STATE: property of the entry.
> `----

Thanks, Bastien. This property will work nicely.

-- 
Jeffrey Horn
http://www.failuretorefrain.com/jeff/

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

* Re: Repeating TODO are shown every day in the agenda
  2011-02-02 18:35           ` Bastien
  2011-02-02 18:39             ` Jeff Horn
@ 2011-02-03  8:24             ` Detlef Steuer
  1 sibling, 0 replies; 10+ messages in thread
From: Detlef Steuer @ 2011-02-03  8:24 UTC (permalink / raw)
  To: emacs-orgmode

On Wed, 02 Feb 2011 19:35:52 +0100
Bastien <bastien.guerry@wikimedia.fr> wrote:

> Hi Jeff,
> 
> Jeff Horn <jrhorn424@gmail.com> writes:
> 
> > I like this change. But for me, when I mark a repeating task with the
> > keyword "APPT" as DONE, the task is re-scheduled with the TODO keyword
> > instead of APPT. It usually isn't a big deal, but I means I can't use
> > the patch as intended.
> 
> Have a look at `org-todo-repeat-to-state':
> 
> ,----[ org-todo-repeat-to-state ]
> | The TODO state to which a repeater should return the repeating task.
> | By default this is the first task in a TODO sequence, or the previous state
> | in a TODO_TYP set.  But you can specify another task here.
> | alternatively, set the :REPEAT_TO_STATE: property of the entry.
> `----
> 
> > Would it be difficult to add a "REPEAT_VISIBLE" property that defaults
> > to t, but when nil hides a repeating task for all future days?
> 
> I'd rather use the solution I implemented.  But I still wait for
> comments from others.
> 

Does the job for me! 
Thx a lot!

Detlef


> HTH,
> 
> -- 
>  Bastien
> 
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
> 

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

* Re: Re: Repeating TODO are shown every day in the agenda
  2011-02-02  9:39       ` Bastien
  2011-02-02 18:18         ` Jeff Horn
@ 2011-02-04  9:58         ` Bastien
  1 sibling, 0 replies; 10+ messages in thread
From: Bastien @ 2011-02-04  9:58 UTC (permalink / raw)
  To: Detlef Steuer; +Cc: emacs-orgmode

Bastien <bastien.guerry@wikimedia.fr> writes:

> Detlef Steuer <detlef.steuer@gmx.de> writes:
>
>> And if this is not currently possible, that would be a welcome
>> addition to org-mode's features!  I definitely have use cases for such
>> a setting.
>
> The attached patch implements it.

I've now merged this change.

Thanks for those who tested it!

-- 
 Bastien

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

end of thread, other threads:[~2011-02-04  9:58 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-29 18:26 Repeating TODO are shown every day in the agenda Carl Bolduc
2011-01-29 20:08 ` Matt Lundin
2011-01-29 20:22   ` Jeff Horn
2011-01-31  7:58     ` Detlef Steuer
2011-02-02  9:39       ` Bastien
2011-02-02 18:18         ` Jeff Horn
2011-02-02 18:35           ` Bastien
2011-02-02 18:39             ` Jeff Horn
2011-02-03  8:24             ` Detlef Steuer
2011-02-04  9:58         ` 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).