emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 26740f30469: Use a face for DocView SVG


From: Eli Zaretskii
Subject: master 26740f30469: Use a face for DocView SVG
Date: Thu, 9 Mar 2023 05:05:17 -0500 (EST)

branch: master
commit 26740f30469c2b13765f986fa65eca8a3a851ba2
Author: Manuel Giraud <manuel@ledu-giraud.fr>
Commit: Eli Zaretskii <eliz@gnu.org>

    Use a face for DocView SVG
    
    * lisp/doc-view.el (doc-view-svg-face): New face for SVG images.
    (doc-view-insert-image): Use it.  (Bug#61816)
---
 etc/NEWS         |  6 ++++++
 lisp/doc-view.el | 19 ++++++++-----------
 2 files changed, 14 insertions(+), 11 deletions(-)

diff --git a/etc/NEWS b/etc/NEWS
index 540b59a628f..13d073c7fb8 100644
--- a/etc/NEWS
+++ b/etc/NEWS
@@ -214,6 +214,12 @@ bound to 'C-c C-d' in 'go-ts-mode'.
 When this is non-nil, call the 'man' program synchronously rather than
 asynchronously (which is the default behavior).
 
+** DocView
+
+---
+*** New face 'doc-view-svg-face'.
+This replaces 'doc-view-svg-foreground' and 'doc-view-svg-background'.
+
 
 * New Modes and Packages in Emacs 30.1
 
diff --git a/lisp/doc-view.el b/lisp/doc-view.el
index 0303fec67a6..b14655fb274 100644
--- a/lisp/doc-view.el
+++ b/lisp/doc-view.el
@@ -236,17 +236,14 @@ showing only titles and no page number."
   :type 'boolean
   :version "29.1")
 
-(defcustom doc-view-svg-background "white"
-  "Background color for svg images.
+(defface doc-view-svg-face '((t :inherit default))
+  "Face used for SVG images.  Only background and foreground colors
+are used.
 See `doc-view-mupdf-use-svg'."
-  :type 'color
-  :version "29.1")
+  :version "30.1")
 
-(defcustom doc-view-svg-foreground "black"
-  "Foreground color for svg images.
-See `doc-view-mupdf-use-svg'."
-  :type 'color
-  :version "29.1")
+(make-obsolete 'doc-view-svg-background 'doc-view-svg-face "30.1")
+(make-obsolete 'doc-view-svg-foreground 'doc-view-svg-face "30.1")
 
 (defcustom doc-view-ghostscript-options
   '("-dSAFER" ;; Avoid security problems when rendering files from untrusted
@@ -1602,8 +1599,8 @@ ARGS is a list of image descriptors."
                           (unless (member :transform-smoothing args)
                             (setq args `(,@args :transform-smoothing t)))
                           (when (eq doc-view--image-type 'svg)
-                            (setq args `(,@args :background 
,doc-view-svg-background
-                                               :foreground 
,doc-view-svg-foreground)))
+                            (setq args `(,@args :background ,(face-background 
'doc-view-svg-face)
+                                                :foreground ,(face-foreground 
'doc-view-svg-face))))
                          (apply #'create-image file doc-view--image-type nil 
args))))
             (slice (doc-view-current-slice))
             (img-width (and image (car (image-size image))))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]