bug-auctex
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#19281: 11.86; environment update fails when environment name contain


From: Mosè Giordano
Subject: bug#19281: 11.86; environment update fails when environment name contains \
Date: Wed, 10 Dec 2014 00:17:57 +0100

Hi Tassilo,

2014-12-09 10:34 GMT+01:00 Tassilo Horn <address@hidden>:
>> Or matching everything between the opening and the closing brace
>> (allowing at least one level of braces)?
>
> Either that, or we could also rely on syntax tables.  I.e., since
> `LaTeX-find-matching-end' already brings us to the end of the
> environment name,
>
>   (let ((end (point)))
>     (forward-char)
>     (backward-sexp)
>     (forward-char)
>     (buffer-substring-no-properties (point) end))
>
> gives us the environment name.

Good idea, except that `LaTeX-find-matching-end' fails to find the
closing brace of \end when the environment name is a macro with
arguments.  The attached patch should fix this problem.
`LaTeX-environment-name-regexp' needs to be a function because if it
were a variable it would always keep the original value, also in
buffers with different values for `TeX-grop' and `TeX-grcl' (or not?).
Probably `LaTeX-modify-environment' can be simplified following your
suggestion, the patch sketches an idea how to fix
`LaTeX-find-matching-end', but can be improved.

Bye,
Mosè

Attachment: latex-modify-environment.patch
Description: Text Data


reply via email to

[Prev in Thread] Current Thread [Next in Thread]