# HG changeset patch # User Martin Rudalics # Date 1222150524 0 # Node ID 37a6a06b7e9aa686de0c7fb8988219842d705f35 # Parent f4813edccb1f6349e0998399ff5519511e8bf3ab (latex-find-indent): Try to handle escaped close parens correctly. (Bug#954) diff -r f4813edccb1f -r 37a6a06b7e9a lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Mon Sep 22 23:43:32 2008 +0000 +++ b/lisp/textmodes/tex-mode.el Tue Sep 23 06:15:24 2008 +0000 @@ -2585,8 +2585,11 @@ (and (looking-at "\\\\\\(begin\\|end\\) *{\\([^\n}]+\\)") (member (match-string 2) tex-verbatim-environments) 0) - ;; Put leading close-paren where the matching open brace would be. - (and (eq (latex-syntax-after) ?\)) + ;; Put leading close-paren where the matching open paren would be. + (and (or (eq (latex-syntax-after) ?\)) + ;; Try to handle escaped close parens. + (and (looking-at "\\\\\\([])}]\\)") + (goto-char (match-beginning 1)))) (ignore-errors (save-excursion (latex-skip-close-parens)