[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[AUCTeX-devel] [elpa] externals/auctex 464bef6 39/69: Fix TeX-parse-erro
From: |
Tassilo Horn |
Subject: |
[AUCTeX-devel] [elpa] externals/auctex 464bef6 39/69: Fix TeX-parse-error |
Date: |
Sat, 26 Mar 2016 21:36:35 +0000 |
branch: externals/auctex
commit 464bef63b52ef3aee0b50c4bee76d24dc6b58ddc
Author: Mosè Giordano <address@hidden>
Commit: Mosè Giordano <address@hidden>
Fix TeX-parse-error
* tex-buf.el (TeX-parse-error): Remove from the file string pages of the
output file.
* tests/tex/compilation-log.txt: Add a warning containing such faulty
file name.
* tests/tex/error-parsing.el (TeX-error-parsing): Update result of the
test accordingly.
---
tests/tex/compilation-log.txt | 7 ++++++-
tests/tex/error-parsing.el | 10 ++++++++--
tex-buf.el | 20 ++++++++++++++++----
3 files changed, 30 insertions(+), 7 deletions(-)
diff --git a/tests/tex/compilation-log.txt b/tests/tex/compilation-log.txt
index f28dbf1..98b3422 100644
--- a/tests/tex/compilation-log.txt
+++ b/tests/tex/compilation-log.txt
@@ -5,4 +5,9 @@
Package foo Warning: This is a warning!
-[1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux))
+[1{/opt/texlive/2015/texmf-var/fonts/map/pdftex/updmap/pdftex.map}]
(./test.aux)
+
+(./secondary-file.tex [8] [9] [10]
+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 aa01629..ce09750 100644
--- a/tests/tex/error-parsing.el
+++ b/tests/tex/error-parsing.el
@@ -44,12 +44,18 @@ command line and from another directory."
"Test error parsing functions."
(should (equal
(with-temp-buffer
- (setq TeX-debug-warnings t)
+ (setq TeX-debug-warnings t
+ TeX-debug-bad-boxes t)
(insert-file-contents TeX-test-compilation-log)
(TeX-parse-all-errors)
TeX-error-list)
'((warning "./test.tex" nil "Package foo Warning: This is a warning!"
0 "Package foo Warning: This is a warning!
"
- nil nil nil 170)))))
+ nil nil nil 170)
+ (bad-box
+ "./secondary-file.tex" 131
+ "Underfull \hbox (badness 6608) in paragraph at lines 131--132"
+ 0 "
[]|\T1/jkpl/m/n/10.95 (+20) Something bla" "bla"
+ 132 10 391)))))
;;; error-parsing.el ends here
diff --git a/tex-buf.el b/tex-buf.el
index 3478590..d44cbc7 100644
--- a/tex-buf.el
+++ b/tex-buf.el
@@ -2319,11 +2319,23 @@ Return non-nil if an error or warning is found."
(when (or (eq (string-to-char file) ?\")
(string-match "[
]" file))
(setq file (mapconcat 'identity (split-string file "[\"
]+") "")))
- ;; Trim whitespace at the front/end
+ ;; Polish `file' string
(setq file
- (progn
- (string-match
"^[[:space:]]*\(.*[^[:space:]]\)[[:space:]]*$" file)
- (match-string 1 file)))
+ (let ((string file))
+ ;; Trim whitespaces at the front. XXX: XEmacs doesn't
+ ;; support character classes in regexps, like "[:space:]".
+ (setq string
+ (if (string-match "\'[
]*" string)
+ (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)
+ (replace-match "" t t string)
+ string)))
(push file TeX-error-file)
(push nil TeX-error-offset)
(goto-char end))
- [AUCTeX-devel] [elpa] externals/auctex d7f443e 37/69: Add script to update the ChangeLog, (continued)
- [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, 2016/03/26
- [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 <=
- [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
- [AUCTeX-devel] [elpa] externals/auctex f1abcf8 69/69: Upgrade docs for release, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 550e058 49/69: Add new style/splitidx.el, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex cc59302 51/69: Show and hide warnings and bad boxes in error overview, Tassilo Horn, 2016/03/26
- [AUCTeX-devel] [elpa] externals/auctex 8fac199 14/69: Merge branch 'master' into simplify-TeX-parse-error, Tassilo Horn, 2016/03/26