lisp/org.el: Update previews correctly when color chnages.

* lisp/org.el (org-format-latex): When computing a hash that
determines if a preview needs to be re-generated, use the actual color
of the face rather than just the setting symbol.
This commit is contained in:
Yuri D. Lensky 2021-02-24 12:40:25 -08:00 committed by Bastien Guerry
parent 31d48755bf
commit 8bdcf51acf
1 changed files with 16 additions and 6 deletions

View File

@ -15980,15 +15980,25 @@ Some of the options can be changed using the variable
(fg
(let ((color (plist-get org-format-latex-options
:foreground)))
(if (and forbuffer (eq color 'auto))
(face-attribute face :foreground nil 'default)
color)))
(if forbuffer
(cond
((eq color 'auto)
(face-attribute face :foreground nil 'default))
((eq color 'default)
(face-attribute 'default :foreground nil))
(t color))
color)))
(bg
(let ((color (plist-get org-format-latex-options
:background)))
(if (and forbuffer (eq color 'auto))
(face-attribute face :background nil 'default)
color)))
(if forbuffer
(cond
((eq color 'auto)
(face-attribute face :background nil 'default))
((eq color 'default)
(face-attribute 'default :background nil))
(t color))
color)))
(hash (sha1 (prin1-to-string
(list org-format-latex-header
org-latex-default-packages-alist