emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Tom <adatgyujto@gmail.com>
Cc: emacs-orgmode@gnu.org
Subject: Re: [BUG] Changing TODO states sometimes	modifies	the	schedulingof the next heading
Date: Wed, 20 Jul 2011 10:28:07 +0200	[thread overview]
Message-ID: <87k4bds6eg.fsf@gmail.com> (raw)
In-Reply-To: <loom.20110404T222130-385@post.gmane.org> (Tom's message of "Mon, 4 Apr 2011 20:25:00 +0000 (UTC)")

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

Hello,

Tom <adatgyujto@gmail.com> 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

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Fix-bug-with-TODO-states-changes-modifying-schedulin.patch --]
[-- Type: text/x-patch, Size: 1438 bytes --]

From 6ab4222325f304d89bb161085956bc3c2d1d7617 Mon Sep 17 00:00:00 2001
From: Nicolas Goaziou <n.goaziou@gmail.com>
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


  reply	other threads:[~2011-07-20  8:28 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-03  6:46 [BUG] Changing TODO states sometimes modifies the scheduling of the next heading Tom
2011-04-03  8:35 ` Tom
2011-04-03 13:37   ` Matt Lundin
2011-04-03 14:09     ` [BUG] Changing TODO states sometimes modifies the schedulingof " Tom
2011-04-03 16:42       ` Matt Lundin
2011-04-03 17:49         ` Tom
2011-04-04 20:25           ` Tom
2011-07-20  8:28             ` Nicolas Goaziou [this message]
2011-07-21 19:25               ` Tom
2011-07-22  7:31                 ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.orgmode.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87k4bds6eg.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=adatgyujto@gmail.com \
    --cc=emacs-orgmode@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).