diff options
| author | Glenn Morris | 2007-09-20 03:01:01 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-09-20 03:01:01 +0000 |
| commit | 0a4daff51eb734b2ba3bde84ec68c6c337f1a61c (patch) | |
| tree | 0c600bb3d7c2b049797f16b54e5b478b6a52a257 | |
| parent | 3cfff67b9e5e50ead17743cbc7deac64ce549b67 (diff) | |
| download | emacs-0a4daff51eb734b2ba3bde84ec68c6c337f1a61c.tar.gz emacs-0a4daff51eb734b2ba3bde84ec68c6c337f1a61c.zip | |
Revert previous change.
| -rw-r--r-- | lisp/ChangeLog | 7 | ||||
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 38 |
2 files changed, 28 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index f91b0156cfe..07343511379 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,10 @@ | |||
| 1 | 2007-09-20 Glenn Morris <rgm@gnu.org> | ||
| 2 | |||
| 3 | * textmodes/tex-mode.el (tex-validate-buffer): Use paragraph | ||
| 4 | motion functions, rather than hard-coding "\n\n". | ||
| 5 | (tex-validate-region): Check for eobp, to speed up. | ||
| 6 | (tex-next-unmatched-end): Doc fix. | ||
| 7 | |||
| 1 | 2007-09-19 Stefan Monnier <monnier@iro.umontreal.ca> | 8 | 2007-09-19 Stefan Monnier <monnier@iro.umontreal.ca> |
| 2 | 9 | ||
| 3 | * files.el (auto-mode-alist): Use archive-mode for .rar files. | 10 | * files.el (auto-mode-alist): Use archive-mode for .rar files. |
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 3a7a9880d38..f52653e2cf6 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -1184,25 +1184,27 @@ on the line for the invalidity you want to see." | |||
| 1184 | (setq occur-revert-arguments (list nil 0 (list buffer)))) | 1184 | (setq occur-revert-arguments (list nil 0 (list buffer)))) |
| 1185 | (save-excursion | 1185 | (save-excursion |
| 1186 | (goto-char (point-max)) | 1186 | (goto-char (point-max)) |
| 1187 | (while (and (not (bobp))) | 1187 | ;; Do a little shimmy to place point at the end of the last |
| 1188 | (let ((end (point)) | 1188 | ;; "real" paragraph. Need to avoid validating across an \end, |
| 1189 | prev-end) | 1189 | ;; because that blows up latex-forward-sexp. |
| 1190 | (backward-paragraph) | ||
| 1191 | (forward-paragraph) | ||
| 1192 | (while (not (bobp)) | ||
| 1190 | ;; Scan the previous paragraph for invalidities. | 1193 | ;; Scan the previous paragraph for invalidities. |
| 1191 | ;; FIXME this should be using something like backward-paragraph. | 1194 | (backward-paragraph) |
| 1192 | (if (search-backward "\n\n" nil t) | 1195 | (save-excursion |
| 1193 | (progn | 1196 | (or (tex-validate-region (point) (save-excursion |
| 1194 | (setq prev-end (point)) | 1197 | (forward-paragraph) |
| 1195 | (forward-char 2)) | 1198 | (point))) |
| 1196 | (goto-char (setq prev-end (point-min)))) | 1199 | (let ((end (line-beginning-position 2)) |
| 1197 | (or (tex-validate-region (point) end) | ||
| 1198 | (let* ((end (line-beginning-position 2)) | ||
| 1199 | start tem) | 1200 | start tem) |
| 1200 | (beginning-of-line) | 1201 | (beginning-of-line) |
| 1201 | (setq start (point)) | 1202 | (setq start (point)) |
| 1202 | ;; Keep track of line number as we scan, | 1203 | ;; Keep track of line number as we scan, |
| 1203 | ;; in a cumulative fashion. | 1204 | ;; in a cumulative fashion. |
| 1204 | (if linenum | 1205 | (if linenum |
| 1205 | (setq linenum (- linenum (count-lines prevpos (point)))) | 1206 | (setq linenum (- linenum |
| 1207 | (count-lines prevpos (point)))) | ||
| 1206 | (setq linenum (1+ (count-lines 1 start)))) | 1208 | (setq linenum (1+ (count-lines 1 start)))) |
| 1207 | (setq prevpos (point)) | 1209 | (setq prevpos (point)) |
| 1208 | ;; Mention this mismatch in *Occur*. | 1210 | ;; Mention this mismatch in *Occur*. |
| @@ -1223,10 +1225,10 @@ on the line for the invalidity you want to see." | |||
| 1223 | (add-text-properties | 1225 | (add-text-properties |
| 1224 | text-beg (- text-end 1) | 1226 | text-beg (- text-end 1) |
| 1225 | '(mouse-face highlight | 1227 | '(mouse-face highlight |
| 1226 | help-echo "mouse-2: go to this invalidity")) | 1228 | help-echo |
| 1229 | "mouse-2: go to this invalidity")) | ||
| 1227 | (put-text-property text-beg (- text-end 1) | 1230 | (put-text-property text-beg (- text-end 1) |
| 1228 | 'occur-target tem))))) | 1231 | 'occur-target tem)))))))) |
| 1229 | (goto-char prev-end)))) | ||
| 1230 | (with-current-buffer standard-output | 1232 | (with-current-buffer standard-output |
| 1231 | (let ((no-matches (zerop num-matches))) | 1233 | (let ((no-matches (zerop num-matches))) |
| 1232 | (if no-matches | 1234 | (if no-matches |
| @@ -1249,7 +1251,9 @@ area if a mismatch is found." | |||
| 1249 | (narrow-to-region start end) | 1251 | (narrow-to-region start end) |
| 1250 | ;; First check that the open and close parens balance in numbers. | 1252 | ;; First check that the open and close parens balance in numbers. |
| 1251 | (goto-char start) | 1253 | (goto-char start) |
| 1252 | (while (<= 0 (setq max-possible-sexps (1- max-possible-sexps))) | 1254 | (while (and (not (eobp)) |
| 1255 | (<= 0 (setq max-possible-sexps | ||
| 1256 | (1- max-possible-sexps)))) | ||
| 1253 | (forward-sexp 1)) | 1257 | (forward-sexp 1)) |
| 1254 | ;; Now check that like matches like. | 1258 | ;; Now check that like matches like. |
| 1255 | (goto-char start) | 1259 | (goto-char start) |
| @@ -1388,7 +1392,7 @@ Return the value returned by the last execution of BODY." | |||
| 1388 | (search-failed (error "Couldn't find unended \\begin")))) | 1392 | (search-failed (error "Couldn't find unended \\begin")))) |
| 1389 | 1393 | ||
| 1390 | (defun tex-next-unmatched-end () | 1394 | (defun tex-next-unmatched-end () |
| 1391 | "Leave point at the end of the next `\\end' that is unended." | 1395 | "Leave point at the end of the next `\\end' that is unmatched." |
| 1392 | (while (and (tex-search-noncomment | 1396 | (while (and (tex-search-noncomment |
| 1393 | (re-search-forward "\\\\\\(begin\\|end\\)\\s *{[^}]+}")) | 1397 | (re-search-forward "\\\\\\(begin\\|end\\)\\s *{[^}]+}")) |
| 1394 | (save-excursion (goto-char (match-beginning 0)) | 1398 | (save-excursion (goto-char (match-beginning 0)) |