Al Haji-Ali <[email protected]> writes:

> I believe so. Attached is the lastest patch with your suggestions.

Hi Al and Paul,

many thanks to both of you for working on this.  I have some minor
comments below.

> From 87042c64efa6f6e68a33ca098862a2a4b9929660 Mon Sep 17 00:00:00 2001
> From: Al Haji-Ali <[email protected]>
> Date: Wed, 26 Nov 2025 12:26:40 +0100
> Subject: [PATCH] New feature: preview at point
>
> * doc/preview-latex.texi: Add docs for new customizations.

They are usually called 'user options'.

> * preview.el: (preview-visibility-style, preview-keep-stale-images,
> preview-at-point-placement): New customizations.

New user options.

> (preview--update-buframe, preview-overlay-updated): New functions.
> (preview-leave-open-previews-visible, preview-protect-point): Mark as
> obsolete.
> (preview--string): New macro.
> (preview-log-error): Fix typo in doc.
> (preview-replace-active-icon): Call preview-overlay-updated.
> (preview-place-preview): Clear-out before toggling.
> (preview-mark-point, preview--open-for-replace): Add condition on
> `preview-visibility-style'.
> (preview-toggle): Update to handle values of preview-visibility-style
> and preview-at-point-placement call preview-overlay-updated. Handle ARG
> being equal to `maybe-open'.
> (preview-move-point): Handle `preview-visibility-style' and call
> `preview--update-buframe'.
> (preview-active-string, preview-disabled-string): Refactor into a
> generic preview--string and mark as obsolete.
> (preview-disable): Always call preview-toggle and condition deleting
> files on `preview-keep-stale-images' and `preview-visibility-style' not
> being nil.
> (preview-parse-messages): Restore point before placing preview.
> (preview-region): Update documentation to return started process.
> (preview-dvi*-command): Fix case in docstring.
> (preview-gs-flag-error): Fix bug and conditionally open previews.
> (preview-gs-place): Use `preview-keep-stale-images' instead of
> `preview-leave-open-previews-visible'.
> (preview-check-changes): Use `preview-visibility-style' instead of
> `preview-leave-open-previews-visible'.
> (preview-temporary-opened): Change location of definition to avoid
> compilation errors.
> (preview-generate-preview): Changed return doc to imperative.
>
> See bug#79708
> ---
>  doc/preview-latex.texi |  62 ++++--
>  preview.el             | 477 +++++++++++++++++++++++++++++------------
>  2 files changed, 393 insertions(+), 146 deletions(-)
>
> diff --git a/doc/preview-latex.texi b/doc/preview-latex.texi
> index 19210a35..912cb713 100644
> --- a/doc/preview-latex.texi
> +++ b/doc/preview-latex.texi
> @@ -480,6 +480,51 @@ math (@code{$@dots{}$}), or if your usage of @code{$} 
> conflicts with
>  @previewlatex{}'s, you can turn off inline math previews.  In the
>  @samp{Preview Latex} group, remove @code{textmath} from
>  @code{preview-default-option-list} by customizing this variable.
> +
> +@item Customize where previews are shown
> +
> +Set @code{preview-visibility-style} to control when previews appear:
> +
> +@table @code
> +
> +@item off-point
> +Default.  Previews replace the source when point is elsewhere.  When a
> +preview is opened to show the source, the preview is replaced by an icon.

Previews replace the source when point is elsewhere.  When a preview is
opened to show the source, the preview is replaced by an icon.  This is
the default value.

> +(defcustom preview-keep-stale-images nil
> +  "Keep the last preview image visible even when the source changes.
> +If non-nil, a preview that was just edited retains its previous image
> +while it sits in the disabled state instead of showing the construction
> +icon.  When nil, the icon appears until the refreshed image arrives.
> +
> +The value of this variable is ignored when `preview-visibility-style' is
> +`off-point'. In that case, stale images are never retained."
               ^^
2 Spaces please.

> +  :group 'preview-appearance
>    :type 'boolean)


> +(make-obsolete-variable
> + 'preview-protect-point
> + "Use `preview-visibility-style' instead to control how previews are
> +displayed."
> + "14.2.0")

Is the line break in the string on purpose?

Looking forward to having this feature installed.

Best, Arash



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

Reply via email to