From mboxrd@z Thu Jan 1 00:00:00 1970 From: Carsten Dominik Subject: Re: [PATCH] Update all ++ repeaters in an entry (loop variables weren't getting reset) Date: Fri, 22 Oct 2010 09:59:20 +0200 Message-ID: <5C48C342-47C1-4A09-A854-E93905056EA8@gmail.com> References: <14027.1287664132@iu.edu> Mime-Version: 1.0 (Apple Message framework v936) Content-Type: text/plain; charset=US-ASCII; format=flowed; delsp=yes Content-Transfer-Encoding: 7bit Return-path: Received: from [140.186.70.92] (port=39261 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1P9ClI-00024U-Em for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 04:14:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1P9CX5-0005sB-K8 for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 03:59:24 -0400 Received: from mail-ey0-f169.google.com ([209.85.215.169]:40204) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1P9CX5-0005s5-FX for emacs-orgmode@gnu.org; Fri, 22 Oct 2010 03:59:23 -0400 Received: by eydd26 with SMTP id d26so217328eyd.0 for ; Fri, 22 Oct 2010 00:59:22 -0700 (PDT) In-Reply-To: <14027.1287664132@iu.edu> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: "Andrew J. Korty" Cc: emacs-orgmode@gnu.org Applied, thanks. - Carsten On Oct 21, 2010, at 2:28 PM, Andrew J. Korty wrote: > See http://www.mail-archive.com/emacs-orgmode@gnu.org/msg30284.html. > This patch is against release_7.01h. > > ajk > > --- > lisp/org.el | 20 ++++++++++---------- > 1 files changed, 10 insertions(+), 10 deletions(-) > > diff --git a/lisp/org.el b/lisp/org.el > index d33bf4e..52e501e 100644 > --- a/lisp/org.el > +++ b/lisp/org.el > @@ -11369,7 +11369,6 @@ This function is run automatically after > each state change to a DONE state." > (msg "Entry repeats: ") > (org-log-done nil) > (org-todo-log-states nil) > - (nshiftmax 10) (nshift 0) > re type n what ts time to-state) > (when repeat > (if (eq org-log-repeat t) (setq org-log-repeat 'state)) > @@ -11416,15 +11415,16 @@ This function is run automatically after > each state change to a DONE state." > (- (time-to-days (current-time)) (time-to-days time)) > 'day)) > ((equal (match-string 1 ts) "+") > - (while (or (= nshift 0) > - (<= (time-to-days time) (time-to-days > (current-time)))) > - (when (= (incf nshift) nshiftmax) > - (or (y-or-n-p (message "%d repeater intervals were > not enough to shift date past today. Continue? " nshift)) > - (error "Abort"))) > - (org-timestamp-change n (cdr (assoc what whata))) > - (org-at-timestamp-p t) > - (setq ts (match-string 1)) > - (setq time (save-match-data (org-time-string-to-time > ts)))) > + (let ((nshiftmax 10) (nshift 0)) > + (while (or (= nshift 0) > + (<= (time-to-days time) (time-to-days > (current-time)))) > + (when (= (incf nshift) nshiftmax) > + (or (y-or-n-p (message "%d repeater intervals > were not enough to shift date past today. Continue? " nshift)) > + (error "Abort"))) > + (org-timestamp-change n (cdr (assoc what whata))) > + (org-at-timestamp-p t) > + (setq ts (match-string 1)) > + (setq time (save-match-data (org-time-string-to- > time ts))))) > (org-timestamp-change (- n) (cdr (assoc what whata))) > ;; rematch, so that we have everything in place for the > real shift > (org-at-timestamp-p t) > -- > 1.7.3.1 > > _______________________________________________ > 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 - Carsten