changeset 84638:37b27be68573

(tex-terminate-paragraph): Use backward-paragraph.
author Glenn Morris <rgm@gnu.org>
date Wed, 19 Sep 2007 07:21:24 +0000
parents 69543118015a
children b0ee198c809b
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 6 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Wed Sep 19 07:20:22 2007 +0000
+++ b/lisp/textmodes/tex-mode.el	Wed Sep 19 07:21:24 2007 +0000
@@ -1188,6 +1188,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))
@@ -1273,9 +1274,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"))