Hi Al,

> On 10/12/2025, Paul D. Nelson wrote:
>> Question: in the above scenario, should the old preview appear (covering
>> the TeX source, like it did before we modified) as soon as point moves
>> away, rather than just for a brief moment while the preview generates?
>
> This behaviour is inherited from the current way of viewing previews. In
> particular, when text is modified the preview is opened, and remains
> open until it is re-generated.
>
> I believe this is a reasonable behaviour. If I am editing text which
> corresponds to a preview, then I likely want to go back to it to edit it
> again and hiding it every time the cursor leaves the region creates
> unnecessary friction while editing source. Also, I believe a reasonable
> expectation is that the text should be replaced with a preview only if
> the preview accurately reflects the source, otherwise the source should
> always be visible.

OK, thanks for discussing.  I agree that it's reasonable.

> If you are referring to the fact that the preview should not be "closed"
> in the brief time while it is being regenerated (i.e. the source should
> be visible), then I can look into modifying this behaviour (though I
> suspect it will be annoying to fix due to the mechanism of replacing
> images that is currently employed).

OK, probably not worth it for now.

>> A related point: the docs suggest that that 'always and 'off-point
>> should yield the same behavior for previews away from point, but this is
>> not the case after modifying a preview and moving point away.
>
> I think it is the case that they are the same from the perspective of
> showing/hiding overlays and frames which show symbols or previews (they
> should be exactly the same when `preview-keep-stale-images` is nil). I
> guess you are referring to what is being shown (icons vs previews). If
> so, this is related to the other point I raised with the inconsistency
> of `preview-keep-stale-images=t` and `preview-visibility-style =
> 'off-point`. So I discuss it below.
>
>> I would have thought that "reusing the image" here would refer to what
>> happens when point moves away from the modified TeX source, like in my
>> response above.
>>
>> In fact, with
>>
>>   preview-visibility-style = 'off-point,
>>
>> does preview-keep-stale-images make any difference at all?
>
> I may be misunderstanding you, but this is exactly my point.
>
> With preview-visibility-style = 'off-point, when the cursor enters the
> preview, the source is shown and an icon appears. When the cursor moves
> away, the source is hidden and the preview reappears. This is the basic
> use case: show the source at point; otherwise show the preview hiding
> the source.
>
> Now consider editing under the same setting. The cursor enters the
> source, the icon appears, and the source is modified. As argued above,
> the source should then remain visible when the cursor leaves to avoid
> unnecessary editing friction. Given that, and with
> preview-keep-stale-images set to t, what should happen when the cursor
> leaves the source?
>
> Currently, preview-keep-stale-images is effectively ignored and the icon
> remains. This matches buframe behaviour: a stale preview is never shown
> away from point. I also think this is consistent with 'off-point: when
> the source is visible, the user does not want to see the preview.

Yes, seems consistent to me so far.

> The alternative is to replace the icon with the stale preview when the
> cursor leaves. I tried this initially and found it jarring. The preview
> appears with the source while the cursor is away, then is replaced with
> an icon when the cursor re-enters the visible source. It felt like a
> pointless visual gimmick with no clear benefit.

OK, makes sense.  I'm happy to leave this aspect as it is for now.

Another related point: when preview-keep-still-images is t and
preview-visibility-style is 'off-point, as the preview starts
regenerating, the construction icon flashes.  I feel like setting
preview-keep-still-images to t should universally suppress the
construction icon.  It does when preview-visibility-style is 'always, so
why not also when it is 'off-point?  (If it did, then
preview-keep-still-images would retain some relevance in the 'off-point
case.)

Some other notes:

If I recall correctly, I did get the chance to test the latest buframe
code on a multi-monitor setup earlier this week and that it continued to
misbehave, but I didn't get the chance to look closely at this.

One thought about deprecation: I think the now-obsolete variable
preview-leave-open-previews-visible should have a custom setter that
sets preview-visibility-style to 'always and preview-keep-still-images
to t, since that would give the most faithful reproduction of previous
behavior.  (Happy to elaborate or provide code if that'd help.)

Thanks, best,

Paul



_______________________________________________
bug-auctex mailing list
[email protected]
https://lists.gnu.org/mailman/listinfo/bug-auctex

Reply via email to