This change was =C2=A0=
reverted in=C2=A076ef52267cf887e3e1aa6d25b3b16dd0601dd459.
It also doesn't seem correct. cursor-sensor--detect is o=
nly used in pre-redisplay-functions, and the documentation of that variable=
says:
"Hook run just before redisplay.<=
/div>
It is called in each window that is to be red=
isplayed.=C2=A0 It takes one argument,
which =
is the window that will be redisplayed.=C2=A0 When run, the =E2=80=98curren=
t-buffer=E2=80=99
is set to the buffer displa=
yed in that window."
That means that (bo=
bp) is correct and (=3D point 1) cannot give a different result, unless nar=
rowing is in effect (then only bobp is correct).
Given that replacing (bobp) with (=3D point 1) does solve this bug, the=
documentation of=C2=A0pre-redisplay-functions must be incorrect, i.e. the =
current buffer is not the buffer of the window passed as argument. I think =
the only way how this can happen is that a previous entry in pre-redisplay-=
functions has changed the current buffer. Probably the implementation of re=
display--pre-redisplay-functions should be changed from=C2=A0
(with-current-buffer (window-buff=
er win)
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (r=
un-hook-with-args 'pre-redisplay-functions win))
to
(run-hook-wrapped 'pre-=
redisplay-functions
=C2=A0 (lambda (func) (wi=
th-current-buffer (window-buffer win)
=C2=A0 =
=C2=A0 =C2=A0(funcall func win)
=C2=A0 =C2=A0=
=C2=A0nil))
or so.