>From f33999550949549b4012e2d5e12be04e041bf4a3 Mon Sep 17 00:00:00 2001 From: Ikumi Keita Date: Sun, 11 Dec 2022 16:08:50 +0900 Subject: [PATCH] Support starred variant name * latex.el (LaTeX-find-matching-end): (LaTeX-find-matching-begin): Find correct begin or end when the point is just after the asterisk of "\end{foo*}". Remove spurious `regexp-quote' for `TeX-grop'. --- latex.el | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/latex.el b/latex.el index 04caaf53..24d285e4 100644 --- a/latex.el +++ b/latex.el @@ -5268,8 +5268,12 @@ environment in commented regions with the same comment prefix." (in-comment (TeX-in-commented-line)) (comment-prefix (and in-comment (TeX-comment-prefix))) (case-fold-search nil)) + ;; FIXME: The following code until `while' handles exceptional + ;; cases that the point is on "\begin{foo}" or "\end{foo}". + ;; However, this assumes that environment names consist of a-zA-Z* + ;; and doesn't work for case discussed in bug#19281. (let ((pt (point))) - (skip-chars-backward (concat "a-zA-Z \t" (regexp-quote TeX-grop))) + (skip-chars-backward (concat "a-zA-Z* \t" TeX-grop)) (unless (bolp) (backward-char 1) (if (and (looking-at regexp) @@ -5305,7 +5309,11 @@ environment in commented regions with the same comment prefix." (in-comment (TeX-in-commented-line)) (comment-prefix (and in-comment (TeX-comment-prefix))) (case-fold-search nil)) - (skip-chars-backward (concat "a-zA-Z \t" (regexp-quote TeX-grop))) + ;; FIXME: The following code until `while' handles exceptional + ;; cases that the point is on "\begin{foo}" or "\end{foo}". + ;; However, this assumes that environment names consist of a-zA-Z* + ;; and doesn't work for case discussed in bug#19281. + (skip-chars-backward (concat "a-zA-Z* \t" TeX-grop)) (unless (bolp) (backward-char 1) (and (looking-at regexp) -- 2.38.1