all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Alp Aker <alp.tekin.aker@gmail.com>
To: help-gnu-emacs@gnu.org
Subject: Re: Distinguish inactive windows
Date: Fri, 24 Jun 2011 02:45:41 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110624T041310-302@post.gmane.org> (raw)
In-Reply-To: 20110623175236.0cfa498d@gauss

> 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.  





  reply	other threads:[~2011-06-24  2:45 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-24  0:52 Distinguish inactive windows Joe Riel
2011-06-24  2:45 ` Alp Aker [this message]
2011-06-25  4:47   ` Joe Riel
2011-06-25 16:00     ` Alp Aker
2011-06-24  2:51 ` Alp Aker
2011-06-24  5:38   ` Joe Riel

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

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

  git send-email \
    --in-reply-to=loom.20110624T041310-302@post.gmane.org \
    --to=alp.tekin.aker@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    /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.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.