Subject: Re: bug#66771: [PATCH] Throw out fold spec after a single failure

From: Tony Zorman <[email-masked]>
Date: Sun, 17 Dec 2023 20:18:41 +0100

On Sun, Dec 17 2023 19:11, Arash Esbati wrote:
> Thanks for this fix.  I think this change now produces:
>
>   In TeX-fold-expand-spec:
>   tex-fold.el:750:36: Warning: reference to free variable ‘elt’
>
> Can you please have a look and silence this?

Oh, how embarrassing! Sorry about that, it seems like rebasing was too
smart in how it handled the conflicts. Attached is a patch that should
fix this.

Best,
  Tony

>From 6f36aed879b9b2b9bf8821749eb44d9f56d85dc6 Mon Sep 17 00:00:00 2001
From: Tony Zorman <[email-masked]>
Date: Sun, 17 Dec 2023 20:13:45 +0100
Subject: [PATCH] ; * tex-fold.el (TeX-fold-expand-spec): Fix reference to free
 variable

---
 tex-fold.el | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tex-fold.el b/tex-fold.el
index d4dacc16..0952bccc 100644
--- a/tex-fold.el
+++ b/tex-fold.el
@@ -747,7 +747,7 @@ Replace them with the respective macro argument."
            ;; If there is something to replace and the closing delimiter
            ;; matches the opening one…
            (if-let (((string-match "\\([[{<(]\\)\\([1-9]\\)\\([]}>)]\\)"
-                                   elt index))
+                                   spec index))
                     (open (string-to-char (match-string 1 spec)))
                     (num (string-to-number (match-string 2 spec)))
                     (close (string-to-char (match-string 3 spec)))
-- 
2.42.0

-- 
Tony Zorman | https://tony-zorman.com/