>>>>> Ikumi Keita <[email protected]> writes: > (1) I think the attached patch circumvents this issue.
My previous attempt was insufficient as it doesn't continue search for errors after false match. Reworked patch is attached below. > However, > `TeX-parse-error' contains similar loose treatments for other > messages from (La)TeX. Should we add refinements to the rest of the > function as well? If nobody minds this concern, I'll commit my proposal. Regards, Ikumi Keita #StandWithUkraine #StopWarInUkraine
>From c4f04211c7e36a3ae2398cdd53917412767d8e62 Mon Sep 17 00:00:00 2001 From: Ikumi Keita <[email protected]> Date: Mon, 25 Apr 2022 00:19:46 +0900 Subject: [PATCH] Be more robust against false positive * tex.el (TeX-TeX-sentinel-check,TeX-parse-error): Check whether "file" really exists. If not, ignore it. --- tex.el | 42 +++++++++++++++++++++++++++++------------- 1 file changed, 29 insertions(+), 13 deletions(-) diff --git a/tex.el b/tex.el index 747753b3..1d091e1d 100644 --- a/tex.el +++ b/tex.el @@ -8256,7 +8256,12 @@ Return nil only if no errors were found." (match-string 1 output-file) "dvi"))))))) (if process (TeX-format-mode-line process)) - (if (re-search-forward "^\\(!\\|.*:[0-9]+:\\) " nil t) + (if (catch 'found + (while (re-search-forward "^\\(?:!\\|\\(.+?\\):[0-9]+:\\) " nil t) + (if (or (not (match-beginning 1)) + ;; Ignore non-error warning. (bug#55065) + (file-exists-p (TeX-match-buffer 1))) + (throw 'found t)))) (progn (message "%s errors in `%s'. Use %s to display." name (buffer-name) (substitute-command-keys @@ -8269,6 +8274,9 @@ Return nil only if no errors were found." 'TeX-current-master)) t)) t) + ;; In case that there were only non-error warnings of type + ;; bug#55065, restore point to the initial position. + (goto-char (point-min)) (let (dvi2pdf) (if (with-current-buffer TeX-command-buffer (and TeX-PDF-mode (setq dvi2pdf (TeX-PDF-from-DVI)))) @@ -9272,7 +9280,7 @@ Return non-nil if an error or warning is found." (let ((regexp (concat ;; TeX error - "^\\(!\\|\\(.*?\\):[0-9]+:\\) \\|" + "^\\(!\\|\\(.+?\\):[0-9]+:\\) \\|" ;; New file "(\n?\\([^\n()]+\\)\\|" ;; End of file. @@ -9302,17 +9310,25 @@ Return non-nil if an error or warning is found." nil) ;; TeX error ((match-beginning 1) - (when (match-beginning 2) - (unless TeX-error-file - (push nil TeX-error-file) - (push nil TeX-error-offset)) - (unless (car TeX-error-offset) - (rplaca TeX-error-file (TeX-match-buffer 2)))) - (setq error-found t) - (if (looking-at "Preview ") - t - (TeX-error store) - nil)) + (if (or (not (match-beginning 2)) + ;; Ignore non-error warning. (bug#55065) + (file-exists-p (TeX-match-buffer 2))) + (progn + (when (match-beginning 2) + (unless TeX-error-file + (push nil TeX-error-file) + (push nil TeX-error-offset)) + (unless (car TeX-error-offset) + (rplaca TeX-error-file (TeX-match-buffer 2)))) + (setq error-found t) + (if (looking-at "Preview ") + t + (TeX-error store) + nil)) + ;; This wasn't an actual TeX error. Go to the least + ;; possible point to search again. + (goto-char (1+ (match-beginning 1))) + t)) ;; LaTeX bad box ((match-beginning 7) ;; In `TeX-error-list' we collect all warnings, also if they're going -- 2.35.1
_______________________________________________ bug-auctex mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-auctex
