summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Nelson <ultrono@gmail.com>2024-04-22 14:36:47 +0200
committerPaul Nelson <ultrono@gmail.com>2024-04-23 12:57:15 +0200
commit993c2e62fe69021b1b565fe24ec51dd1b517b155 (patch)
treebfb81b631b05c918be8d91c32d1089aa13819339
parent6cbd9d149308a5008e0f57b56690416fe59aa80d (diff)
adapt TeX-format-filter to format log more robustly
-rw-r--r--tex-continuous.el18
1 files changed, 14 insertions, 4 deletions
diff --git a/tex-continuous.el b/tex-continuous.el
index 21ace8e..8d55861 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))