> I was looking for ways to make the focused window clearer. The best > way would probably a slightly lighter background. > > However, I couldn't find any hooks to easily do that. I was expecting > something along the lines of `window-leave-hook' and > `window-focus-hook' but I couldn't find anything similar. > > The best suggestion that the IRC people came up with is to use > `post-command-hook' and match `switch-buffer', What is `switch-buffer'? > but that sounds a bit > ugly. Is there a better way? I don't think that using `post-command-hook' is a priori bad in this case. Doing it on a `window-leave-hook' or `window-focus-hook' would mean you'd have to do that background setting whenever you leave a window or change the focus, which can happen a couple of times during one and the same command. Obviously `post-command-hook' will fail when the focus changes asynchronously but I think such cases should be rare. I attach an old version which can run into a problem I forgot about. There's a better way to provide whole-window overlays for Emacs 24.1 but I didn't implement them yet. If you use Emacs 24, I can look into this. martin