Mercurial > emacs
comparison lisp/term/xterm.el @ 63860:07f8d532fe8b
(xterm-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:09 +0000 |
parents | eaa9acd9122c |
children | a8fa7c632ee4 efa9e4606e7e bb71c6cf2009 |
comparison
equal
deleted
inserted
replaced
63859:250dde129264 | 63860:07f8d532fe8b |
---|---|
364 ;; intelligent way than the default guesswork in startup.el. | 364 ;; intelligent way than the default guesswork in startup.el. |
365 (defun xterm-rxvt-set-background-mode () | 365 (defun xterm-rxvt-set-background-mode () |
366 "Set background mode as appropriate for the default rxvt colors." | 366 "Set background mode as appropriate for the default rxvt colors." |
367 (let ((fgbg (getenv "COLORFGBG")) | 367 (let ((fgbg (getenv "COLORFGBG")) |
368 bg rgb) | 368 bg rgb) |
369 (setq frame-background-mode 'light) ; default | 369 (setq default-frame-background-mode 'light) |
370 (when (and fgbg | 370 (when (and fgbg |
371 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) | 371 (string-match ".*;\\([0-9][0-9]?\\)\\'" fgbg)) |
372 (setq bg (string-to-number (substring fgbg (match-beginning 1)))) | 372 (setq bg (string-to-number (substring fgbg (match-beginning 1)))) |
373 ;; The next line assumes that xterm-standard-colors are ordered | 373 ;; The next line assumes that xterm-standard-colors are ordered |
374 ;; by the color index in the ascending order! | 374 ;; by the color index in the ascending order! |
377 ;; computation below. | 377 ;; computation below. |
378 (if (< (apply '+ rgb) | 378 (if (< (apply '+ rgb) |
379 ;; The following line assumes that white is the 15th | 379 ;; The following line assumes that white is the 15th |
380 ;; color in xterm-standard-colors. | 380 ;; color in xterm-standard-colors. |
381 (* (apply '+ (car (cddr (nth 15 xterm-standard-colors)))) 0.6)) | 381 (* (apply '+ (car (cddr (nth 15 xterm-standard-colors)))) 0.6)) |
382 (setq frame-background-mode 'dark))) | 382 (setq default-frame-background-mode 'dark))) |
383 (frame-set-background-mode (selected-frame)))) | 383 (frame-set-background-mode (selected-frame)))) |
384 | 384 |
385 ;; Do it! | 385 ;; Do it! |
386 (xterm-register-default-colors) | 386 (xterm-register-default-colors) |
387 ;; If this xterm is actually a disguised rxvt, be more intelligent about | 387 ;; If this xterm is actually a disguised rxvt, be more intelligent about |