GNU bug report logs - #78587
[PATCH] TeX-find-macro-end

Previous Next

Package: auctex;

Reported by: "Paul D. Nelson" <ultrono <at> gmail.com>

Date: Sun, 25 May 2025 15:15:02 UTC

Severity: normal

Tags: patch

Done: Arash Esbati <arash <at> gnu.org>

Full log


View this message in rfc822 format

From: "Paul D. Nelson" <ultrono <at> gmail.com>
To: Arash Esbati <arash <at> gnu.org>
Cc: 78587 <at> debbugs.gnu.org
Subject: bug#78587: [PATCH] TeX-find-macro-end
Date: Mon, 26 May 2025 18:17:11 +0200
Hi Arash,

> What do get with your patch when you eval this form:
>
> --8<---------------cut here---------------start------------->8---
> (mapcar
>  (lambda (str)
>    (with-temp-buffer
>      (LaTeX-mode)
>      (insert str)
>      (char-to-string (char-before (TeX-find-macro-end-helper (point-min))))))
>  '("\begin{enumerate}[a]"
>    "\begin{enumerate}[(a)]"
>    "\begin{enumerate}[a)]"
>    "\begin{enumerate}[a{]}]"))
> --8<---------------cut here---------------end--------------->8---

I get the right answer ("]" "]" "]" "]"), but for the wrong reason:
evaluating

--8<---------------cut here---------------start------------->8---
(mapcar
 (lambda (str)
   (with-temp-buffer
     (LaTeX-mode)
     (insert str)
     (char-to-string (char-before (1- (TeX-find-macro-end-helper (point-min)))))))
 '("\begin{enumerate}[a{]}]"))
--8<---------------cut here---------------end--------------->8---

yields ("{"), which shows that it's picking up the wrong "]".

I guess this case could be covered by adding "{" and "}" to the syntax
table.  Can you imagine any further issues with that approach?

Thanks, best,

Paul




This bug report was last modified 15 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.