From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Alan Newsgroups: gmane.emacs.help Subject: Rotating color themes? Date: Sun, 6 Apr 2008 18:56:50 -0700 (PDT) Organization: http://groups.google.com Message-ID: <0583f20a-7d09-4288-aebe-51d2b40b7bc6@b5g2000pri.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Trace: ger.gmane.org 1207536052 28610 80.91.229.12 (7 Apr 2008 02:40:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 7 Apr 2008 02:40:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Mon Apr 07 04:41:24 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JihIL-0000Li-9Z for geh-help-gnu-emacs@m.gmane.org; Mon, 07 Apr 2008 04:41:17 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JihHh-0000eU-Un for geh-help-gnu-emacs@m.gmane.org; Sun, 06 Apr 2008 22:40:38 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!b5g2000pri.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 86 Original-NNTP-Posting-Host: 202.88.84.208 Original-X-Trace: posting.google.com 1207533410 15027 127.0.0.1 (7 Apr 2008 01:56:50 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Mon, 7 Apr 2008 01:56:50 +0000 (UTC) Complaints-To: groups-abuse@google.com Injection-Info: b5g2000pri.googlegroups.com; posting-host=202.88.84.208; posting-account=wcF3XAoAAADpxbRZm2Z27inMlnZjMIWc User-Agent: G2/1.0 X-HTTP-UserAgent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9b5) Gecko/2008040514 Firefox/3.0b5,gzip(gfe),gzip(gfe) Original-Xref: shelby.stanford.edu gnu.emacs.help:157743 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:53116 Archived-At: Some years back (Aug. 5, 2002), I received a response to a query about changing background color for new frames. Kai Grossjohann sent a snippet that I have been using, possibly with little tweaks, ever since. It is helpful to have different frames easily identifiable. I have recently discovered "color-themes". This approach solves the problem of faces that are not clearly visible on a given background. I am now asking whether anyone can suggest how to code a similar routine to cycle the color-themes in new frames. Here is the code that works pretty well (with the forewarning that I don't understand 1/2 of how it works): -------beginning of code----------- (setq initial-frame-alist '((width . 80) (height . 43) (foreground-color . "green1") (background-color . "black") (tool-bar-lines . 1) (menu-bar-lines . 1) (cursor-color . "yellow") (mouse-color . "orange") (left . 200) (top . 25) (user-position . t) ) ) ;;;;;; Default frame parameter values, for all frames (setq default-frame-alist '((width . 80) (height . 43) (foreground-color . "yellow") (background-color . "DeepSkyBlue4") (tool-bar-lines . 1) (menu-bar-lines . 1) (cursor-color . "red") (mouse-color . "cyan") (left . 250) (top . 34) (user-position . t) ) ) ;;;;;; Cycling frame colors ;;;;;; Kai.Grossjohann@CS.Uni-Dortmund.DE (Kai Gro=DFjohann) ;;;;;; Newsgroups: gnu.emacs.help, 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) "DeepSkyBlue4") "dark olive green") ((equal (cdr x) "dark olive green") "black") ((equal (cdr x) "black") "dark blue") ((equal (cdr x) "dark blue") "saddle brown") ((equal (cdr x) "saddle brown") "blue1") ((equal (cdr x) "blue1") "maroon") ((equal (cdr x) "maroon") "blue violet") ((equal (cdr x) "blue violet") "MediumPurple") ((equal (cdr x) "MediumPurple") "RoyalBlue3") ((equal (cdr x) "RoyalBlue3") "cyan4") ((equal (cdr x) "cyan4") "DeepSkyBlue4") (t "black")))))) (add-hook 'after-make-frame-functions 'my-next-bg-color) -------end of code--------- I might mention that I never have gotten this to work seamlessly: it does, however, work sufficiently well for my simple purposes. Thank you, Alan Davis