aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKarl Heuer1996-07-11 23:55:01 +0000
committerKarl Heuer1996-07-11 23:55:01 +0000
commit710a0f533a256334ccc4a72146112bfa44101046 (patch)
treeceeffc6ee7df51c76eb78eea2c0e4b7be99812a7
parent78c33db16e69b1ddad9f1158e96fd8adca3248aa (diff)
downloademacs-710a0f533a256334ccc4a72146112bfa44101046.tar.gz
emacs-710a0f533a256334ccc4a72146112bfa44101046.zip
(tex-validate-region): Skip fwd over whitespace
and punctuation, to find point of mismatch. (validate-tex-buffer): Don't include the blank lines before a paragraph in the paragraph being checked.
-rw-r--r--lisp/textmodes/tex-mode.el16
1 files changed, 12 insertions, 4 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index d410035cf84..6990c80f2d6 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -652,11 +652,17 @@ for the invalidity you want to see."
652 (save-excursion 652 (save-excursion
653 (goto-char (point-max)) 653 (goto-char (point-max))
654 (while (and (not (input-pending-p)) (not (bobp))) 654 (while (and (not (input-pending-p)) (not (bobp)))
655 (let ((end (point))) 655 (let ((end (point))
656 prev-end)
656 ;; Scan the previous paragraph for invalidities. 657 ;; Scan the previous paragraph for invalidities.
657 (search-backward "\n\n" nil 'move) 658 (if (search-backward "\n\n" nil t)
659 (progn
660 (setq prev-end (point))
661 (forward-char 2))
662 (goto-char (setq prev-end (point-min))))
658 (or (tex-validate-region (point) end) 663 (or (tex-validate-region (point) end)
659 (let* ((end (save-excursion (forward-line 1) (point))) 664 (let* ((oend end)
665 (end (save-excursion (forward-line 1) (point)))
660 start tem) 666 start tem)
661 (beginning-of-line) 667 (beginning-of-line)
662 (setq start (point)) 668 (setq start (point))
@@ -679,7 +685,8 @@ for the invalidity you want to see."
679 (setq occur-pos-list (cons tem occur-pos-list)) 685 (setq occur-pos-list (cons tem occur-pos-list))
680 (insert-buffer-substring buffer start end) 686 (insert-buffer-substring buffer start end)
681 (forward-char (- start end)) 687 (forward-char (- start end))
682 (insert (format "%3d: " linenum)))))))) 688 (insert (format "%3d: " linenum)))))
689 (goto-char prev-end))))
683 (save-excursion 690 (save-excursion
684 (set-buffer standard-output) 691 (set-buffer standard-output)
685 (if (null occur-pos-list) 692 (if (null occur-pos-list)
@@ -701,6 +708,7 @@ area if a mismatch is found."
701 (while (< 0 (setq max-possible-sexps (1- max-possible-sexps))) 708 (while (< 0 (setq max-possible-sexps (1- max-possible-sexps)))
702 (forward-sexp 1))) 709 (forward-sexp 1)))
703 (error 710 (error
711 (skip-syntax-forward " .>")
704 (setq failure-point (point))))) 712 (setq failure-point (point)))))
705 (if failure-point 713 (if failure-point
706 (progn 714 (progn