views:

47

answers:

2

Under Win32, each emacs frame shows up as a different window when Alt-tabbing, which makes sense. However, when I select my main editing window, I'd also like my speedbar frame to auto-raise along with it.

Writing a function to raise all frames (or even all currently NOT visible frames) is relatively trivial, but I can't figure out hook to use, or indeed if there's even a hook that's possible to use at all.

So, if I click or alt-tab to any of my emacs frames, a hook should be run to call my function that raises ALL frames. Any help?

+1  A: 

It doesn't seem that GNU emacs has any such functionality.

Xemacs has select-frame-hook and map-frame-hook. There is also the variable auto-raise-frame, but, not in GNU emacs.

See http://www.xemacs.org/Documentation/beta/html/lispref_40.html#SEC526 for some ideas if you feel like improving emacs.

Burton Samograd
A: 

The closest I can find in GNU Emacs is the switch-frame event, but it's only generated when a different Emacs frame is focused, not when you switch to a non-Emacs window and then back to the same frame.

This is the sort of things that a good enough window manager should do, with a bit of cooperation from Emacs (for example using window titles to figure out what the speedbar frame is).

Under Windows, you should be able to use AutoHotKey's WinWaitActive command.

Gilles