[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] [elpa] externals/auctex 57147c7 59/69: Another fix for ve
From: |
Tassilo Horn |
Subject: |
[AUCTeX-devel] [elpa] externals/auctex 57147c7 59/69: Another fix for vertical bad box warnings |
Date: |
Sat, 26 Mar 2016 21:36:37 +0000 |
branch: externals/auctex
commit 57147c70646594270973364a0130650d419c9b34
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Another fix for vertical bad box warnings
* tex-buf.el (TeX-parse-error): Use different regexps for horizontal and
vertical bad boxes, they cannot be handled together.
(TeX-warning): Do not move point when a vertical bad box has been found.
* tests/tex/compilation-log.txt: Add a test where the parser used to
fail to find the file for warnings after a vertical bad box warning.
* tests/tex/error-parsing.el: Update result accordingly.
---
tests/tex/compilation-log.txt | 14 ++++++++++++++
tests/tex/error-parsing.el | 12 +++++++++++-
tex-buf.el | 40 ++++++++++++++++++++++++++++++----------
3 files changed, 55 insertions(+), 11 deletions(-)
diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
index 3598af4..f3d2b00 100644
--- a/tests/tex/compilation-log.txt
+++ b/tests/tex/compilation-log.txt
@@ -47,6 +47,20 @@ Overfull \hbox (0.93071pt too wide) detected at line 31
[]\T1/jkpl/m/n/10.95 144
)
+(./file name/with spaces.tex
+chapter 5.
+<use image/an_image.pdf> [82] [83 <./image/an_image.pdf>] [84] [85] [86]
(./image/another.tex
+<image/another.pdf, id=1357, 208.78pt x 146.5475pt> <use image/another.pdf>)
+<image/another2.pdf, id=1358, 542.025pt x 481.8pt> <use image/another2.pdf>
+Underfull box (badness 3942) has occurred while \output is active [87
<./image/another.pdf> <./image/another2.pdf>] [88] (./image/beta.tex
+<image/beta.pdf, id=1410, 289.08pt x 201.75375pt>
+<use image/beta.pdf>) [89] [90 <./image/beta.pdf>]
+Overfull \hbox (13.59138pt too wide) in paragraph at lines 367--368
+[]\T1/pplj/m/n/10.95 Un qua-dri-vet-to-re co-va-rian-te $\OMS/zplm/m/n/10.95
f\OML/zplm/m/it/10.95 A[]\OMS/zplm/m/n/10.95 g$ \T1/pplj/m/n/10.95 e un
in-sie-me di quat-tro quan-ti-ta $\OT1/zplm/m/n/10.95 (\OML/zplm/m/it/10.95
A[]; A[]; A[]; A[]\OT1/zplm/m/n/10.95 )$
+[91] [92]
+
+[93])
+
LaTeX Warning: There were undefined references.
)
diff --git a/tests/tex/error-parsing.el b/tests/tex/error-parsing.el
index 170c8bf..2d0f282 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -100,7 +100,17 @@ ABD: EveryShipout initializing macros"
;; 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)
+ ;; The line of this warning ends with a new file opened. This
test
+ ;; makes sure point stays exactly at the end of the warning so
that
+ ;; the next the next warning in the list has the right file
+ ;; (otherwise it would be nil).
+ (bad-box "./file name/with spaces.tex" nil "Underfull \vbox
(badness 3942) has occurred while \output is active [87 <./image/another.pdf>
<./image/another2.pdf>]"
+ 0 "
Underfull \vbox (badness 3942) has occurred while \output is active [87
<./image/another.pdf> <./image/another2.pdf>]"
+ nil nil t 2142 nil)
+ (bad-box "./file name/with spaces.tex" 367 "Overfull \hbox
(13.59138pt too wide) in paragraph at lines 367--368"
+ 0 "
[]\T1/pplj/m/n/10.95 Un qua-dri-vet-to-re co-va-rian-te $\OMS/zplm/m/n/10.95
f\OML/zplm/m/it/10.95 A[]\OMS/zplm/m/n/10.95 g$ \T1/pplj/m/n/10.95 e un
in-sie-me di quat-tro quan-ti-ta $\OT1/zplm/m/n/10.95 (\OML/zplm/m/it/10.95
A[]; A[]; A[]; A[]\OT1/zplm/m/n/10.95 )$" "$"
+ 368 t 2600 nil)
(warning "./test.tex" nil "LaTeX Warning: There were undefined
references."
- 0 "LaTeX Warning: There were undefined references.
" nil nil nil 1785 nil)))))
+ 0 "LaTeX Warning: There were undefined references.
" nil nil nil 2667 nil)))))
;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 15e9a69..9a3662b 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2328,9 +2328,12 @@ Return non-nil if an error or warning is found."
" !\(?:offset(\([---0-9]+\))\|"
;; Hook to change file name
"name(\([^)]+\))\)\|"
- ;; LaTeX bad box
- "^\(\(?:Overfull\|Underfull\|Tight\|Loose\)\
- \\[hv]box.*\)\|"
+ ;; Start of LaTeX bad box
+ "^\(\(?:Overfull\|Underfull\|Tight\|Loose\) "
+ ;; Horizontal bad box
+ "\(?:\\hbox.* at lines? [0-9]+\(?:--[0-9]+\)?$\|"
+ ;; Vertical bad box. See also `TeX-warning'.
+ "\\vbox ([ a-z0-9]+) has occurred while \\output is active
\[[^]]+\]\)\)\|"
;; LaTeX warning
"^\(" LaTeX-warnings-regexp ".*\)"))
(error-found nil))
@@ -2586,8 +2589,25 @@ warning."
line))
;; Find the context
- (context-start (progn (if bad-box (end-of-line)
- (beginning-of-line))
+ (context-start (progn (cond
+ ((and bad-box (string-match "\\hbox" warning))
+ ;; Horizontal bad box
+ (end-of-line))
+ (bad-box
+ ;; Vertical bad box (by exclusion), don't move
+ ;; point. In the output buffer, unlike in the
+ ;; actual *.log file, these warnings do not end
+ ;; with "...is active []", but in the same line
+ ;; there may be something else, including a new
+ ;; file opened. Thus, point shouldn't move
+ ;; from the end of the actual bad box warning.
+ ;; This is why the corresponding regexp in
+ ;; `TeX-parse-error' doesn't match everything
+ ;; until the end of the line.
+ nil)
+ (t
+ ;; Generic warning.
+ (beginning-of-line)))
(point)))
(context (cond ((string-match LaTeX-warnings-regexp warning)
@@ -2603,11 +2623,11 @@ warning."
(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.
+ ;; 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. See also comment for `context-start'.
(concat "
" warning))
(t
- [AUCTeX-devel] [elpa] externals/auctex a7f4839 04/69: Fix Wrong type argument: characterp, nil error., (continued)
- [AUCTeX-devel] [elpa] externals/auctex a7f4839 04/69: Fix Wrong type argument: characterp, nil error., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex a074732 15/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f351ed9 24/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 1950012 31/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 95bef06 21/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 6f74661 11/69: Merge from master., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex c1dcb84 20/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex d7f443e 37/69: Add script to update the ChangeLog, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex a2a919d 61/69: Use TeX-quote-after-quote in all language style files, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex f9e6e4b 32/69: New function for reading documentation with texdoc, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 57147c7 59/69: Another fix for vertical bad box warnings,
Tassilo Horn <=
- [AUCTeX-devel] [elpa] externals/auctex af1ee52 47/69: Add support for missing macro \SetLabelAlign, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 17d1a5d 36/69: ; Merge branch 'simplify-TeX-parse-error', Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 6962c34 56/69: Avoid checking duplicate directories in TeX-check-files, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 416f131 40/69: Catch LaTeX class warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex b88dc70 64/69: Improve prompts when defining LaTeX macros., Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 00d9438 45/69: Add support for dviout viewer, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 464bef6 39/69: Fix TeX-parse-error, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 70e62a9 57/69: Catch more bad box warnings, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex d4b0d5f 67/69: Fix forward sync bug with multi-file documents, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 1711536 55/69: Fix detection of line number in TeX-warning, Tassilo Horn, 2016/03/26