# HG changeset patch # User Jason Rumney # Date 1239631608 0 # Node ID 8567720fb081e561b37160c7763eb52e6d5e012d # Parent b357cd8137b6d70a74e167f64963a9010e25b1bb (frame-set-background-mode): Window system frames default to light. Use default in cases where specified color does not exist (Bug#2969). diff -r b357cd8137b6 -r 8567720fb081 lisp/ChangeLog --- a/lisp/ChangeLog Mon Apr 13 12:59:07 2009 +0000 +++ b/lisp/ChangeLog Mon Apr 13 14:06:48 2009 +0000 @@ -1,3 +1,9 @@ +2009-04-13 Jason Rumney + + * 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 * language/japanese.el (cp932): Delete alias for diff -r b357cd8137b6 -r 8567720fb081 lisp/faces.el --- a/lisp/faces.el Mon Apr 13 12:59:07 2009 +0000 +++ b/lisp/faces.el Mon Apr 13 14:06:48 2009 +0000 @@ -1847,28 +1847,22 @@ (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