# HG changeset patch # User Stefan Monnier # Date 1102802438 0 # Node ID 27a76c55b4caff8ffec73df80f22b5bf06774317 # Parent 98e94b29b59b4d00be50e277a025e6151d93850c (latex-backward-sexp-1): Handle the special case of \end{verbatim}. diff -r 98e94b29b59b -r 27a76c55b4ca lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Sat Dec 11 21:59:15 2004 +0000 +++ b/lisp/textmodes/tex-mode.el Sat Dec 11 22:00:38 2004 +0000 @@ -1351,7 +1351,9 @@ (when (eq (char-after) ?{) (let ((newpos (point))) (when (ignore-errors (backward-sexp 1) t) - (if (looking-at "\\\\end\\>") + (if (or (looking-at "\\\\end\\>") + ;; In case the \\ ends a verbatim section. + (and (looking-at "end\\>") (eq (char-before) ?\\))) (tex-last-unended-begin) (goto-char newpos))))))))