summaryrefslogtreecommitdiff
path: root/lisp
diff options
context:
space:
mode:
authorJason Rumney <jasonr@gnu.org>2009-04-13 14:06:48 +0000
committerJason Rumney <jasonr@gnu.org>2009-04-13 14:06:48 +0000
commitdf93e5136ed4e3742cbbebf89de7188d13621cc6 (patch)
tree38a59592582fed6b8dce1ed02b753e3d32633d8b /lisp
parent759f43a0c492d77d09f6c95c7f581811e4ef2e19 (diff)
downloademacs-df93e5136ed4e3742cbbebf89de7188d13621cc6.tar.gz
(frame-set-background-mode): Window system frames
default to light. Use default in cases where specified color does not exist (Bug#2969).
Diffstat (limited to 'lisp')
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/faces.el28
2 files changed, 17 insertions, 17 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index c50a95df7ab..fd14c1aade7 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
+2009-04-13 Jason Rumney <jasonr@gnu.org>
+
+ * faces.el (frame-set-background-mode): Window system frames
+ default to light. Use default in cases where specified color
+ does not exist (Bug#2969).
+
2009-04-13 Kenichi Handa <handa@m17n.org>
* language/japanese.el (cp932): Delete alias for
diff --git a/lisp/faces.el b/lisp/faces.el
index 21de277cbce..7e4c6d3a29c 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1847,28 +1847,22 @@ according to the `background-mode' and `display-type' frame parameters."
(bg-color (frame-parameter frame 'background-color))
(terminal-bg-mode (terminal-parameter frame 'background-mode))
(tty-type (tty-type frame))
+ (default-bg-mode
+ (if (or (window-system frame)
+ (and tty-type
+ (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)"
+ tty-type)))
+ 'light
+ 'dark))
+ (non-default-bg-mode (if (eq default-bg-mode 'light) 'dark 'light))
(bg-mode
(cond (frame-background-mode)
(bg-resource (intern (downcase bg-resource)))
(terminal-bg-mode)
- ((and (null (window-system frame))
- ;; Unspecified frame background color can only
- ;; happen on tty's.
- (member bg-color '(nil unspecified "unspecified-bg")))
- ;; There is no way to determine the background mode
- ;; automatically, so we make a guess based on the
- ;; terminal type.
- (if (and tty-type
- (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
- tty-type))
- 'light
- 'dark))
((equal bg-color "unspecified-fg") ; inverted colors
- (if (and tty-type
- (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
- tty-type))
- 'dark
- 'light))
+ non-default-bg-mode)
+ ((not (color-values bg-color frame))
+ default-bg-mode)
((>= (apply '+ (color-values bg-color frame))
;; Just looking at the screen, colors whose
;; values add up to .6 of the white total