[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: different background colours in different emacs windows.

From: Alan E. Davis
Subject: Re: different background colours in different emacs windows.
Date: Sun, 27 Mar 2011 15:56:21 +1000

This doesn't do what you want with the modeline.  In fact, it is not perfect, and I do not have the experience to fix it, but it was given to me in slightly different form by someone on this list or another emacs list. I would be pleased if someone else is able to make it work right.

There has been no serious problem with this.  The one botheration is that one has to call up two frames before subsequent frames start cycling through colors.  

First, the code, with apologies to Kai Grossjohann, who provided this as untested:

;; Cycling frame colors
;; Kai.Grossjohann
;; Newsgroups:, 5 Aug 2002
(defun my-next-bg-color (frame)
(let ((x (assq ‘background-color default-frame-alist)))
(setq default-frame-alist (delq x default-frame-alist))
(add-to-list ‘default-frame-alist
(cons ‘background-color
(cond ((equal (cdr x) “blue”)
((equal (cdr x) “black”)
“dark blue”)
((equal (cdr x) “dark blue”)
“saddle brown”)
((equal (cdr x) “saddle brown”)
((equal (cdr x) “blue1″)
“dark olive green”)
((equal (cdr x) “dark olive green”)
((equal (cdr x) “maroon”)
“blue violet”)
((equal (cdr x) “blue violet”)
((equal (cdr x) “MediumPurple”)
((equal (cdr x) “RoyalBlue3″)
((equal (cdr x) “DeepSkyBlue4″)
(t “black”))))))

(add-hook ‘after-make-frame-functions ‘my-next-bg-color)


I am not sure how important the following is, but I initialized the frame with a black background before loading the above code.  

(setq default-frame-alist
      '((width . 87)
    (height . 40)
    (foreground-color . "light green")
    (background-color . "black")
    (tool-bar-lines . 1)
    (menu-bar-lines . 1)
    (font . "Monospace-9")
    (cursor-color . "red")
    (mouse-color . "cyan")
    (right . 150)
    (top . 24)
    (user-position . t)

I tend to open WAY too many frames at once.  This helps to identify them. 

Alan Davis

reply via email to

[Prev in Thread] Current Thread [Next in Thread]