From c230fef02b94c06dcd84e1bf273165a391339e21 Mon Sep 17 00:00:00 2001 From: TEC Date: Wed, 28 Dec 2022 02:11:03 +0800 Subject: [PATCH] org-latex-preview: Run dvipng concurrently * lisp/org-latex-preview.el (org-create-formula-image-async): When using dvipng with the "--follow" flag, image processing can occur concurrently, so we may as well check for this case and start it concurrently when this occurs. --- lisp/org-latex-preview.el | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/lisp/org-latex-preview.el b/lisp/org-latex-preview.el index 5ff8279f2..03677e0de 100644 --- a/lisp/org-latex-preview.el +++ b/lisp/org-latex-preview.el @@ -584,8 +584,11 @@ MOVEFILES." (org-latex-preview--tex-compile-async extended-info)) (img-extract-async (org-latex-preview--image-extract-async extended-info))) - (plist-put (cdr tex-compile-async) :success img-extract-async) - (plist-put (cdr tex-compile-async) :failure img-extract-async) + (if (and (eq processing-type 'dvipng) + (member "--follow" (car img-extract-async))) + (apply #'org-async-call img-extract-async) + (plist-put (cdr tex-compile-async) :success img-extract-async) + (plist-put (cdr tex-compile-async) :failure img-extract-async)) (plist-put (cdr img-extract-async) :success #'org-latex-preview--cleanup-callback) (apply #'org-async-call tex-compile-async))))