ox-latex: Split org-latex-compile into two funs

* lisp/ox-latex.el (org-latex-compile): Split off the postprocessing in
`org-latex-compile' into a new function,
`org-latex-compile--postprocess'.
This commit is contained in:
TEC 2022-12-25 00:57:59 +08:00 committed by Ihor Radchenko
parent 18d2f871c2
commit b84018633e
No known key found for this signature in database
GPG Key ID: 6470762A7DA11D8B
1 changed files with 23 additions and 16 deletions

View File

@ -4301,6 +4301,15 @@ produced."
(outfile (org-compile-file texfile process "pdf"
(format "See %S for details" log-buf-name)
log-buf spec)))
(org-latex-compile--postprocess outfile log-buf snippet)
;; Return output file name.
outfile))
(defun org-latex-compile--postprocess (outfile log-buf &optional snippet)
"Process the results of creating OUTFILE via LaTeX compilation.
Warnings and errors are collected from LOG-BUF.
When SNIPPET is nil and `org-latex-remove-logfiles' non-nil,
log files (as specified by `org-latex-logfiles-extensions') are deleted."
(unless snippet
(when org-latex-remove-logfiles
(mapc #'delete-file
@ -4316,9 +4325,7 @@ produced."
(cond
((eq warnings 'error) " with errors.")
(warnings (concat " with warnings: " warnings))
(t "."))))))
;; Return output file name.
outfile))
(t ".")))))))
(defun org-latex--collect-warnings (buffer)
"Collect some warnings from \"pdflatex\" command output.