ox-latex: Make errors/warnings during PDF generation more obvious

* lisp/ox-latex.el (org-latex-compile--postprocess): Display a
warning, not message when there are problems with PDF generation.
This commit is contained in:
Ihor Radchenko 2024-02-14 15:34:19 +01:00
parent 9eec4af620
commit 0e1f0e1605
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 11 additions and 5 deletions

View File

@ -4422,11 +4422,17 @@ log files (as specified by `org-latex-logfiles-extensions') are deleted."
(regexp-opt org-latex-logfiles-extensions))
t)))
(let ((warnings (org-latex--collect-warnings log-buf)))
(message (concat "PDF file produced"
(cond
((eq warnings 'error) " with errors.")
(warnings (concat " with warnings: " warnings))
(t ".")))))))
(funcall
(if warnings
(apply-partially
#'display-warning
'(ox-latex))
#'message)
(concat "PDF file produced"
(cond
((eq warnings 'error) " with errors.")
(warnings (concat " with warnings: " warnings))
(t ".")))))))
(defun org-latex--collect-warnings (buffer)
"Collect some warnings from \"pdflatex\" command output.