emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* [PATCH] Fix task cloning for repeating tasks
@ 2012-02-25  2:38 Bernt Hansen
  2012-02-25  2:43 ` Bernt Hansen
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2012-02-25  2:38 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

org.el (org-clone-subtree-with-time-shift): Fix task cloning for
repeating tasks using .+n and ++n syntax

Tasks with repeaters using .+n and ++n syntax retain the repeater in
all of the clones causing duplicate tasks.  These tasks are now
handled the same as the regular repeating task using +n syntax.
---
 lisp/org.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a81f7fc..f24c69f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7946,7 +7946,7 @@ the following will happen:
   repeater intact.
 - the start days in the repeater in the original entry will be shifted
   to past the last clone.
-I this way you can spell out a number of instances of a repeating task,
+In this way you can spell out a number of instances of a repeating task,
 and still retain the repeater to cover future instances of the task."
   (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
   (let (beg end template task idprop
@@ -7973,7 +7973,7 @@ and still retain the repeater to cover future instances of the task."
     (setq end (point))
     (setq template (buffer-substring beg end))
     (when (and doshift
-	       (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
+	       (string-match "<[^<>\n]+ [.+]?\\+[0-9]+[dwmy][^<>\n]*>" template))
       (delete-region beg end)
       (setq end beg)
       (setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
@@ -8004,7 +8004,7 @@ and still retain the repeater to cover future instances of the task."
 		(while (re-search-forward org-ts-regexp nil t)
 		  (save-excursion
 		    (goto-char (match-beginning 0))
-		    (if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)")
+		    (if (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[dwmy]\\)")
 			(delete-region (match-beginning 1) (match-end 1)))))))
 	    (setq task (buffer-string)))
 	  (insert task))
-- 
1.7.9.48.g85da4d

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

* [PATCH] Fix task cloning for repeating tasks
  2012-02-25  2:38 [PATCH] Fix task cloning for repeating tasks Bernt Hansen
@ 2012-02-25  2:43 ` Bernt Hansen
  2012-03-04 19:23   ` [accepted] " David Maus
  0 siblings, 1 reply; 3+ messages in thread
From: Bernt Hansen @ 2012-02-25  2:43 UTC (permalink / raw)
  To: emacs-orgmode; +Cc: Bernt Hansen

* org.el (org-clone-subtree-with-time-shift): Fix task cloning for
repeating tasks using .+n and ++n syntax

Tasks with repeaters using .+n and ++n syntax retain the repeater in
all of the clones causing duplicate tasks.  These tasks are now
handled the same as the regular repeating task using +n syntax.
---
Doh!  Let's fix the changelog entry... (missing * in the previous version)

-Bernt

 lisp/org.el |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/lisp/org.el b/lisp/org.el
index a81f7fc..f24c69f 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -7946,7 +7946,7 @@ the following will happen:
   repeater intact.
 - the start days in the repeater in the original entry will be shifted
   to past the last clone.
-I this way you can spell out a number of instances of a repeating task,
+In this way you can spell out a number of instances of a repeating task,
 and still retain the repeater to cover future instances of the task."
   (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
   (let (beg end template task idprop
@@ -7973,7 +7973,7 @@ and still retain the repeater to cover future instances of the task."
     (setq end (point))
     (setq template (buffer-substring beg end))
     (when (and doshift
-	       (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
+	       (string-match "<[^<>\n]+ [.+]?\\+[0-9]+[dwmy][^<>\n]*>" template))
       (delete-region beg end)
       (setq end beg)
       (setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
@@ -8004,7 +8004,7 @@ and still retain the repeater to cover future instances of the task."
 		(while (re-search-forward org-ts-regexp nil t)
 		  (save-excursion
 		    (goto-char (match-beginning 0))
-		    (if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)")
+		    (if (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[dwmy]\\)")
 			(delete-region (match-beginning 1) (match-end 1)))))))
 	    (setq task (buffer-string)))
 	  (insert task))
-- 
1.7.9.48.g85da4d

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

* [accepted]  Fix task cloning for repeating tasks
  2012-02-25  2:43 ` Bernt Hansen
