aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGlenn Morris2007-09-17 07:04:46 +0000
committerGlenn Morris2007-09-17 07:04:46 +0000
commit3d1634c64adf1e62d51e050e3300e682d2e20790 (patch)
treebccf615a1fc26fff94edbeece703e283b27326dc
parente47a29adbffb41bfe5417c6269660a2e9d55ea1f (diff)
downloademacs-3d1634c64adf1e62d51e050e3300e682d2e20790.tar.gz
emacs-3d1634c64adf1e62d51e050e3300e682d2e20790.zip
(tex-compilation-parse-errors): Prefer the filename from
`--file-line-error', if it is available.
-rw-r--r--lisp/textmodes/tex-mode.el31
1 files changed, 19 insertions, 12 deletions
diff --git a/lisp/textmodes/tex-mode.el b/lisp/textmodes/tex-mode.el
index 85cb77b69cc..5999586bd11 100644
--- a/lisp/textmodes/tex-mode.el
+++ b/lisp/textmodes/tex-mode.el
@@ -2032,30 +2032,37 @@ for the error messages."
2032 (file-name-directory (buffer-file-name tex-last-buffer-texed))) 2032 (file-name-directory (buffer-file-name tex-last-buffer-texed)))
2033 found-desired (num-errors-found 0) 2033 found-desired (num-errors-found 0)
2034 last-filename last-linenum last-position 2034 last-filename last-linenum last-position
2035 begin-of-error end-of-error) 2035 begin-of-error end-of-error errfilename)
2036 ;; Don't reparse messages already seen at last parse. 2036 ;; Don't reparse messages already seen at last parse.
2037 (goto-char compilation-parsing-end) 2037 (goto-char compilation-parsing-end)
2038 ;; Parse messages. 2038 ;; Parse messages.
2039 (while (and (not (or found-desired (eobp))) 2039 (while (and (not (or found-desired (eobp)))
2040 ;; First alternative handles the newer --file-line-error style:
2041 ;; ./test2.tex:14: Too many }'s.
2042 ;; Second handles the old-style:
2043 ;; ! Too many }'s.
2040 (prog1 (re-search-forward 2044 (prog1 (re-search-forward
2041 "^\\(?:[^:\n]+:[[:digit:]]+:\\|!\\) " nil 'move) 2045 "^\\(?:\\([^:\n]+\\):[[:digit:]]+:\\|!\\) " nil 'move)
2042 (setq begin-of-error (match-beginning 0) 2046 (setq begin-of-error (match-beginning 0)
2043 end-of-error (match-end 0))) 2047 end-of-error (match-end 0)
2048 errfilename (match-string 1)))
2044 (re-search-forward 2049 (re-search-forward
2045 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move)) 2050 "^l\\.\\([0-9]+\\) \\(\\.\\.\\.\\)?\\(.*\\)$" nil 'move))
2046 (let* ((this-error (copy-marker begin-of-error)) 2051 (let* ((this-error (copy-marker begin-of-error))
2047 (linenum (string-to-number (match-string 1))) 2052 (linenum (string-to-number (match-string 1)))
2048 (error-text (regexp-quote (match-string 3))) 2053 (error-text (regexp-quote (match-string 3)))
2049 (filename 2054 (filename
2050 (save-excursion 2055 ;; Prefer --file-liner-error filename if we have it.
2051 (with-syntax-table tex-error-parse-syntax-table 2056 (or errfilename
2052 (backward-up-list 1) 2057 (save-excursion
2053 (skip-syntax-forward "(_") 2058 (with-syntax-table tex-error-parse-syntax-table
2054 (while (not (file-readable-p (thing-at-point 'filename))) 2059 (backward-up-list 1)
2055 (skip-syntax-backward "(_") 2060 (skip-syntax-forward "(_")
2056 (backward-up-list 1) 2061 (while (not (file-readable-p (thing-at-point 'filename)))
2057 (skip-syntax-forward "(_")) 2062 (skip-syntax-backward "(_")
2058 (thing-at-point 'filename)))) 2063 (backward-up-list 1)
2064 (skip-syntax-forward "(_"))
2065 (thing-at-point 'filename)))))
2059 (new-file 2066 (new-file
2060 (or (null last-filename) 2067 (or (null last-filename)
2061 (not (string-equal last-filename filename)))) 2068 (not (string-equal last-filename filename))))