org-latex-preview: Clean up tex file on failure

*
lisp/org-latex-preview.el (org-latex-preview--create-image-async):
Ensure that the latex-preview cleanup callback runs when the
preview image extraction process fails.  This is to avoid
littering the default-directory with temporary tex files.
This commit is contained in:
Karthik Chikmagalur 2023-03-01 00:28:07 -08:00 committed by TEC
parent ce260ed2c9
commit 52fd5cabea
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 2 additions and 1 deletions

View File

@ -1377,7 +1377,8 @@ Returns a list of async tasks started."
(list
#'org-latex-preview--failure-callback
(format "Creating LaTeX preview images failed (exit code %%d). Please see %s for details"
(propertize org-latex-preview--image-log 'face 'warning))))
(propertize org-latex-preview--image-log 'face 'warning))
#'org-latex-preview--cleanup-callback))
(pcase processing-type
('dvipng
(plist-put (cddr img-extract-async) :filter