org-latex-preview: Fix clear-cache command

* lisp/org-latex-preview.el (org-latex-preview-clear-cache): When
clearing the preview cache, clear the cached preamble after clearing
the image cache, since the preamble is used to compute the image
hashes.
This commit is contained in:
Karthik Chikmagalur 2023-05-14 17:06:28 -07:00 committed by TEC
parent b536e6506d
commit 0549f0f55f
Signed by: tec
SSH Key Fingerprint: SHA256:eobz41Mnm0/iYWBvWThftS0ElEs1ftBr6jamutnXc/A
1 changed files with 4 additions and 3 deletions

View File

@ -2119,8 +2119,7 @@ the *entire* preview cache will be cleared, and `org-persist-gc' run."
(org-latex--remove-cached-preamble
compiler org-latex-preview--preamble-content nil)
(org-latex--remove-cached-preamble
compiler org-latex-preview--preamble-content t))
(org-latex-preview--clear-preamble-cache))
compiler org-latex-preview--preamble-content t)))
(org-latex-preview-clear-overlays beg end)
(if clear-entire-cache
(let ((n 0))
@ -2162,7 +2161,9 @@ the *entire* preview cache will be cleared, and `org-persist-gc' run."
org-latex-preview--preamble-content
value imagetype fg bg number))))
(message "Cleared LaTeX preview cache for %s."
(if (or beg end) "region" "buffer")))))
(if (or beg end) "region" "buffer"))))
(when (or clear-entire-cache (not (or beg end)))
(org-latex-preview--clear-preamble-cache)))
(defun org-latex-preview-precompile (processing-info preamble &optional tempfile-p)
"Precompile/dump LaTeX PREAMBLE text.