Subject: Re: bug#15312: Info (point-entered, point-left): Doc incomplete, hence incorrect

From: Eli Zaretskii <[email-masked]>
Date: Mon, 16 Sep 2013 20:10:41 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked], [email-masked]
> Date: Mon, 16 Sep 2013 12:15:27 -0400
> 
> > Perhaps we need to step back and talk about the situations where these
> > hooks are supposed to be used.  Because I cannot see any sense in
> > calling the hooks when the values of these properties don't change.
> 
> Agreed, but the code also runs the hook when the value of the
> `point-entered' does not change but the value of some unrelated
> property changes.  That is an error.

Of course.  But I was trying to say that we should formulate a clear
specification for when these hooks shall be called.  What the manual
says now makes little sense to me (and is also somewhat vague).

> >> The right thing to do is to declare point-entered and point-left
> >> properties as obsolete and replace them by something like cursor-entered
> >> and cursor-left properties which are only checked at command boundaries
> >> (or better, checked just before redisplay).
> > Redisplay can be forced as part of a command.
> 
> I know, and I think that for most uses of these kinds of properties we'd
> also want to run the hook when redisplay is called in the middle of
> a command (e.g. in the middle of query-replace).  Note that we'd probably
> also want to run the hook when redisplay is short-circuited by pending input.

Calling this from redisplay might need some non-trivial protocol,
because the hook can legitimately move point, which will re-enter
redisplay, which will call the hook...