In a different thread, Stefan suggested: to catch the "press the delete button in the WM", ...change the binding for the delete-frame event in special-event-map (defaults to handle-delete-frame).
Cool. I didn't know about `special-event-map'. I tried this: (defun foo-on-event (event) (interactive "e") (let ((frame (posn-window (event-start event)))) (foobar frame))) (define-key special-event-map [iconify-frame] 'foo-on-event) This works, in the sense that `foo-on-event' is executed whenever you click the window-manager `iconify' (minimize) button. However, `foo-on-event' is executed after the frame is in fact iconified (by the window manager). I can deiconify the frame in the `foo-on-event' code, but the result is that when you click the minimize button the frame is first iconified, then deiconified, then the rest of the `foo-on-event' behavior (foobar) occurs. Suggestions? Any way to intercept (i.e. prevent) the window-manager's minimization of the frame? FYI - I'm using Windows XP, in case it's relevant. _______________________________________________ Help-gnu-emacs mailing list Help-gnu-emacs@gnu.org http://lists.gnu.org/mailman/listinfo/help-gnu-emacs