@ 2012-03-04 19:23   ` David Maus
  0 siblings, 0 replies; 3+ messages in thread
From: David Maus @ 2012-03-04 19:23 UTC (permalink / raw)
  To: emacs-orgmode

Patch 1185 (http://patchwork.newartisans.com/patch/1185/) is now "accepted".

Maintainer comment: none

This relates to the following submission:

http://mid.gmane.org/%3C1330137796-18986-1-git-send-email-bernt%40norang.ca%3E

Here is the original message containing the patch:

> Content-Type: text/plain; charset="utf-8"
> MIME-Version: 1.0
> Content-Transfer-Encoding: 7bit
> Subject: [O] Fix task cloning for repeating tasks
> Date: Sat, 25 Feb 2012 07:43:16 -0000
> From: Bernt Hansen <bernt@norang.ca>
> X-Patchwork-Id: 1185
> Message-Id: <1330137796-18986-1-git-send-email-bernt@norang.ca>
> To: emacs-orgmode@gnu.org
> Cc: Bernt Hansen <bernt@norang.ca>
> 
> * org.el (org-clone-subtree-with-time-shift): Fix task cloning for
> repeating tasks using .+n and ++n syntax
> 
> Tasks with repeaters using .+n and ++n syntax retain the repeater in
> all of the clones causing duplicate tasks.  These tasks are now
> handled the same as the regular repeating task using +n syntax.
> 
> ---
> Doh!  Let's fix the changelog entry... (missing * in the previous version)
> 
> -Bernt
> 
>  lisp/org.el |    6 +++---
>  1 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/lisp/org.el b/lisp/org.el
> index a81f7fc..f24c69f 100644
> --- a/lisp/org.el
> +++ b/lisp/org.el
> @@ -7946,7 +7946,7 @@ the following will happen:
>    repeater intact.
>  - the start days in the repeater in the original entry will be shifted
>    to past the last clone.
> -I this way you can spell out a number of instances of a repeating task,
> +In this way you can spell out a number of instances of a repeating task,
>  and still retain the repeater to cover future instances of the task."
>    (interactive "nNumber of clones to produce: \nsDate shift per clone (e.g. +1w, empty to copy unchanged): ")
>    (let (beg end template task idprop
> @@ -7973,7 +7973,7 @@ and still retain the repeater to cover future instances of the task."
>      (setq end (point))
>      (setq template (buffer-substring beg end))
>      (when (and doshift
> -	       (string-match "<[^<>\n]+ \\+[0-9]+[dwmy][^<>\n]*>" template))
> +	       (string-match "<[^<>\n]+ [.+]?\\+[0-9]+[dwmy][^<>\n]*>" template))
>        (delete-region beg end)
>        (setq end beg)
>        (setq nmin 0 nmax (1+ nmax) n-no-remove nmax))
> @@ -8004,7 +8004,7 @@ and still retain the repeater to cover future instances of the task."
>  		(while (re-search-forward org-ts-regexp nil t)
>  		  (save-excursion
>  		    (goto-char (match-beginning 0))
> -		    (if (looking-at "<[^<>\n]+\\( +\\+[0-9]+[dwmy]\\)")
> +		    (if (looking-at "<[^<>\n]+\\( +[.+]?\\+[0-9]+[dwmy]\\)")
>  			(delete-region (match-beginning 1) (match-end 1)))))))
>  	    (setq task (buffer-string)))
>  	  (insert task))
> 

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

end of thread, other threads:[~2012-03-04 19:23 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-02-25  2:38 [PATCH] Fix task cloning for repeating tasks Bernt Hansen
2012-02-25  2:43 ` Bernt Hansen
2012-03-04 19:23   ` [accepted] " David Maus

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