Path: utzoo!attcan!uunet!cs.utexas.edu!usc!zaphod.mps.ohio-state.edu!uakari.primate.wisc.edu!uflorida!bikini!thoth From: thoth@shark.cis.ufl.edu (Gilligan) Newsgroups: comp.emacs Subject: "Suspending a program running in an X window is silly" Message-ID: Date: 29 Jun 90 20:26:38 GMT Sender: news@uflorida.cis.ufl.EDU Distribution: comp Organization: Cyborgs for Responsible CFC Use Lines: 81 Dudes, How about binding ^Z to something useful when running under X-windows, like x-iconify? You say you don't have the function x-iconify? Try this! /* ICCCM compliant, see p 24-26, sec 4.1.4 */ It also includes x-deiconify, a function that is hard to invoke while the window is iconified, but we hope to hack it into the emacs-client and -server stuff. *** x11fns.c.orig Tue Oct 10 04:04:50 1989 --- x11fns.c Thu Jun 28 19:31:12 1990 *************** *** 828,833 **** --- 828,879 ---- return (Qnil); } + DEFUN ("x-iconify", Fx_iconify, Sx_iconify, 0, 0, "", + "this iconifies the emacs window.") + () + { + XClientMessageEvent xev; + + BLOCK_INPUT_DECLARE (); + check_xterm(); + + xev.type = ClientMessage; + xev.send_event = True; + xev.window = XXwindow; + xev.format = 32; + xev.data.l[0] = IconicState; + + BLOCK_INPUT (); + + xev.message_type = XInternAtom(XXdisplay,"WM_CHANGE_STATE",False); + XSendEvent(XXdisplay, DefaultRootWindow(XXdisplay), False, + SubstructureRedirectMask|SubstructureNotifyMask, &xev); + + UNBLOCK_INPUT (); + + XFlush(XXdisplay); + + return Qt; + } + + + DEFUN ("x-deiconify", Fx_deiconify, Sx_deiconify, 0, 0, "", + "this de-iconifies the emacs window.") + () + { + BLOCK_INPUT_DECLARE (); + check_xterm(); + BLOCK_INPUT (); + + XMapWindow(XXdisplay,XXwindow); + + UNBLOCK_INPUT (); + + XFlush(XXdisplay); + + return Qt; + } + XRedrawDisplay () { Fredraw_display (); *************** *** 892,897 **** --- 938,945 ---- defsubr (&Sx_rebind_keys); #endif notdef defsubr (&Sx_debug); + defsubr (&Sx_iconify); + defsubr (&Sx_deiconify); } #endif /* HAVE_X_WINDOWS */ -- ( My name's not really Gilligan, It's Robert Forsman, without an `e' )