Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
larsmagne committed Mar 22, 2021
1 parent 4d944f6 commit add90dc
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lisp/faces.el
Expand Up @@ -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
Expand Down

0 comments on commit add90dc

Please sign in to comment.