Subject: Re: bug#62445: 13.1.10; bug in preview-region applied to repeated math environments

From: Arash Esbati <[email-masked]>
Date: Wed, 03 Apr 2024 23:43:07 +0200

Hi Paul,

Paul Nelson <[email-masked]> writes:

> I'll be happy to provide a patch for this.

That's a good start :-)

> Before doing so, let me clarify my motivation and ask for some advice.
> I (and at least 6 others) have been using the package
> https://github.com/ultronozm/czm-preview.el, which implements this fix
> together with some other features.

Yes, I noticed you were working on different lisp libraries around TeX 👍

> The implementation relies on 10 pieces of advice applied to preview-*
> and TeX-* functions.  I'd like to eliminate the use of advice, so that
> the package is less brittle.  Fixing this bug would be one step
> towards that goal; the others would involve adding hooks and
> customization options to preview.el (without modifying its current
> operation -- I don't want to introduce instability).

This is definitely important.  You may have noticed that the general
author of preview is now inactive, and the library is in sort of
maintenance mode, so we have to be careful. 

> Thus, to create this patch, I'll isolate the relevant modifications
> from my overridden versions of preview-region and
> preview-parse-messages.  Later, in a separate report, I'll ask for
> some (e.g.) hooks to be added to the same functions.  If those changes
> make it into an AUCTeX release, then I'll be able to eliminate some
> advice from my package.
>
> Does this sound like a reasonable plan?  Any other suggestions?

It sounds like a plan; gradually bringing in stuff you need is the way
to go.  Looking forward to your changes.

Best, Arash