From: Stefan Monnier Date: Wed, 19 May 2004 00:24:15 +0000 (+0000) Subject: (tex-compilation-parse-errors): Save excursion in source buffer. X-Git-Tag: ttn-vms-21-2-B4~6148 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=cc9f53769f6fc1610e748350550d667f8aca9f80;p=emacs.git (tex-compilation-parse-errors): Save excursion in source buffer. --- diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 6e129987ec1..28bf9f6cf28 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el @@ -1944,21 +1944,22 @@ for the error messages." (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