diff options
| author | Karl Heuer | 1997-10-31 23:03:30 +0000 |
|---|---|---|
| committer | Karl Heuer | 1997-10-31 23:03:30 +0000 |
| commit | 2ed2806cd9b5120292cacb658af9dd7b6bcdad0a (patch) | |
| tree | c7c71592158ad198d1336701572b9ee956a47c28 | |
| parent | 960d894c38f6c0982e4227231b5db7f85fa93919 (diff) | |
| download | emacs-2ed2806cd9b5120292cacb658af9dd7b6bcdad0a.tar.gz emacs-2ed2806cd9b5120292cacb658af9dd7b6bcdad0a.zip | |
(tex-validate-region): Really check
for mismatched parens.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 509b7fd4556..f599c581540 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -834,9 +834,20 @@ area if a mismatch is found." | |||
| 834 | (condition-case () | 834 | (condition-case () |
| 835 | (save-restriction | 835 | (save-restriction |
| 836 | (narrow-to-region start end) | 836 | (narrow-to-region start end) |
| 837 | ;; First check that the open and close parens balance in numbers. | ||
| 837 | (goto-char start) | 838 | (goto-char start) |
| 838 | (while (< 0 (setq max-possible-sexps (1- max-possible-sexps))) | 839 | (while (< 0 (setq max-possible-sexps (1- max-possible-sexps))) |
| 839 | (forward-sexp 1))) | 840 | (forward-sexp 1)) |
| 841 | ;; Now check that like matches like. | ||
| 842 | (goto-char start) | ||
| 843 | (while (progn (skip-syntax-forward "^(") | ||
| 844 | (not (eobp))) | ||
| 845 | (let ((match (matching-paren (following-char)))) | ||
| 846 | (save-excursion | ||
| 847 | (forward-sexp 1) | ||
| 848 | (or (= (preceding-char) match) | ||
| 849 | (error "Mismatched parentheses")))) | ||
| 850 | (forward-char 1))) | ||
| 840 | (error | 851 | (error |
| 841 | (skip-syntax-forward " .>") | 852 | (skip-syntax-forward " .>") |
| 842 | (setq failure-point (point))))) | 853 | (setq failure-point (point))))) |