emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/svg-tag-mode 57999eb4c4 1/2: Allow :face property of sv


From: ELPA Syncer
Subject: [elpa] externals/svg-tag-mode 57999eb4c4 1/2: Allow :face property of svg-tag-make to be a string
Date: Tue, 10 Jan 2023 13:58:15 -0500 (EST)

branch: externals/svg-tag-mode
commit 57999eb4c40c644890cedf0db6524f7836ee7af6
Author: Shankar Rao <shankar.rao@gmail.com>
Commit: Shankar Rao <shankar.rao@gmail.com>

    Allow :face property of svg-tag-make to be a string
---
 svg-tag-mode.el | 15 ++++++++++-----
 1 file changed, 10 insertions(+), 5 deletions(-)

diff --git a/svg-tag-mode.el b/svg-tag-mode.el
index 448756b4a4..7878b9ec8a 100644
--- a/svg-tag-mode.el
+++ b/svg-tag-mode.el
@@ -158,11 +158,16 @@ string as argument and returns a SVG tag."
 
 (defun svg-tag--face-attribute (face attribute)
   "Return the value of FACE's ATTRIBUTE in the selected frame.
-FACE can either be a face or a property list."
+FACE can either be a face, property list (i.e., an anonymous
+face), or a string (assumed to be the foreground attribute). If
+ATTRIBUTE is not specified in FACE, then use the corresponding
+attribute from ``svg-tag-default-face''."
   (if (facep face)
       (face-attribute face attribute nil 'default)
-    (or (plist-get face attribute)
-        (face-attribute 'svg-tag-default-face attribute nil 'default))))
+    (if (and (stringp face) (eq attribute :foreground))
+        face
+      (or (plist-get face attribute)
+          (face-attribute 'svg-tag-default-face attribute nil 'default)))))
 
 
 (defun svg-tag-make (tag &optional &rest args)
@@ -177,8 +182,8 @@ FACE can either be a face or a property list."
   :end (integer) specifies the last index of the tag substring to
                  take into account (default nil)
 
-  :face (face) indicates the face or property list to use to compute 
-               foreground & background color. (default 'default)
+  :face (face) indicates the face, property list or string to use to 
+               compute foreground & background color. (default 'default)
 
   :inverse (bool) indicates whether to inverse foreground &
                   background color (default nil)



reply via email to

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