From mboxrd@z Thu Jan 1 00:00:00 1970 From: Bernt Hansen Subject: [PATCH] Fix task cloning for repeating tasks Date: Fri, 24 Feb 2012 21:38:13 -0500 Message-ID: <1330137493-18784-1-git-send-email-bernt@norang.ca> Return-path: Received: from eggs.gnu.org ([208.118.235.92]:43174) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S17Wz-0001i7-Cz for emacs-orgmode@gnu.org; Fri, 24 Feb 2012 21:38:48 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1S17Ws-0001RN-6X for emacs-orgmode@gnu.org; Fri, 24 Feb 2012 21:38:41 -0500 Received: from mho-02-ewr.mailhop.org ([204.13.248.72]:52074) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1S17Ws-0001Qg-2a for emacs-orgmode@gnu.org; Fri, 24 Feb 2012 21:38:34 -0500 Received: from cpe000102d0fe75-cm0012256ecbde.cpe.net.cable.rogers.com ([99.239.165.89] helo=mail.norang.ca) by mho-02-ewr.mailhop.org with esmtpsa (TLSv1:AES256-SHA:256) (Exim 4.72) (envelope-from ) id 1S17Wk-0009zZ-Md for emacs-orgmode@gnu.org; Sat, 25 Feb 2012 02:38:26 +0000 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 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