branch: externals/auctex-cont-latexmk
commit 993c2e62fe69021b1b565fe24ec51dd1b517b155
Author: Paul Nelson <[email protected]>
Commit: Paul Nelson <[email protected]>
adapt TeX-format-filter to format log more robustly
---
tex-continuous.el | 18 ++++++++++++++----
1 file changed, 14 insertions(+), 4 deletions(-)
diff --git a/tex-continuous.el b/tex-continuous.el
index 21ace8e2fd..8d558618cc 100644
--- a/tex-continuous.el
+++ b/tex-continuous.el
@@ -113,14 +113,24 @@ is an error rather than a warning."
(replace-regexp-in-string "\n" "" message)
region))))
+(defun tex-continuous--format-log-buffer ()
+ "Format the current log buffer by joining lines suitably.
+Adapted from `TeX-format-filter'"
+ (goto-char (point-max))
+ (while (> (point) (point-min))
+ (end-of-line 0)
+ (when (and (memq (- (point) (line-beginning-position)) '(79 80))
+ (not (memq (char-after (1+ (point))) '(?\n ?\()))
+ (not (and (eq (char-before) ?.)
+ (char-after (1+ (point)))
+ (not (eq ?w (char-syntax (char-after (1+
(point)))))))))
+ (delete-char 1))))
+
(defun tex-continuous--error-list (log-file)
"Retrieve parsed TeX error list from LOG-FILE."
(with-temp-buffer
(insert-file-contents log-file)
- (goto-char (point-min))
- (while (re-search-forward "Warning:" nil t)
- (let ((fill-column most-positive-fixnum))
- (call-interactively 'fill-paragraph)))
+ (tex-continuous--format-log-buffer)
(TeX-parse-all-errors)
TeX-error-list))