From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: [BUG] Changing TODO states sometimes modifies the schedulingof the next heading Date: Wed, 20 Jul 2011 10:28:07 +0200 Message-ID: <87k4bds6eg.fsf@gmail.com> References: <878vvrv4l7.fsf@fastmail.fm> <877hbbjngq.fsf@fastmail.fm> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Return-path: Received: from eggs.gnu.org ([140.186.70.92]:47052) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjS8i-0004NK-7D for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 04:28:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QjS8e-0001Zs-Vm for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 04:28:18 -0400 Received: from mail-ey0-f174.google.com ([209.85.215.174]:57828) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QjS8e-0001Zj-Js for emacs-orgmode@gnu.org; Wed, 20 Jul 2011 04:28:16 -0400 Received: by eyx24 with SMTP id 24so946978eyx.19 for ; Wed, 20 Jul 2011 01:28:15 -0700 (PDT) In-Reply-To: (Tom's message of "Mon, 4 Apr 2011 20:25:00 +0000 (UTC)") 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: Tom Cc: emacs-orgmode@gnu.org --=-=-= Content-Type: text/plain Hello, Tom writes: > Bottom line: the problem does not occur in the English locale, > because there all day abbreviations are 3 chars long, so the > above described simple way of restoring the cursor position > always works. But this is not true for all locales, so org > shouldn't rely on that. Would you mind telling me if the following patch fixes your problem? If so, I'll apply it to the code base. Regards, -- Nicolas Goaziou --=-=-= Content-Type: text/x-patch Content-Disposition: attachment; filename=0001-Fix-bug-with-TODO-states-changes-modifying-schedulin.patch >From 6ab4222325f304d89bb161085956bc3c2d1d7617 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 20 Jul 2011 10:18:31 +0200 Subject: [PATCH] Fix bug with TODO states changes modifying scheduling of next headline * lisp/org.el (org-timestamp-change): some locales don't use the same length for date abbreviations. Set a marker at origin in case length of new timestamp is different. Thanks to Tom for analyzing this. --- lisp/org.el | 3 ++- 1 files changed, 2 insertions(+), 1 deletions(-) diff --git a/lisp/org.el b/lisp/org.el index fee13b7..c08ab75 100644 --- a/lisp/org.el +++ b/lisp/org.el @@ -15567,7 +15567,7 @@ With prefix ARG, change that many days." The date will be changed by N times WHAT. WHAT can be `day', `month', `year', `minute', `second'. If WHAT is not given, the cursor position in the timestamp determines what will be changed." - (let ((pos (point)) + (let ((pos (copy-marker (point))) with-hm inactive (dm (max (nth 1 org-time-stamp-rounding-minutes) 1)) org-ts-what @@ -15631,6 +15631,7 @@ in the timestamp determines what will be changed." (org-insert-time-stamp time with-hm inactive nil nil extra)) (org-clock-update-time-maybe) (goto-char pos) + (move-marker pos nil) ;; Try to recenter the calendar window, if any (if (and org-calendar-follow-timestamp-change (get-buffer-window "*Calendar*" t) -- 1.7.6 --=-=-=--