Subject: Re: bug#65214: 29.1; Tall images in 'image-mode' can't be scrolled with 'pixel-scroll-precision-mode' on

From: Rahguzar <[email-masked]>
Date: Sun, 27 Aug 2023 10:53:20 +0200

Hi Po,

Po Lu <[email-masked]> writes:

> Rahguzar <[email-masked]> writes:
>
>> This is just a ping. Any chance these changes will be part of Emacs
>> 29.2? I think they are a big improvement over large images not scrolling
>> at all.
>
> Alas no, by reason of our policy against risky behavioral changes to the
> release branch.
>
> I have asked several other users of p-s-p-m to comment on this offline,
> but am still waiting for responses from some of them.

Makes sense, since the problem is in an edge case. Since it affects,
'image-mode' which is built in and also some modes which rely on the
functionality provided 'image-mode' is it possible to go with one of the
following workarounds:

1) Special case the handling of buffers with only one line. I don't know
if this can be made safe enough.

2) Modify the 'image-mode' to have a newline after the image. It seems
like a good enough solutions to me: as far as I can tell 'image-mode'
commands just care about the fact that point-min has the display
property holding the image. But most likely there are unintended
consequences I am not thinking of.

3) Have an easy way of disable 'pixel-scroll-precision-mode' buffer
locally. This can then be used by 'image-mode' and others modes. This
might be the best solution since 'image-mode' has sets its own
'mwheel-scroll-up/down-function' to keep track of 'vscroll' and
reapplies it when needed. As far as I can tell this bookkeeping can't be
done with 'pixel-scroll-precision-mode'. I think a non-default value for
'mwheel-scroll-up/down-function' is a good heuristic for when not to
enable 'pixel-scroll-precision-mode' in a buffer but that might also be
too broad a measure.

Or maybe some other way I am not thinking of.

Best,
Rahguzar