From 513b4a1b12a6939094b9829a4f5aea59937f5f03 Mon Sep 17 00:00:00 2001 From: Karthik Chikmagalur Date: Sun, 14 May 2023 17:18:57 -0700 Subject: [PATCH] org-latex-preview: Change preview hashing parameters * lisp/org-latex-preview.el (org-latex-preview--hash): Use only the `:scale' parameter from `org-latex-preview-options' when hashing fragments. Other parameters like `:zoom' do not affect the content of the image, so this helps avoid building up garbage in the org-persist cache. `org-latex-preview' is also faster since re-rendering images is required less often. --- lisp/org-latex-preview.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/org-latex-preview.el b/lisp/org-latex-preview.el index e3862f050..c535df81f 100644 --- a/lisp/org-latex-preview.el +++ b/lisp/org-latex-preview.el @@ -1151,10 +1151,12 @@ NUMBER is the equation number that should be used, if applicable." (sha1 (prin1-to-string (list processing-type preamble - org-latex-preview-options string (if (equal imagetype "svg") - 'svg fg) + 'svg + (list (plist-get + org-latex-preview-options :scale) + fg)) bg number))))