Forráskód Böngészése

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.
Yuri D. Lensky 4 éve
szülő
commit
8bdcf51acf
1 módosított fájl, 16 hozzáadás és 6 törlés
  1. 16 6
      lisp/org.el

+ 16 - 6
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