GNU bug report logs -
#73302
TeX-find-closing-brace and verbatim macros
Previous Next
Reported by: Paul Nelson <ultrono <at> gmail.com>
Date: Mon, 16 Sep 2024 16:13:02 UTC
Severity: normal
Done: Arash Esbati <arash <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
View this message in rfc822 format
Hi Paul,
Paul Nelson <ultrono <at> gmail.com> writes:
> Steps to reproduce:
> 1. Create a TeX file with a verbatim macro, e.g., \email{foo <at> bar.com},
> or anything in (LaTeX-verbatim-macros-with-braces).
I tried it with this .tex file:
--8<---------------cut here---------------start------------->8---
\documentclass{article}
\usepackage{fvextra}
\begin{document}
\Verb{foo <at> bar}
\end{document}
--8<---------------cut here---------------end--------------->8---
> 2. Put the cursor on the first character inside the braces.
> 3. M-: (TeX-find-closing-brace)
>
> This should return position after closing brace, but instead returns
> nil.
I'm not sure if this is possibly wrong expectation. If you put the
cursor on { after \Verb and hit 'C-u C-x =', you'll see among other
things:
syntax: | which means: string fence
whereas on { after \begin you get:
syntax: (} which means: open, matches }
so `scan-lists' is expected to fail after \Verb.
> This bug affects the folding of verbatim macros, through a chain of
> function calls from TeX-fold-hide-item to TeX-find-closing-brace.
>
> The issue is similar to one addressed by up-list in lisp.el - the key
> point is to recover gracefully from the failed call to (scan-lists
> (point) 1 1), rather than to give up altogether. A similar fix might
> be possible, but I thought I'd raise the issue here first.
I haven't looked at lisp.el, but we have some functions in latex.el for
verbatim macros, namely, `LaTeX-verbatim-p',
`LaTeX-verbatim-macro-boundaries' and `LaTeX-current-verbatim-macro'.
Maybe we can use them to fix the issue.
So maybe we should look at the issue you're facing with folding and see
how we can fix it with the functions above.
Best, Arash
This bug report was last modified 232 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.