[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] [elpa] externals/auctex 2e543ef 58/69: Fix parsing of ver
From: |
Tassilo Horn |
Subject: |
[AUCTeX-devel] [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 box (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.
" nil 70 nil 1485 nil)
+ (bad-box "./test.lof" nil "Underfull \vbox (badness 1048) has
occurred while \output is active [7]"
+ 0 "
Underfull \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 "
[]\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.
" nil nil nil 1616 nil)))))
+ 0 "LaTeX Warning: There were undefined references.
" 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 "
" 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))
- [AUCTeX-devel] [elpa] externals/auctex 7d4bfac 18/69: Merge branch 'master' into simplify-TeX-parse-error, (continued)
- [AUCTeX-devel] [elpa] externals/auctex 7d4bfac 18/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2cca33f 42/69: Minor fix in TeX-documentation-texdoc, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex a1473f7 33/69: Capture warnings from packages with hyphens in name, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 4837aba 26/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2c21439 41/69: Improve parsing of certain warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 08ae29b 19/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex b72dcb7 44/69: Add support for SumatraPDF viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2888571 52/69: Allow ignoring certain warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 16f3dd4 43/69: Add support for Zathura viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex cfa82d8 65/69: Prompt for optional short caption parameter., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 2e543ef 58/69: Fix parsing of vertical bad boxes context,
Tassilo Horn <=
- [AUCTeX-devel] [elpa] externals/auctex 891bba7 38/69: Add ERT test for error parsing, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 4357488 68/69: Merge branch 'master' into elpa, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex fd46872 25/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f9efa73 35/69: Another fix for file name regexp in TeX-documentation-texdoc, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 16af75d 28/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 8cee4a7 12/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 901b20a 22/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex bfd5f18 09/69: Merge master branch., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f919468 01/69: Improve TeX error parsing., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 53f2fab 53/69: Another fix for TeX-parse-errro, Tassilo Horn, 2016/03/26