[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org b84018633e 13/14: ox-latex: Split org-latex-compile
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org b84018633e 13/14: ox-latex: Split org-latex-compile into two funs |
Date: |
Sun, 22 Jan 2023 10:58:11 -0500 (EST) |
branch: externals/org
commit b84018633eaebb08b90fca12237b0b892d19a528
Author: TEC <git@tecosaur.net>
Commit: Ihor Radchenko <yantar92@posteo.net>
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'.
---
lisp/ox-latex.el | 39 +++++++++++++++++++++++----------------
1 file changed, 23 insertions(+), 16 deletions(-)
diff --git a/lisp/ox-latex.el b/lisp/ox-latex.el
index 330007eba9..156940703a 100644
--- a/lisp/ox-latex.el
+++ b/lisp/ox-latex.el
@@ -4301,25 +4301,32 @@ produced."
(outfile (org-compile-file texfile process "pdf"
(format "See %S for details" log-buf-name)
log-buf spec)))
- (unless snippet
- (when org-latex-remove-logfiles
- (mapc #'delete-file
- (directory-files
- (file-name-directory outfile)
- t
- (concat (regexp-quote (file-name-base outfile))
- "\\(?:\\.[0-9]+\\)?\\."
- (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 "."))))))
+ (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
+ (directory-files
+ (file-name-directory outfile)
+ t
+ (concat (regexp-quote (file-name-base outfile))
+ "\\(?:\\.[0-9]+\\)?\\."
+ (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 ".")))))))
+
(defun org-latex--collect-warnings (buffer)
"Collect some warnings from \"pdflatex\" command output.
BUFFER is the buffer containing output. Return collected
- [elpa] externals/org 0af74d33a7 03/14: org-manual: Fix typos in print_bibliography kwd, (continued)
- [elpa] externals/org 0af74d33a7 03/14: org-manual: Fix typos in print_bibliography kwd, ELPA Syncer, 2023/01/22
- [elpa] externals/org ffd832d5d6 06/14: org-manual: Update #+include block parsing, ELPA Syncer, 2023/01/22
- [elpa] externals/org e9c0696f79 08/14: org-persist: Inhibit fsync when writing cachefiles, ELPA Syncer, 2023/01/22
- [elpa] externals/org 4b546e04af 02/14: org-element--cache-submit-request: Ensure correct cache synchronization, ELPA Syncer, 2023/01/22
- [elpa] externals/org 7e649050c7 05/14: ox: Pass through unparsed #+include content, ELPA Syncer, 2023/01/22
- [elpa] externals/org c8f88589cb 09/14: org-persist: Set utf-8 coding when reading/writing, ELPA Syncer, 2023/01/22
- [elpa] externals/org b29f772416 10/14: org-macs: Split org-compile-file into two funs, ELPA Syncer, 2023/01/22
- [elpa] externals/org f0dfbf0c39 14/14: ox-latex: Erase compile buffer at the start, ELPA Syncer, 2023/01/22
- [elpa] externals/org 5cde90e3c8 04/14: ox: Refactor org-export-expand-include-keyword, ELPA Syncer, 2023/01/22
- [elpa] externals/org 506989bed5 07/14: ox: Improve #+include parsing docstring, ELPA Syncer, 2023/01/22
- [elpa] externals/org b84018633e 13/14: ox-latex: Split org-latex-compile into two funs,
ELPA Syncer <=
- [elpa] externals/org d0c87c762a 11/14: ox-latex: Do not hardcode fallback compiler, ELPA Syncer, 2023/01/22
- [elpa] externals/org 18d2f871c2 12/14: org: Split org-format-latex into two functions, ELPA Syncer, 2023/01/22