Subject: Re: bug#56008: 29.0.50; image-mode buffer scrolled down automatically

From: Visuwesh <[email-masked]>
Date: Thu, 16 Jun 2022 19:44:13 +0530

[வியாழன் ஜூன் 16, 2022 16:05] Lars Ingebrigtsen wrote:

> Eli Zaretskii <[email-masked]> writes:
>
>> No, this _is_ specific to eww and shr.  Well, in a way: shr.el does
>> something which directly causes this.  Stay tuned.
>

FWIW, I first saw this when using ement.el which inserts text in buffers
whenever it receives a matrix message.  The bug report I filed in ement.el bug
reporter can be found here: https://github.com/alphapapa/ement.el/issues/58.  
Maybe it is of some value, but I could never get to the root of the
problem.  And I heard another user seeing something similar as well,

    just me or sometimes pdf-view-mode from pdf-tools will automatically
    reset buffer position to initial position (like it just scrolls up the
    buffer). The scenario in which it happens is when I have a frame with
    two windows vertically splited, window 1 is for org-mode, and window 2
    is for pdf-view-mode, and current focus is on window 1.

    seems to be triggered after `Creating LaTeX preview... done.` by
    org-latex-preview and org-fragtog, and when saving the file.

> I wondered whether it had something to do with shr-string-pixel-width
> and friends (which does play games with windows), but stubbing those out
> still led to the same problems, apparently.
>
> (shr-string-pixel-width should be replaced with string-pixel-width (sort
> of), though.)

When I tried to dig around in ement.el's source code, I thought it was
`save-window-excursion' but that turned out not to be the case AFAIU.