changeset 55677:624ac8a21b21

(tex-compilation-parse-errors): Save excursion in source buffer.
author Stefan Monnier <monnier@iro.umontreal.ca>
date Wed, 19 May 2004 00:24:15 +0000
parents 20f75c215a2f
children f328087732d3
files lisp/textmodes/tex-mode.el
diffstat 1 files changed, 16 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/textmodes/tex-mode.el	Wed May 19 00:12:49 2004 +0000
+++ b/lisp/textmodes/tex-mode.el	Wed May 19 00:24:15 2004 +0000
@@ -1944,21 +1944,22 @@
 	      (or (null last-filename)
 		  (not (string-equal last-filename filename))))
 	     (error-location
-	      (save-excursion
-		(if (equal filename (concat tex-zap-file ".tex"))
-		    (set-buffer tex-last-buffer-texed)
-		  (set-buffer (find-file-noselect filename)))
-		(if new-file
-		    (progn (goto-line linenum) (setq last-position nil))
-		  (goto-char last-position)
-		  (forward-line (- linenum last-linenum)))
-		;; first try a forward search for the error text,
-		;; then a backward search limited by the last error.
-		(let ((starting-point (point)))
-		  (or (re-search-forward error-text nil t)
-		      (re-search-backward error-text last-position t)
-		      (goto-char starting-point)))
-		(point-marker))))
+	      (with-current-buffer
+		  (if (equal filename (concat tex-zap-file ".tex"))
+		      tex-last-buffer-texed
+		    (find-file-noselect filename))
+		(save-excursion
+		  (if new-file
+		      (progn (goto-line linenum) (setq last-position nil))
+		    (goto-char last-position)
+		    (forward-line (- linenum last-linenum)))
+		  ;; first try a forward search for the error text,
+		  ;; then a backward search limited by the last error.
+		  (let ((starting-point (point)))
+		    (or (re-search-forward error-text nil t)
+			(re-search-backward error-text last-position t)
+			(goto-char starting-point)))
+		  (point-marker)))))
 	(goto-char this-error)
 	(if (and compilation-error-list
 		 (or (and find-at-least