# HG changeset patch # User Glenn Morris # Date 1190186394 0 # Node ID f4f2cb3144481d2e2f649cde7acd3584d3f39dd2 # Parent 5e25c19f30f0ba772a0bbd53d58b60e5ddc5078d (tex-terminate-paragraph): Use backward-paragraph. diff -r 5e25c19f30f0 -r f4f2cb314448 lisp/textmodes/tex-mode.el --- a/lisp/textmodes/tex-mode.el Wed Sep 19 07:19:32 2007 +0000 +++ b/lisp/textmodes/tex-mode.el Wed Sep 19 07:19:54 2007 +0000 @@ -1167,6 +1167,7 @@ (let ((end (point)) prev-end) ;; Scan the previous paragraph for invalidities. + ;; FIXME this should be using something like backward-paragraph. (if (search-backward "\n\n" nil t) (progn (setq prev-end (point)) @@ -1252,9 +1253,13 @@ (interactive "*P") (or inhibit-validation (save-excursion + ;; For the purposes of this, a "paragraph" is a block of text + ;; wherein all the brackets etc are expected to be balanced. It + ;; may start after a blank line (ie a "proper" paragraph), or + ;; a begin{} or end{} block, etc. (tex-validate-region (save-excursion - (search-backward "\n\n" nil 'move) + (backward-paragraph) (point)) (point))) (message "Paragraph being closed appears to contain a mismatch"))