From: Stefan Monnier Date: Fri, 3 Dec 2004 22:22:24 +0000 (+0000) Subject: (tex-validate-region): Obey syntax-table text properties. X-Git-Tag: ttn-vms-21-2-B4~3448 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=35dccc628789210230c6d655e38c5eaac2291333;p=emacs.git (tex-validate-region): Obey syntax-table text properties. --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 91b3d2afdfd..f6f4c63fdc3 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1190,14 +1190,14 @@ area if a mismatch is found." (forward-sexp 1)) ;; Now check that like matches like. (goto-char start) - (while (progn (skip-syntax-forward "^(") - (not (eobp))) - (let ((match (matching-paren (following-char)))) - (save-excursion + (while (re-search-forward "\\s(" nil t) + (save-excursion + (let ((pos (match-beginning 0))) + (goto-char pos) (forward-sexp 1) - (or (= (preceding-char) match) - (error "Mismatched parentheses")))) - (forward-char 1))) + (or (eq (preceding-char) (cdr (syntax-after pos))) + (eq (char-after pos) (cdr (syntax-after (1- (point))))) + (error "Mismatched parentheses")))))) (error (skip-syntax-forward " .>") (setq failure-point (point)))))