emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
From: Nicolas Goaziou <n.goaziou@gmail.com>
To: Bastien <bzg@altern.org>
Cc: Org Mode List <emacs-orgmode@gnu.org>
Subject: Re: org-timestamp-up/down broken in tip
Date: Fri, 22 Jul 2011 10:47:14 +0200	[thread overview]
Message-ID: <87hb6er9bh.fsf@gmail.com> (raw)
In-Reply-To: <87mxg6ycn0.fsf@gnu.org> (Bastien's message of "Fri, 22 Jul 2011 09:53:39 +0200")

Hello,

Bastien <bzg@altern.org> writes:

> Bastien <bzg@altern.org> 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

  reply	other threads:[~2011-07-22  8:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-22  0:20 org-timestamp-up/down broken in tip Max Mikhanosha
2011-07-22  6:55 ` Sebastien Vauban
2011-07-22  7:17   ` Bastien
2011-07-22  7:27 ` Bastien
2011-07-22  7:53   ` Bastien
2011-07-22  8:47     ` Nicolas Goaziou [this message]
2011-07-22 20:11       ` Nicolas Goaziou
2011-07-24 19:10         ` Bastien
2011-07-25 10:01           ` Nicolas Goaziou
2011-07-25 13:57             ` 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=87hb6er9bh.fsf@gmail.com \
    --to=n.goaziou@gmail.com \
    --cc=bzg@altern.org \
    --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).