unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Glenn Morris <gmorris+news@ast.cam.ac.uk>
Subject: CVS Emacs - changing colour of mode-line image in active window
Date: Sun, 30 Mar 2003 22:38:07 +0100	[thread overview]
Message-ID: <0uvfy05ydc.fsf@xpc21.ast.cam.ac.uk> (raw)


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!

             reply	other threads:[~2003-03-30 21:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-03-30 21:38 Glenn Morris [this message]
2003-03-31 16:20 ` CVS Emacs - changing colour of mode-line image in active window Stefan Monnier
2003-03-31 17:23   ` Glenn Morris
2003-03-31 18:16     ` Stefan Monnier
2003-03-31 18:48       ` Glenn Morris

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=0uvfy05ydc.fsf@xpc21.ast.cam.ac.uk \
    --to=gmorris+news@ast.cam.ac.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).