branch: externals/auctex commit 53f2fab87869063d07010229c0c8675a35721a95 Author: Mosè Giordano <m...@gnu.org> Commit: Mosè Giordano <m...@gnu.org>
Another fix for TeX-parse-errro * tex-buf.el (TeX-parse-error): Improve regexp for polishing file name. * tests/tex/compilation-log.txt: Add example to test file. * tests/tex/error-parsing.el: Update the expected result of the test accordingly. --- tests/tex/compilation-log.txt | 2 +- tests/tex/error-parsing.el | 12 ++++++------ tex-buf.el | 11 ++++++----- 3 files changed, 13 insertions(+), 12 deletions(-) diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt index f97b300..7703865 100644 --- a/tests/tex/compilation-log.txt +++ b/tests/tex/compilation-log.txt @@ -29,7 +29,7 @@ Package foo Warning: This is a warning! on input line 3. [1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}] (./test.aux) -(./secondary-file.tex [8] [9] [10] +(./secondary-file.tex [8] [9] [10 <./path/to/file>] Underfull \hbox (badness 6608) in paragraph at lines 131--132 []|\T1/jkpl/m/n/10.95 (+20) Something bla [11] [12]) diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el index b826fc3..611ba8d 100644 --- a/tests/tex/error-parsing.el +++ b/tests/tex/error-parsing.el @@ -57,7 +57,7 @@ command line and from another directory." (nice-class) * THIS IS JUST A WARNING WITH A PESKY (nice-class) * UNMATCHED CLOSED PARENTHESIS :-) (nice-class) ****************************************** on input line 32.\n" - nil 32 nil 376) + nil 32 nil 376 nil) (error "./test.tex" 2 "Class nice-class Error: ***********************************" 0 @@ -72,22 +72,22 @@ l.2 \\begin{document} (/other/packages/loaded.sty) ABD: EveryShipout initializing macros" - "\\begin{document}\n\n(/other/packages/loaded.sty)" nil nil 971) + "\\begin{document}\n\n(/other/packages/loaded.sty)" nil nil 971 nil) (warning "./test.tex" 3 "Package foo Warning: This is a warning! on input line 3." 0 "Package foo Warning: This is a warning! on input line 3.\n" - nil 3 nil 1030) + nil 3 nil 1030 nil) (bad-box "./secondary-file.tex" 131 "Underfull \\hbox (badness 6608) in paragraph at lines 131--132" 0 "\n[]|\\T1/jkpl/m/n/10.95 (+20) Something bla" "bla" - 132 10 1251) + 132 10 1268 nil) (warning "./test.tex" 4 "LaTeX Warning: Reference `wrong' on page 1 undefined on input line 4." 0 "LaTeX Warning: Reference `wrong' on page 1 undefined on input line 4.\n" - "wrong" 4 nil 1334) + "wrong" 4 nil 1351 nil) (warning "./test.tex" 4 "LaTeX Warning: There were undefined references." - 0 "LaTeX Warning: There were undefined references.\n" nil 4 nil 1465))))) + 0 "LaTeX Warning: There were undefined references.\n" nil 4 nil 1482 nil))))) ;;; error-parsing.el ends here diff --git a/tex-buf.el b/tex-buf.el index d3c6098..2bd6d21 100644 --- a/tex-buf.el +++ b/tex-buf.el @@ -2392,11 +2392,12 @@ Return non-nil if an error or warning is found." (replace-match "" t t string) string)) ;; Sometimes `file' is something like - ;; "./path/to/file.tex [9] [10] " - ;; where "[9]" and "[10]" are pages of the output file. - ;; Remove these numbers together with whitespaces at the end - ;; of the string. - (if (string-match "\\( *\\(\\[[0-9]+\\]\\)? *\\)*\\'" string) + ;; "./path/to/file.tex [9] [10 <./path/to/file>] " + ;; where "[9]" and "[10 <./path/to/file>]" are pages of the + ;; output file, with path to an included file. Remove these + ;; numbers together with whitespaces at the end of the + ;; string. + (if (string-match "\\( *\\(\\[[^]]+\\]\\)? *\\)*\\'" string) (replace-match "" t t string) string))) (push file TeX-error-file)