aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Rumney2009-04-13 14:06:48 +0000
committerJason Rumney2009-04-13 14:06:48 +0000
commitdf93e5136ed4e3742cbbebf89de7188d13621cc6 (patch)
tree38a59592582fed6b8dce1ed02b753e3d32633d8b
parent759f43a0c492d77d09f6c95c7f581811e4ef2e19 (diff)
downloademacs-df93e5136ed4e3742cbbebf89de7188d13621cc6.tar.gz
emacs-df93e5136ed4e3742cbbebf89de7188d13621cc6.zip
(frame-set-background-mode): Window system frames
default to light. Use default in cases where specified color does not exist (Bug#2969).
-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 @@
12009-04-13 Jason Rumney <jasonr@gnu.org>
2
3 * faces.el (frame-set-background-mode): Window system frames
4 default to light. Use default in cases where specified color
5 does not exist (Bug#2969).
6
12009-04-13 Kenichi Handa <handa@m17n.org> 72009-04-13 Kenichi Handa <handa@m17n.org>
2 8
3 * language/japanese.el (cp932): Delete alias for 9 * 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."
1847 (bg-color (frame-parameter frame 'background-color)) 1847 (bg-color (frame-parameter frame 'background-color))
1848 (terminal-bg-mode (terminal-parameter frame 'background-mode)) 1848 (terminal-bg-mode (terminal-parameter frame 'background-mode))
1849 (tty-type (tty-type frame)) 1849 (tty-type (tty-type frame))
1850 (default-bg-mode
1851 (if (or (window-system frame)
1852 (and tty-type
1853 (string-match "^\\(xterm\\|\\rxvt\\|dtterm\\|eterm\\)"
1854 tty-type)))
1855 'light
1856 'dark))
1857 (non-default-bg-mode (if (eq default-bg-mode 'light) 'dark 'light))
1850 (bg-mode 1858 (bg-mode
1851 (cond (frame-background-mode) 1859 (cond (frame-background-mode)
1852 (bg-resource (intern (downcase bg-resource))) 1860 (bg-resource (intern (downcase bg-resource)))
1853 (terminal-bg-mode) 1861 (terminal-bg-mode)
1854 ((and (null (window-system frame))
1855 ;; Unspecified frame background color can only
1856 ;; happen on tty's.
1857 (member bg-color '(nil unspecified "unspecified-bg")))
1858 ;; There is no way to determine the background mode
1859 ;; automatically, so we make a guess based on the
1860 ;; terminal type.
1861 (if (and tty-type
1862 (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)"
1863 tty-type))
1864 'light
1865 'dark))
1866 ((equal bg-color "unspecified-fg") ; inverted colors 1862 ((equal bg-color "unspecified-fg") ; inverted colors
1867 (if (and tty-type 1863 non-default-bg-mode)
1868 (string-match "^\\(xterm\\|rxvt\\|dtterm\\|eterm\\)" 1864 ((not (color-values bg-color frame))
1869 tty-type)) 1865 default-bg-mode)
1870 'dark
1871 'light))
1872 ((>= (apply '+ (color-values bg-color frame)) 1866 ((>= (apply '+ (color-values bg-color frame))
1873 ;; Just looking at the screen, colors whose 1867 ;; Just looking at the screen, colors whose
1874 ;; values add up to .6 of the white total 1868 ;; values add up to .6 of the white total