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

From: Paul Nelson <[email-masked]>
Date: Wed, 3 Apr 2024 22:22:58 +0200

Hi Arash,

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

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.  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).

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?

Thanks, best,

Paul