[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/org 8bdcf51 4/5: lisp/org.el: Update previews correctly
From: |
ELPA Syncer |
Subject: |
[elpa] externals/org 8bdcf51 4/5: lisp/org.el: Update previews correctly when color chnages. |
Date: |
Tue, 27 Apr 2021 03:57:13 -0400 (EDT) |
branch: externals/org
commit 8bdcf51acff5ed4b4dff30a3e81f53e9990b9a25
Author: Yuri D. Lensky <ydl@Yuris-MacBook-Pro.local>
Commit: Bastien Guerry <bzg@gnu.org>
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.
---
lisp/org.el | 22 ++++++++++++++++------
1 file changed, 16 insertions(+), 6 deletions(-)
diff --git a/lisp/org.el b/lisp/org.el
index 2e21ea8..50cace2 100644
--- a/lisp/org.el
+++ b/lisp/org.el
@@ -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