From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicolas Goaziou Subject: Re: org-timestamp-up/down broken in tip Date: Fri, 22 Jul 2011 10:47:14 +0200 Message-ID: <87hb6er9bh.fsf@gmail.com> References: <87vcuvyxmk.wl%max@openchat.com> <87zkk6ydux.fsf@gnu.org> <87mxg6ycn0.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain Return-path: Received: from eggs.gnu.org ([140.186.70.92]:56729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBOE-0005tu-S1 for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 04:47:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1QkBOC-0002SB-6D for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 04:47:22 -0400 Received: from mail-wy0-f169.google.com ([74.125.82.169]:59045) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1QkBOB-0002Ri-UA for emacs-orgmode@gnu.org; Fri, 22 Jul 2011 04:47:20 -0400 Received: by wyg36 with SMTP id 36so1641346wyg.0 for ; Fri, 22 Jul 2011 01:47:18 -0700 (PDT) In-Reply-To: <87mxg6ycn0.fsf@gnu.org> (Bastien's message of "Fri, 22 Jul 2011 09:53:39 +0200") 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: Bastien Cc: Org Mode List Hello, Bastien writes: > Bastien writes: > >> I reverted this commit. >> >> We need a better solution for the problem this commit was trying to >> solve. > > I should add that I tested Nicolas' patch and it worked okay for me, > but I should have tested it better. So, my bad on this one. In fact, the problem is that when a time-stamp is changed, the old one is completely deleted (which is logical). A marker is useless when text is removed under it. So, saving point, saving marker, or even saving a line-column combination can't help here. Now, the good news are that we can tell exactly in which part of the time-stamp the point was before. A general solution would be to keep point before the new time-stamp, look at it, and move to the right part. A refinement could be to try to keep the same position within the part. If point was at year, month, day (number), the column will be the same because they all have fixed size. But if it was past there, we have to check how far it was from the beginning of the part, and put it there, unless this happens to be after the end of that part, in which case, it will simply be put at the last position in it. I can't work on it before a dozen of hours, though. I will do it then unless someone wants to take care of it before. Regards, -- Nicolas Goaziou