[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Distinguish inactive windows
From: |
Alp Aker |
Subject: |
Re: Distinguish inactive windows |
Date: |
Fri, 24 Jun 2011 02:45:41 +0000 (UTC) |
User-agent: |
Loom/3.14 (http://gmane.org/) |
> How can the selected window be visually distinguished from the other
> windows in its frame? I'd like to, say, set mode-line background of the
> selected window to a particular color.
Is specifically a unique *window* whose mode-line you want to distinguish, or
would it suffice to change the mode-line for all windows displaying a
particular *buffer*? If the former, you're out of luck; there's no way (that
I'm aware of) to do it. If the latter, you can use the variable
`mode-line-format', which is buffer-local and which allows you to specify a
face. E.g.,
(setq mode-line-format `(:propertize ,mode-line-format face default))
will highlight (part of) the mode-line. Unfortunately, to get the full
effect you're probably looking for, you'll have to dissect the mode-line
format construct and put the face properties you want on elements buried
several levels deep. See the info node "(elisp) Mode Line Format" for the
details on how it works. (Be forewarned that the API is rather
cumbersome.)
Another way to get a buffer-specific (rather that window-specific) effect is
to use `header-line-format', which, when given a non-nil value, will put a
line at the top of every window displaying the buffer, and whose appearance
is controlled by the face `header-line'. (The format construct rules for
header lines are the same as for mode lines. Two advantages header lines
might have for your purposes is that they're displayed the same whether the
window is selected or not, and they're only used by a few modes, so you can,
in most contexts, specify a simple header line you construct from scratch,
rather than, as you have to do with mode lines, modifying an existing--and
non-trivial--construct.)
If what you need really is to highlight a specific window, you might consider
using the fringes or marginal display areas to indicate the window of
interest. Those can be controlled on a per-window basis.