[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes
From: |
Tassilo Horn |
Subject: |
[elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context |
Date: |
Sat, 26 Mar 2016 21:36:37 +0000 |
branch: externals/auctex
commit 2e543efcc625e2e8645c934e01d3baf76b104bee
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Fix parsing of vertical bad boxes context
* tex-buf.el (TeX-warning): Use as context for vertical bad boxes the
warning itself and don't move point.
* tests/tex/compilation-log.txt: Add a test for vertical bad boxes, and
horizontal bad boxes ending with "at line NN". The two warnings are in
two consecutive lines, make sure the second one is correctly reported.
* tests/tex/error-parsing.el: Update result of the test accordingly.
---
tests/tex/compilation-log.txt | 6 +++++
tests/tex/error-parsing.el | 12 +++++++++-
tex-buf.el | 46 +++++++++++++++++++++++++----------------
3 files changed, 45 insertions(+), 19 deletions(-)
diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
index 2e8e00f..3598af4 100644
--- a/tests/tex/compilation-log.txt
+++ b/tests/tex/compilation-log.txt
@@ -41,6 +41,12 @@ LaTeX Font Warning: Font shape `OML/cmm/b/it' in size <5.5>
not available
[1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux)
+(./test.lof
+Underfull \vbox (badness 1048) has occurred while \output is active [7]
+Overfull \hbox (0.93071pt too wide) detected at line 31
+ []\T1/jkpl/m/n/10.95 144
+)
+
LaTeX Warning: There were undefined references.
)
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
index 979059b..170c8bf 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -90,7 +90,17 @@ ABD: EveryShipout initializing macros"
(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)
+ (bad-box "./test.lof" nil "Underfull \\vbox (badness 1048) has
occurred while \\output is active [7]"
+ 0 "\nUnderfull \\vbox (badness 1048) has occurred while \\output
is active [7]"
+ nil nil t 1651 nil)
+ ;; It is possible there are two different bad box warnings in two
+ ;; consecutive lines (for example it happens if the first one is a
+ ;; vertical bad box which doesn't provide additional information),
+ ;; this test makes sure the second warning is not mistaken as
+ ;; context of the first one.
+ (bad-box "./test.lof" 31 "Overfull \\hbox (0.93071pt too wide)
detected at line 31"
+ 0 "\n []\\T1/jkpl/m/n/10.95 144" "144" 31 t 1733 nil)
(warning "./test.tex" nil "LaTeX Warning: There were undefined
references."
- 0 "LaTeX Warning: There were undefined references.\n" nil nil
nil 1616 nil)))))
+ 0 "LaTeX Warning: There were undefined references.\n" nil nil
nil 1785 nil)))))
;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 052f414..15e9a69 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2590,24 +2590,34 @@ warning."
(beginning-of-line))
(point)))
- (context (if (string-match LaTeX-warnings-regexp warning)
- ;; The warnings matching `LaTeX-warnings-regexp' are
- ;; emitted by \GenericWarning macro, or macros based on it
- ;; (\ClassWarning, \PackageWarning, etc). After such
- ;; warnings there is an empty line, just look for it to
- ;; find the end.
- (progn
- (beginning-of-line)
- (while (null (eolp))
- (forward-line 1))
- (buffer-substring context-start (progn (end-of-line)
- (point))))
- (forward-line 1)
- (end-of-line)
- (while (equal (current-column) 79)
- (forward-line 1)
- (end-of-line))
- (buffer-substring context-start (point))))
+ (context (cond ((string-match LaTeX-warnings-regexp warning)
+ ;; The warnings matching `LaTeX-warnings-regexp' are
+ ;; emitted by \GenericWarning macro, or macros based on
+ ;; it (\ClassWarning, \PackageWarning, etc). After
+ ;; such warnings there is an empty line, just look for
+ ;; it to find the end.
+ (beginning-of-line)
+ (while (null (eolp))
+ (forward-line 1))
+ (buffer-substring context-start (progn (end-of-line)
+ (point))))
+
+ ((and bad-box (string-match "\\\\vbox" warning))
+ ;; Vertical bad boxes don't provide any additional
+ ;; information. In this case, reuse the `warning' as
+ ;; `context' and don't move point, so that we avoid
+ ;; eating the next line that may contain another
+ ;; warning.
+ (concat "\n" warning))
+
+ (t
+ ;; Horizontal bad boxes.
+ (forward-line 1)
+ (end-of-line)
+ (while (equal (current-column) 79)
+ (forward-line 1)
+ (end-of-line))
+ (buffer-substring context-start (point)))))
;; This is where we want to be.
(error-point (point))
- [elpa] externals/auctex 891bba7 38/69: Add ERT test for error parsing, (continued)
- [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, 2016/03/26
- [elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context,
Tassilo Horn <=
- [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
- [elpa] externals/auctex a33be07 62/69: Remove "table" and "table*" from LaTeX-indent-environment-list, Tassilo Horn, 2016/03/26