From a4ea869cfd4da4dd49e81941be0a3e07533bc210 Mon Sep 17 00:00:00 2001 From: Juri Linkov Date: Wed, 29 Jun 2005 20:55:15 +0000 Subject: [PATCH] (default-frame-background-mode): New internal variable. (frame-set-background-mode): Use it. --- lisp/faces.el | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/lisp/faces.el b/lisp/faces.el index b7d06513fd8..c28cbc5d84f 100644 --- a/lisp/faces.el +++ b/lisp/faces.el @@ -1575,6 +1575,13 @@ this won't have the expected effect." (choice-item light) (choice-item :tag "default" nil))) +(defvar default-frame-background-mode nil + "Internal variable for the default brightness of the background. +Emacs sets it automatically depending on the terminal type. +The value `nil' means `dark'. If Emacs runs in non-windowed +mode from `xterm' or a similar terminal emulator, the value is +`light'. On rxvt terminals, the value depends on the environment +variable COLORFGBG.") (defun frame-set-background-mode (frame) "Set up display-dependent faces on FRAME. @@ -1590,13 +1597,13 @@ according to the `background-mode' and `display-type' frame parameters." (intern (downcase bg-resource))) ((and (null window-system) (null bg-color)) ;; No way to determine this automatically (?). - 'dark) + (or default-frame-background-mode 'dark)) ;; Unspecified frame background color can only happen ;; on tty's. ((member bg-color '(unspecified "unspecified-bg")) - 'dark) + (or default-frame-background-mode 'dark)) ((equal bg-color "unspecified-fg") ; inverted colors - 'light) + (if (eq default-frame-background-mode 'light) 'dark 'light)) ((>= (apply '+ (x-color-values bg-color frame)) ;; Just looking at the screen, colors whose ;; values add up to .6 of the white total -- 2.39.2