I wrote a patch to add point-left and point-entered to overlays.  I ended up adding the implementation in command_loop_1.  The patch is attached - let me know if anything needs to be fixed.

Thanks,
Nathaniel Flath

On Mon, Sep 14, 2009 at 3:22 PM, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
> By cursor motion, do you mean such as the cursor_to function in terminal.c?

No, not exactly.  I mean more generally to trigger the code based on the
motion that happen from command to command.  It could mean a hook in
something like cursor_to, but it could also mean a hook in
command_loop_1 (along the lines of what's done with
adjust_point_for_property.

> Adding these hook to that function seems to behave similarly to when I add
> them to the point motion commands,

The different between point-motion and cursor-motion can only be seen
for operations that do a lot of internal movement.
E.g. diff-context->unified.  Point-motion hooks will be triggered many
times during a run of diff-context->unified (and may accidentally cause
it to fail) whereas cursor motion hooks should only be triggered once
after the command is done, so it can't cause it to fail.

> in that modes or commands that do not appear to move the cursor( any
> mode that traverses the buffer) will still trigger the hooks.

If such a hook is run a bit more often than strictly needed, it's
usually not considered a bug (tho it is recognized as a misfeature).
So it might still be acceptable.


       Stefan