>>> I need to know if emacs has the global input focus, that's to say, >>> if emacs' window is the selected one in the wm. >> >> I don't think you can do that from elisp as of Emacs-22. >> Patches are welcome to add the functionality, of course,
> A function like `window-focus-p', that will check with > XGetInputFocus(3x)/GetForegroundWindow(w32) if the current window > has the input focus ? BTW, you might want to use other info than focus. E.g. you might just want to check whether one of Emacs's frames is currently visible (rather than obscured by another window). Of course it depends on the actual application you have in mind. In any case, whatever you use will be fragile, since you might lose focus between the moment you ask whether you have focus and the moment you act on it. > So I'll have a try. BTW, is there guidelines for emacs patches, > some must-know coding style or whatever like that somewhere ? Try to mimick the rest of the code ;-) Stefan _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs