comparison lisp/term/rxvt.el @ 63861:63a4d25b8e9e

(rxvt-set-background-mode): Set default-frame-background-mode instead of frame-background-mode.
author Juri Linkov <juri@jurta.org>
date Wed, 29 Jun 2005 20:56:34 +0000
parents 695cf19ef79e
children a8fa7c632ee4 efa9e4606e7e bb71c6cf2009
comparison
equal deleted inserted replaced
63860:07f8d532fe8b 63861:63a4d25b8e9e
148 ;; intelligent way than the default guesswork in startup.el. 148 ;; intelligent way than the default guesswork in startup.el.
149 (defun rxvt-set-background-mode () 149 (defun rxvt-set-background-mode ()
150 "Set background mode as appropriate for the default rxvt colors." 150 "Set background mode as appropriate for the default rxvt colors."
151 (let ((fgbg (getenv "COLORFGBG")) 151 (let ((fgbg (getenv "COLORFGBG"))
152 bg rgb) 152 bg rgb)
153 (setq frame-background-mode 'light) ; default 153 (setq default-frame-background-mode 'light)
154 (when (and fgbg 154 (when (and fgbg
155 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) 155 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg))
156 (setq bg (string-to-number (substring fgbg (match-beginning 1)))) 156 (setq bg (string-to-number (substring fgbg (match-beginning 1))))
157 ;; The next line assumes that rxvt-standard-colors are ordered 157 ;; The next line assumes that rxvt-standard-colors are ordered
158 ;; by the color index in the ascending order! 158 ;; by the color index in the ascending order!
161 ;; computation below. 161 ;; computation below.
162 (if (< (apply '+ rgb) 162 (if (< (apply '+ rgb)
163 ;; The following line assumes that white is the 15th 163 ;; The following line assumes that white is the 15th
164 ;; color in rxvt-standard-colors. 164 ;; color in rxvt-standard-colors.
165 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6)) 165 (* (apply '+ (car (cddr (nth 15 rxvt-standard-colors)))) 0.6))
166 (setq frame-background-mode 'dark))) 166 (setq default-frame-background-mode 'dark)))
167 (frame-set-background-mode (selected-frame)))) 167 (frame-set-background-mode (selected-frame))))
168 168
169 ;; Do it! 169 ;; Do it!
170 (rxvt-register-default-colors) 170 (rxvt-register-default-colors)
171 (rxvt-set-background-mode) 171 (rxvt-set-background-mode)