diff options
| author | Glenn Morris | 2007-09-17 07:01:53 +0000 |
|---|---|---|
| committer | Glenn Morris | 2007-09-17 07:01:53 +0000 |
| commit | 6f800ba681394fa7e0bd40e0fe45c979c6704eb3 (patch) | |
| tree | 309d143edf5c2fbfcb7bdf0091072fdcb6dea0e2 | |
| parent | af751646bdd75378f4e62d549321e9a8080d018c (diff) | |
| download | emacs-6f800ba681394fa7e0bd40e0fe45c979c6704eb3.tar.gz emacs-6f800ba681394fa7e0bd40e0fe45c979c6704eb3.zip | |
(tex-compilation-parse-errors): Prefer the filename from
`--file-line-error', if it is available.
| -rw-r--r-- | lisp/textmodes/tex-mode.el | 31 |
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el index 73075ce0598..54bd77220e3 100644 --- a/lisp/textmodes/tex-mode.el +++ b/lisp/textmodes/tex-mode.el | |||
| @@ -2011,30 +2011,37 @@ for the error messages." | |||
| 2011 | (file-name-directory (buffer-file-name tex-last-buffer-texed))) | 2011 | (file-name-directory (buffer-file-name tex-last-buffer-texed))) |
| 2012 | found-desired (num-errors-found 0) | 2012 | found-desired (num-errors-found 0) |
| 2013 | last-filename last-linenum last-position | 2013 | last-filename last-linenum last-position |
| 2014 | begin-of-error end-of-error) | 2014 | begin-of-error end-of-error errfilename) |
| 2015 | ;; Don't reparse messages already seen at last parse. | 2015 | ;; Don't reparse messages already seen at last parse. |
| 2016 | (goto-char compilation-parsing-end) | 2016 | (goto-char compilation-parsing-end) |
| 2017 | ;; Parse messages. | 2017 | ;; Parse messages. |
| 2018 | (while (and (not (or found-desired (eobp))) | 2018 | (while (and (not (or found-desired (eobp))) |
| 2019 | ;; First alternative handles the newer --file-line-error style: | ||
| 2020 | ;; ./test2.tex:14: Too many }'s. | ||
| 2021 | ;; Second handles the old-style: | ||
| 2022 | ;; ! Too many }'s. | ||
| 2019 | (prog1 (re-search-forward | 2023 | (prog1 (re-search-forward |
| 2020 | "^\\(?:[^:\n]+:[[:digit:]]+:\\|!\\) " nil 'move) | 2024 | "^\\(?:\\([^:\n]+\\):[[:digit:]]+:\\|!\\) " nil 'move) |
| 2021 | (setq begin-of-error (match-beginning 0) | 2025 | (setq begin-of-error (match-beginning 0) |
| 2022 | end-of-error (match-end 0))) | 2026 | end-of-error (match-end 0) |
| 2027 | errfilename (match-string 1))) | ||
| 2023 | (re-search-forward | 2028 | (re-search-forward |
| 2024 | "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) | 2029 | "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) |
| 2025 | (let* ((this-error (copy-marker begin-of-error)) | 2030 | (let* ((this-error (copy-marker begin-of-error)) |
| 2026 | (linenum (string-to-number (match-string 1))) | 2031 | (linenum (string-to-number (match-string 1))) |
| 2027 | (error-text (regexp-quote (match-string 3))) | 2032 | (error-text (regexp-quote (match-string 3))) |
| 2028 | (filename | 2033 | (filename |
| 2029 | (save-excursion | 2034 | ;; Prefer --file-liner-error filename if we have it. |
| 2030 | (with-syntax-table tex-error-parse-syntax-table | 2035 | (or errfilename |
| 2031 | (backward-up-list 1) | 2036 | (save-excursion |
| 2032 | (skip-syntax-forward "(_") | 2037 | (with-syntax-table tex-error-parse-syntax-table |
| 2033 | (while (not (file-readable-p (thing-at-point 'filename))) | 2038 | (backward-up-list 1) |
| 2034 | (skip-syntax-backward "(_") | 2039 | (skip-syntax-forward "(_") |
| 2035 | (backward-up-list 1) | 2040 | (while (not (file-readable-p (thing-at-point 'filename))) |
| 2036 | (skip-syntax-forward "(_")) | 2041 | (skip-syntax-backward "(_") |
| 2037 | (thing-at-point 'filename)))) | 2042 | (backward-up-list 1) |
| 2043 | (skip-syntax-forward "(_")) | ||
| 2044 | (thing-at-point 'filename))))) | ||
| 2038 | (new-file | 2045 | (new-file |
| 2039 | (or (null last-filename) | 2046 | (or (null last-filename) |
| 2040 | (not (string-equal last-filename filename)))) | 2047 | (not (string-equal last-filename filename)))) |