Eli Za=
retskii <
eliz@gnu.org> schrieb am=
Sa., 31. Okt. 2015 um 14:34=C2=A0Uhr:
> From: Michael Welsh Duggan <mwd@md5i.com>
> Date: Sat, 31 Oct 2015 09:07:05 -0400
>
> > I've changed the (bobp) to (=3D point 1).=C2=A0 I'll run =
it for a couple of
> > weeks and report back.
>
> This change seems to have done the trick.=C2=A0 I have not encountered=
the
> error in several days.
Thanks for testing.=C2=A0 I pushed the change, and I'm arking this bug =
as
done.
This change was =C2=A0reverted in 76ef52267cf887e3e1aa6d25b3b16dd0601=
dd459.
It also doesn't seem correct. cursor-sensor--detect is=
only used in pre-redisplay-functions, and the documentation of that variab=
le says:
"Hook run just before redisplay.
It is ca=
lled in each window that is to be redisplayed.=C2=A0 It takes one argument,=
which is the window that will be redisplayed.=C2=A0 When run, th=
e =E2=80=98current-buffer=E2=80=99
is set to the buffer displayed=
in that window."
That means that (bobp) is correct and (=3D=
point 1) cannot give a different result, unless narrowing is in effect (th=
en only bobp is correct).
Given that replacing (bobp) with (=3D p=
oint 1) does solve this bug, the documentation of pre-redisplay-functions m=
ust be incorrect, i.e. the current buffer is not the buffer of the window p=
assed as argument. I think the only way how this can happen is that a previ=
ous entry in pre-redisplay-functions has changed the current buffer. Probab=
ly the implementation of redisplay--pre-redisplay-functions should be chang=
ed from=C2=A0
(with-current-buffer (window-buffer win)
=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 (run-hook-with-args 'pre-redisplay-f=
unctions win))
to
(run-hook-wrapped 'pre-redisplay-=
functions
=C2=A0 (lambda (func) (with-current-buffer (window-buff=
er win)
=C2=A0 =C2=A0 =C2=A0(funcall func win)
=C2=A0 =
=C2=A0 =C2=A0nil))
or so.
So we might tr=
y the following: Replace redisplay--pre-redisplay-functions (and indeed, al=
l hooks that document anything about the current buffer) as above. Then add=
(cl-assert (eq (current-buffer) (window-buffer window)) to cursor-sensor--=
detect and remove =C2=A0code such as (window-point window), because that mu=
st be equal to (point). WDYT? Or am I misunderstanding something?=C2=A0