From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Glenn Morris Newsgroups: gmane.emacs.help Subject: CVS Emacs - changing colour of mode-line image in active window Date: Sun, 30 Mar 2003 22:38:07 +0100 Organization: None Sender: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <0uvfy05ydc.fsf@xpc21.ast.cam.ac.uk> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: main.gmane.org 1049060548 26296 80.91.224.249 (30 Mar 2003 21:42:28 GMT) X-Complaints-To: usenet@main.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2003 21:42:28 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 30 23:42:27 2003 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by main.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 18zkZP-0006py-00 for ; Sun, 30 Mar 2003 23:42:27 +0200 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.10.13) id 18zkXs-0003Ig-05 for gnu-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2003 16:40:52 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news-spur1.maxwell.syr.edu!news.maxwell.syr.edu!newsfeed.icl.net!newsfeed.fjserv.net!lnewspeer00.lnd.ops.eu.uu.net!emea.uu.net!server1.netnews.ja.net!pegasus.csx.cam.ac.uk!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 53 Original-NNTP-Posting-Host: xpc21.ast.cam.ac.uk X-Attribution: GM Mail-Copies-To: never User-Agent: Gnus (www.gnus.org), GNU Emacs (www.gnu.org/directory/emacs.html) Cancel-Lock: sha1:t3uGS8J1f8S9yqlUGMjEwgR8L2E= Original-Xref: shelby.stanford.edu gnu.emacs.help:111496 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1b5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Help: List-Post: List-Subscribe: , List-Archive: List-Unsubscribe: , Errors-To: help-gnu-emacs-bounces+gnu-help-gnu-emacs=m.gmane.org@gnu.org Xref: main.gmane.org gmane.emacs.help:7997 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:7997 This is a question relating to the CVS version of Emacs, 21.3.50. I hope nobody minds me asking here, but it's not the kind of thing the devel list should be bothered with, IMO. With mode-line-in-non-selected-windows non-nil, the mode-line has a different colour in non-active windows. If I do (display-time-mode 1) and (setq display-time-string-forms '("foo")) then the resulting mode-line string "foo" also changes colour to match the rest of the mode-line according to whether the window is active or not. I would like to achieve the same effect, but with an image. Specifically, I want to put an XPM image in the mode-line, with a transparent background (so that part of the image always has the "correct" colour"), and a foreground colour that adjusts to match that of the mode-line. In detail, I'm using this kind of thing: (setq display-time-string-forms `((propertize "*" 'display '(image :type xpm :file "/home/gmorris/.emacs.d/images/clock.xpm" :ascent center :color-symbols ,(list (cons "FG" (face-attribute 'mode-line :foreground)))) 'help-echo (format-time-string "%H:%M, %A %B %e %Y")))) to get a pop-up clock in the mode-line. clock.xpm has a transparent background, and a foreground colour with symbolic name "FG". What I want is to translate "FG" to the mode-line foreground in the active window, and to mode-line-inactive foreground in other windows. Is this possible within the confines of display-time-string-forms? My current impression is that it is not, in which case is there any other way to achieve the desired result? This is not at all important, because it won't kill me to live with a clock that is always blue (say), I've just become curious about the answer. :) Thanks in advance!