emacs-diffs
[Top][All Lists]
Advanced

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

master add90dc: Use read-color in read-face-attribute for color attribut


From: Lars Ingebrigtsen
Subject: master add90dc: Use read-color in read-face-attribute for color attributes
Date: Mon, 22 Mar 2021 14:50:27 -0400 (EDT)

branch: master
commit add90dcc8a1b61edeb62b53cec5b532b4bb5d311
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Use read-color in read-face-attribute for color attributes
    
    * lisp/faces.el (read-face-attribute): Use read-color when
    prompting for a color (bug#47316).
---
 lisp/faces.el | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/lisp/faces.el b/lisp/faces.el
index 5ae3906..3ea4c94 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1259,7 +1259,15 @@ of a global face.  Value is the new attribute value."
                   (or (car (rassoc old-value valid))
                       (format "%s" old-value))))
             (setq new-value
-                  (face-read-string face default attribute-name valid))
+                   (if (memq attribute '(:foreground :background))
+                       (let ((color
+                              (read-color
+                               (format-prompt "%s for face `%s'"
+                                              default attribute-name face))))
+                         (if (equal (string-trim color) "")
+                             default
+                           color))
+                    (face-read-string face default attribute-name valid)))
             (if (equal new-value default)
                 ;; Nothing changed, so don't bother with all the stuff
                 ;; below.  In particular, this avoids a non-tty color



reply via email to

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