emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Possible `point-entered' `point-left' Text Property Bug


From: Richard Stallman
Subject: Re: Possible `point-entered' `point-left' Text Property Bug
Date: Fri, 12 May 2006 00:15:45 -0400

    When executing previous-line and next-line, a situation can arise
    where no "character before point" is found for the point left, whereas
    one exists for the point entered (or vice versa).  That's why the
    point-entered/left hooks are called.

That seems like correct behavior to me.  At least, more correct than
the alternative.  If the entered/left functions are called in this
case, they can detect this case and decide to do nothing.  But if we
change the code NOT to call them in this case, and some program wants
them to be called, there is nothing it can do.

Does this behavior really cause a problem that is hard to work around?
Or did it just strike people as incorrect?

                                          I don't know why this happens
    even when moving vertically with point in the middle of a line, but I
    am not familiar with the point motion code.

I am really surprised about this because line-move-1 binds
inhibit-point-motion-hooks to t, which ought to prevent the
point-entered/left functions from even being checked for all the
intermediate positions.

The easy way to determine why they get called is to put breakpoints
on the call2 lines:

      if (! EQ (leave_before, enter_before) && !NILP (leave_before))
        call2 (leave_before, make_number (old_position),
               make_number (charpos));
      if (! EQ (leave_after, enter_after) && !NILP (leave_after))
        call2 (leave_after, make_number (old_position),
               make_number (charpos));

      if (! EQ (enter_before, leave_before) && !NILP (enter_before))
        call2 (enter_before, make_number (old_position),
               make_number (charpos));
      if (! EQ (enter_after, leave_after) && !NILP (enter_after))
        call2 (enter_after, make_number (old_position),
               make_number (charpos));




reply via email to

[Prev in Thread] Current Thread [Next in Thread]