Subject: Re: bug#58329: 29.0.50; [PATCH] Pass correct environment name to `reftex-label'

From: Lars Ingebrigtsen <[email-masked]>
Date: Thu, 06 Oct 2022 14:19:17 +0200

Arash Esbati <[email-masked]> writes:

> -     '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "table"))))
> +     '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "figure"))))

Your change look like the right thing to me.  This code was apparently
introduced in:

commit dd166d5fa1712b0dda35859c91d89666c2873471
Author:     Stefan Monnier <[email-masked]>
AuthorDate: Sun Oct 3 19:53:23 2004 +0000

It looks to me like a cut and paste error -- I've added Stefan to the
CCs; I'm sure he remembers this code.  It's just 18 years ago.

 (defvar latex-block-body-alist
   '(("enumerate" nil '(latex-insert-item) > _)
     ("itemize" nil '(latex-insert-item) > _)
-    ("table" nil "\\caption{" > - "}" > \n _)
-    ("figure" nil  > _ \n "\\caption{" > _ "}" >))
+    ("table" nil "\\caption{" > (skeleton-read "Caption: ") "}" > \n
+     '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "table"))
+     \n _)
+    ("figure" nil  > _ \n "\\caption{" > (skeleton-read "Caption: ") "}" > \n
+     '(if (and (boundp 'reftex-mode) reftex-mode) (reftex-label "table"))))