[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 1711536 55/69: Fix detection of line number in T
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 1711536 55/69: Fix detection of line number in TeX-warning |
Date: |
Sat, 26 Mar 2016 21:36:37 +0000 |
branch: externals/auctex
commit 17115360b88ca23a69f6361477891681efeec6bf
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Fix detection of line number in TeX-warning
* tex-buf.el (TeX-warning): Require as additional mandatory argument the
position where the warning starts. Use it to limit
`re-search-backward' when looking for the line number.
(TeX-parse-error): Provide additional argument to `TeX-warning'.
* tests/tex/compilation-log.txt: Add another case where the line number
of the warning was mistaken.
* tests/tex/error-parsing.el: Update expected result of the test
accordingly.
---
tests/tex/compilation-log.txt | 3 +++
tests/tex/error-parsing.el | 7 +++++--
tex-buf.el | 14 +++++++++-----
3 files changed, 17 insertions(+), 7 deletions(-)
diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
index 7703865..2e8e00f 100644
--- a/tests/tex/compilation-log.txt
+++ b/tests/tex/compilation-log.txt
@@ -36,6 +36,9 @@ Underfull \hbox (badness 6608) in paragraph at lines 131--132
LaTeX Warning: Reference `wrong' on page 1 undefined on input line 4.
+LaTeX Font Warning: Font shape `OML/cmm/b/it' in size <5.5> not available
+(Font) size <5> substituted on input line 70.
+
[1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux)
LaTeX Warning: There were undefined references.
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
index 611ba8d..6251847 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -87,7 +87,10 @@ ABD: EveryShipout initializing macros"
0
"LaTeX Warning: Reference `wrong' on page 1 undefined on input
line 4.\n"
"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
1482 nil)))))
+ (warning "./test.tex" 70 "LaTeX Font Warning: Font shape
`OML/cmm/b/it' in size <5.5> not available"
+ 0 "LaTeX Font Warning: Font shape `OML/cmm/b/it' in size <5.5>
not available
+(Font) size <5> substituted on input line 70.\n" nil 70 nil 1485
nil)
+ (warning "./test.tex" nil "LaTeX Warning: There were undefined
references."
+ 0 "LaTeX Warning: There were undefined references.\n" nil nil
nil 1616 nil)))))
;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 655faeb..52483dc 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2362,7 +2362,7 @@ Return non-nil if an error or warning is found."
(if (or store TeX-debug-bad-boxes)
(progn
(setq error-found t)
- (TeX-warning (TeX-match-buffer 7) store)
+ (TeX-warning (TeX-match-buffer 7) (match-beginning 7) store)
nil)
(re-search-forward "\r?\n\
\\(?:.\\{79\\}\r?\n\
@@ -2375,7 +2375,7 @@ Return non-nil if an error or warning is found."
(if (or store TeX-debug-warnings)
(progn
(setq error-found t)
- (TeX-warning (TeX-match-buffer 8) store)
+ (TeX-warning (TeX-match-buffer 8) (match-beginning 8) store)
nil)
t))
@@ -2552,9 +2552,11 @@ information in `TeX-error-list' instead of displaying
the error."
;; Find the error point and display the help.
(apply 'TeX-find-display-help info-list))))
-(defun TeX-warning (warning &optional store)
+(defun TeX-warning (warning warning-start &optional store)
"Display a warning for WARNING.
+WARNING-START is the position where WARNING starts.
+
If optional argument STORE is non-nil, store the warning
information in `TeX-error-list' instead of displaying the
warning."
@@ -2568,8 +2570,10 @@ warning."
(word-string (if bad-box "[][\\W() ---]\\(\\w+\\)[][\\W() ---]*$"
"`\\(\\w+\\)'"))
- ;; Get error-line (warning).
- (line (when (save-excursion (re-search-backward line-string nil t))
+ ;; Get error-line (warning). Don't search before `warning-start' to
+ ;; avoid catching completely unrelated line numbers.
+ (line (when (save-excursion (re-search-backward line-string
+ warning-start t))
(string-to-number (TeX-match-buffer 1))))
(line-end (if bad-box (string-to-number (TeX-match-buffer 2))
line))
- [elpa] externals/auctex 416f131 40/69: Catch LaTeX class warnings, (continued)
- [elpa] externals/auctex 416f131 40/69: Catch LaTeX class warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 891bba7 38/69: Add ERT test for error parsing, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex b72dcb7 44/69: Add support for SumatraPDF viewer, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex f1bcbe3 54/69: Improve LaTeX-warnings-regexp, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 08ae29b 19/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 53f2fab 53/69: Another fix for TeX-parse-errro, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex d7f443e 37/69: Add script to update the ChangeLog, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 8b2550e 16/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2fd59c9 60/69: Improve word-string regexp in TeX-warning, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 43ba124 23/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 1711536 55/69: Fix detection of line number in TeX-warning,
Tassilo Horn <=
- [elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 30fe0e9 63/69: Ensure LaTeX-indent-environment-list environments aren't filled, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2c21439 41/69: Improve parsing of certain warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex af1ee52 47/69: Add support for missing macro \SetLabelAlign, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 57147c7 59/69: Another fix for vertical bad box warnings, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex cc59302 51/69: Show and hide warnings and bad boxes in error overview, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 8fac199 14/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex a2a919d 61/69: Use TeX-quote-after-quote in all language style files, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 188e4b1 66/69: Temporarily bind gc-cons-threshold in time-consuming task, Tassilo Horn, 2016/03/26
- [elpa] externals/auctex 2888571 52/69: Allow ignoring certain warnings, Tassilo Horn, 2016/03/26