diff options
| author | Stefan Monnier | 2004-05-19 00:24:15 +0000 |
|---|---|---|
| committer | Stefan Monnier | 2004-05-19 00:24:15 +0000 |
| commit | cc9f53769f6fc1610e748350550d667f8aca9f80 (patch) | |
| tree | 6744f5a52a47c0d5fa9340c9a78ae53c78c9fc71 | |
| parent | 70abfe909d17e13686401dbaf90e57d3096cfafa (diff) | |
| download | emacs-cc9f53769f6fc1610e748350550d667f8aca9f80.tar.gz emacs-cc9f53769f6fc1610e748350550d667f8aca9f80.zip | |
(tex-compilation-parse-errors): Save excursion in source buffer.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 31 |
1 files changed, 16 insertions, 15 deletions
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." | |||
| 1944 | (or (null last-filename) | 1944 | (or (null last-filename) |
| 1945 | (not (string-equal last-filename filename)))) | 1945 | (not (string-equal last-filename filename)))) |
| 1946 | (error-location | 1946 | (error-location |
| 1947 | (save-excursion | 1947 | (with-current-buffer |
| 1948 | (if (equal filename (concat tex-zap-file ".tex")) | 1948 | (if (equal filename (concat tex-zap-file ".tex")) |
| 1949 | (set-buffer tex-last-buffer-texed) | 1949 | tex-last-buffer-texed |
| 1950 | (set-buffer (find-file-noselect filename))) | 1950 | (find-file-noselect filename)) |
| 1951 | (if new-file | 1951 | (save-excursion |
| 1952 | (progn (goto-line linenum) (setq last-position nil)) | 1952 | (if new-file |
| 1953 | (goto-char last-position) | 1953 | (progn (goto-line linenum) (setq last-position nil)) |
| 1954 | (forward-line (- linenum last-linenum))) | 1954 | (goto-char last-position) |
| 1955 | ;; first try a forward search for the error text, | 1955 | (forward-line (- linenum last-linenum))) |
| 1956 | ;; then a backward search limited by the last error. | 1956 | ;; first try a forward search for the error text, |
| 1957 | (let ((starting-point (point))) | 1957 | ;; then a backward search limited by the last error. |
| 1958 | (or (re-search-forward error-text nil t) | 1958 | (let ((starting-point (point))) |
| 1959 | (re-search-backward error-text last-position t) | 1959 | (or (re-search-forward error-text nil t) |
| 1960 | (goto-char starting-point))) | 1960 | (re-search-backward error-text last-position t) |
| 1961 | (point-marker)))) | 1961 | (goto-char starting-point))) |
| 1962 | (point-marker))))) | ||
| 1962 | (goto-char this-error) | 1963 | (goto-char this-error) |
| 1963 | (if (and compilation-error-list | 1964 | (if (and compilation-error-list |
| 1964 | (or (and find-at-least | 1965 | (or (and find-at-least |