Hi all, This patch fixes a rare bug with the setting preview-leave-open-previews-visible that I added last year. "Recall" that with the default value nil for that setting, when the user moves the point into a previewed region, the TeX code becomes visible and a TeX icon is shown in place of the preview graphic. On the other hand, when the setting is t, the TeX icon is replaced by the old preview image, which thus remains visible. After editing the TeX code, the user can then regenerate the preview image, either manually via the preview-* commands or automatically via the ELPA package preview-auto. Some users told me that the setting did not work correctly in shared drives, such as Dropbox and OneDrive. The symptom was that the image would not update correctly after editing in the manner described above. I was never able to reproduce the issue myself, but eventually stumbled upon [1], which led to the attached patch, a variant of which yielded positive feedback from two of the users who had noted the issue. The patch is conservative in that it only affects users of the setting preview-leave-open-previews-visible. Any feedback welcome. [1] https://lists.gnu.org/archive/html/bug-gnu-emacs/2022-12/msg00681.html Thanks, best, Paul