Commit 0fd8a324 authored by Richard M. Stallman's avatar Richard M. Stallman
Browse files

(set-face-background): If color is gray, and frame

can't display that directly, use corresponding stipple.
(face-try-color-list): Assume gray colors are valid on any display.
parent 2297e912
...@@ -109,6 +109,10 @@ in that frame; otherwise change each frame." ...@@ -109,6 +109,10 @@ in that frame; otherwise change each frame."
If the optional FRAME argument is provided, change only If the optional FRAME argument is provided, change only
in that frame; otherwise change each frame." in that frame; otherwise change each frame."
(interactive (internal-face-interactive "background")) (interactive (internal-face-interactive "background"))
(if (and frame (member color '("gray" "gray1" "gray3"))
(not (x-display-color-p frame))
(not (x-display-grayscale-p frame)))
(set-face-stipple face color frame))
(internal-set-face-1 face 'background color 5 frame)) (internal-set-face-1 face 'background color 5 frame))
(defsubst set-face-stipple (face name &optional frame) (defsubst set-face-stipple (face name &optional frame)
...@@ -966,8 +970,9 @@ selected frame." ...@@ -966,8 +970,9 @@ selected frame."
;; That can't fail, so any subsequent elements after the t are ignored. ;; That can't fail, so any subsequent elements after the t are ignored.
(defun face-try-color-list (function face colors frame) (defun face-try-color-list (function face colors frame)
(if (stringp colors) (if (stringp colors)
(if (or (and (not (x-display-color-p)) (not (string= colors "gray"))) (if (and (not (member colors '("gray" "gray1" "gray3")))
(= (x-display-planes) 1)) (or (not (x-display-color-p))
(= (x-display-planes) 1)))
nil nil
(funcall function face colors frame)) (funcall function face colors frame))
(if (eq colors t) (if (eq colors t)
...@@ -975,9 +980,9 @@ selected frame." ...@@ -975,9 +980,9 @@ selected frame."
(let (done) (let (done)
(while (and colors (not done)) (while (and colors (not done))
(if (and (stringp (car colors)) (if (and (stringp (car colors))
(or (and (not (x-display-color-p)) (and (not (member (car colors) '("gray" "gray1" "gray3")))
(not (string= (car colors) "gray"))) (or (not (x-display-color-p))
(= (x-display-planes) 1))) (= (x-display-planes) 1))))
nil nil
(if (cdr colors) (if (cdr colors)
;; If there are more colors to try, catch errors ;; If there are more colors to try, catch errors
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment