aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2000-10-19 06:56:50 +0000
committerEli Zaretskii2000-10-19 06:56:50 +0000
commit772139c0a612889052eb8017e8ef36b926e4cd9c (patch)
tree18e3029702a54c543831387448c8d70a3898a056
parent9f2feff6362924f004452f7195f7f1e6f487a7bf (diff)
downloademacs-772139c0a612889052eb8017e8ef36b926e4cd9c.tar.gz
emacs-772139c0a612889052eb8017e8ef36b926e4cd9c.zip
(frame-set-background-mode): If a tty frame defines a
background color, use that to compute the background mode, instead of always defaulting to "dark".
-rw-r--r--lisp/ChangeLog6
-rw-r--r--lisp/faces.el21
2 files changed, 19 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index af78d5e4df3..cdd3b0518df 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,3 +1,9 @@
12000-10-19 Eli Zaretskii <eliz@is.elta.co.il>
2
3 * faces.el (frame-set-background-mode): If a tty frame defines a
4 background color, use that to compute the background mode, instead
5 of always defaulting to "dark".
6
12000-10-19 Miles Bader <miles@lsi.nec.co.jp> 72000-10-19 Miles Bader <miles@lsi.nec.co.jp>
2 8
3 * comint.el (comint-write-output): New function. 9 * comint.el (comint-write-output): New function.
diff --git a/lisp/faces.el b/lisp/faces.el
index 89c3bf73f3c..f4bd0eee9ce 100644
--- a/lisp/faces.el
+++ b/lisp/faces.el
@@ -1308,22 +1308,27 @@ this won't have the expected effect."
1308 (let* ((bg-resource 1308 (let* ((bg-resource
1309 (and window-system 1309 (and window-system
1310 (x-get-resource ".backgroundMode" "BackgroundMode"))) 1310 (x-get-resource ".backgroundMode" "BackgroundMode")))
1311 (bg-color (frame-parameter frame 'background-color))
1311 (bg-mode 1312 (bg-mode
1312 (cond (frame-background-mode) 1313 (cond (frame-background-mode)
1313 ((null window-system)
1314 ;; No way to determine this automatically (?).
1315 'dark)
1316 (bg-resource 1314 (bg-resource
1317 (intern (downcase bg-resource))) 1315 (intern (downcase bg-resource)))
1318 ((< (apply '+ (x-color-values 1316 ((and (null window-system) (null bg-color))
1319 (frame-parameter frame 'background-color) 1317 ;; No way to determine this automatically (?).
1320 frame)) 1318 'dark)
1319 ;; Unspecified frame background color can only happen
1320 ;; on tty's.
1321 ((memq bg-color '("unspecified" "unspecified-bg"))
1322 'dark)
1323 ((eq bg-color "unspecified-fg") ; inverted colors
1324 'light)
1325 ((>= (apply '+ (x-color-values bg-color frame))
1321 ;; Just looking at the screen, colors whose 1326 ;; Just looking at the screen, colors whose
1322 ;; values add up to .6 of the white total 1327 ;; values add up to .6 of the white total
1323 ;; still look dark to me. 1328 ;; still look dark to me.
1324 (* (apply '+ (x-color-values "white" frame)) .6)) 1329 (* (apply '+ (x-color-values "white" frame)) .6))
1325 'dark) 1330 'light)
1326 (t 'light))) 1331 (t 'dark)))
1327 (display-type 1332 (display-type
1328 (cond ((null window-system) 1333 (cond ((null window-system)
1329 (if (tty-display-color-p frame) 'color 'mono)) 1334 (if (tty-display-color-p frame) 'color 'mono))