From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Philipp Stephani
> Given that replacing (bobp) with (=3D point 1) does solve this bug, th= e documentation of pre-redisplay-functions
> must be incorrect, i.e. the current buffer is not the buffer of the wi= ndow passed as argument. I think the only
> way how this can happen is that a previous entry in pre-redisplay-func= tions has changed the current buffer.
> Probably the implementation of redisplay--pre-redisplay-functions shou= ld be changed from
> (with-current-buffer (window-buffer win)
> (run-hook-with-args 'pre-redisplay-functions win))
> to
> (run-hook-wrapped 'pre-redisplay-functions
> (lambda (func) (with-current-buffer (window-buffer win)
> (funcall func win)
> nil))
> or so.
>
> So we might try the following: Replace redisplay--pre-redisplay-functi= ons (and indeed, all hooks that
> document anything about the current buffer) as above. Then add (cl-ass= ert (eq (current-buffer)
> (window-buffer window)) to cursor-sensor--detect and remove code such = as (window-point window), because
> that must be equal to (point). WDYT? Or am I misunderstanding somethin= g?
Since the problem that caused the patch to be reverted was with
narrowing, why not simply use
=C2=A0 (=3D point (with-current-buffer (window-buffer window) (point-min)))=
instead of
=C2=A0 (=3D point 1)
?