branch: externals/auctex-cont-latexmk commit 5e9df47dafa3e47b6cab1d01947dbd58935235db Author: Paul Nelson <ultr...@gmail.com> Commit: Paul Nelson <ultr...@gmail.com>
Put errors without file or line number at end of buffer --- tex-continuous.el | 80 ++++++++++++++++++++++++++++++------------------------- 1 file changed, 43 insertions(+), 37 deletions(-) diff --git a/tex-continuous.el b/tex-continuous.el index ca9707a329..9745ff3d43 100644 --- a/tex-continuous.el +++ b/tex-continuous.el @@ -115,46 +115,52 @@ Takes into account `TeX-output-dir'." The arguments are as in `TeX-error-list'. Return either nil or a triple (ERROR-P DESCRIPTION (BEG . END)), where ERROR-P is non-nil if it is an error rather than a warning." - (and - (not ignore) - (stringp file) - (or (not bad-box) TeX-debug-bad-boxes) - (when-let - ((region - (save-restriction - (widen) - (cond - ((file-equal-p file (buffer-file-name)) - (when line - (if (eq type 'error) - (save-excursion - (goto-char (point-min)) - (forward-line (+ line offset -1)) - (unless (string= search-string " ") - (search-forward search-string nil t) - (cons (point) (1+ (point))))) - (flymake-diag-region (current-buffer) (+ line offset))))) - ((file-equal-p file (tex-continuous--build-file "aux")) - (and tex-continuous-report-multiple-labels - (string-match-p "multiply defined" message) - (not (eq type 'error)) - (let* ((label (progn - (string-match "`\\(.*\\)'" message) - (match-string 1 message))) - (label-re - (concat "\\\\label\\(?:\\[[^]]+\\]\\)?{" - (regexp-quote label) "}"))) + (or + (and + (not ignore) + (stringp file) + (or (not bad-box) TeX-debug-bad-boxes) + (when-let + ((region + (save-restriction + (widen) + (cond + ((file-equal-p file (buffer-file-name)) + (when line + (if (eq type 'error) (save-excursion (goto-char (point-min)) - (when (re-search-forward label-re nil t) - ;; Return the full line so the diagnostic is - ;; not covered by preview overlays when - ;; \\label appears after \\begin{equation}. - (cons (line-beginning-position) - (line-end-position))))))))))) - (list (eq type 'error) + (forward-line (+ line offset -1)) + (unless (string= search-string " ") + (search-forward search-string nil t) + (cons (point) (1+ (point))))) + (flymake-diag-region (current-buffer) (+ line offset))))) + ((file-equal-p file (tex-continuous--build-file "aux")) + (and tex-continuous-report-multiple-labels + (string-match-p "multiply defined" message) + (not (eq type 'error)) + (let* ((label (progn + (string-match "`\\(.*\\)'" message) + (match-string 1 message))) + (label-re + (concat "\\\\label\\(?:\\[[^]]+\\]\\)?{" + (regexp-quote label) "}"))) + (save-excursion + (goto-char (point-min)) + (when (re-search-forward label-re nil t) + ;; Return the full line so the diagnostic is + ;; not covered by preview overlays when + ;; \\label appears after \\begin{equation}. + (cons (line-beginning-position) + (line-end-position))))))))))) + (list (eq type 'error) + (replace-regexp-in-string "\n" "" message) + region))) + ;; Put errors without file or line at bottom of buffer. + (when (eq type 'error) + (list t (replace-regexp-in-string "\n" "" message) - region)))) + (cons (1- (point-max)) (point-max)))))) (defun tex-continuous--format-log-buffer () "Format the current log buffer by joining lines suitably.