Hi Paul,

"Paul D. Nelson" <[email protected]> writes:

> Thanks, I can reproduce.

Thanks for checking.

> The attached patch fixes things.  I'll install if there are no
> complaints (and will try to remember to check the tests next time!).
>
> Thanks, best,
>
> Paul
>
> From 262224a8f15763f6937e3e3f8f5604ee71a37ba1 Mon Sep 17 00:00:00 2001
> From: Paul Nelson <[email protected]>
> Date: Mon, 29 Sep 2025 11:01:39 +0100
> Subject: [PATCH] ; Fix recent change
>
> * latex.el (LaTeX--modify-math-1): Only insert additional space
> after punctuation when there is already a space present.
> ---
>  latex.el | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/latex.el b/latex.el
> index d7b2ef23..386eb972 100644
> --- a/latex.el
> +++ b/latex.el
> @@ -9652,7 +9652,8 @@ marker that keeps track of cursor position."
>               (looking-at-p "[.?!]")
>               (save-excursion
>                 (forward-char)
> -               (insert " ")))
> +               (when (looking-at-p " ")
> +                 (insert " "))))

I'm not familiar with the code, so you know best.  But with the above,
can you make sure that you don't add a 3rd space if there are already
two?  If this is the case, does something like this make more sense:

  (when (looking-at-p " ^[ ]") (insert " "))

Again, I haven't tried to understand the function, I'm just asking.

>          (end-of-line 2)
>          (indent-region start (point))))))

Best, Arash

Reply via email to