Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!swrinde!zaphod.mps.ohio-state.edu!mips!apple!sun-barr!newstop!sun!kimba!hvr From: hvr@kimba.Sun.COM (Heather Rose) Newsgroups: comp.windows.x Subject: Re: Using vi as the xmh editor Message-ID: <131192@sun.Eng.Sun.COM> Date: 4 Feb 90 00:19:28 GMT References: <9536@medusa.cs.purdue.edu> <9002021625.AA22453@expo.lcs.mit.edu> <47054@lll-winken.LLNL.GOV> Sender: news@sun.Eng.Sun.COM Reply-To: hvr@sun.UUCP (Heather Rose) Organization: Sun Microsystems, Mountain View Lines: 68 In article <47054@lll-winken.LLNL.GOV> casey@gauss.llnl.gov (Casey Leedom) writes: > > I also have the same request, but for use with a different editor. It >should be obvious that trying to put multiple editor styles into the >Text widget is just plain dumb. > > A much, much, much better way of handling all of this is to have >someone approach xterm from behind in a dark alley with a very large >knife and little conscience. With a few deft moves, xterm's VT100 and >TEK modes should be removed. Bring in a janitor to clean up the blood >and instantiate the newly freed VT100 and TEK code as widgets for use by >a recovering xterm and any other clients that need either or both >terminal emulators. Instead of doing so much work to change the toolkit, if one were to port xmh to the XView toolkit, the reader window could be a TTYSW and you can set the child of the TTYSW to be "my favorite editor" defined by a default, an environment variable, a command line argument, and whatever else method you want to supply. The code would look something like this: #include #include main(argc, argv) char *argv[]; { Tty view_window; Frame frame; char *my_argv; xv_init(); frame = (Frame)xv_create(NULL, FRAME, NULL); my_argv = (char *)get_my_favorite_editor(&argc, argv); view_window = (Tty)xv_create(frame, TTY, TTY_ARGV, my_argv, NULL); window_fit(frame); xv_main_loop(frame); } change_message_in_view_window(...) { ttysw_input(view_window, "editor commands to switch to a new file to edit"); or change_contents("of current file that is being edited") and perhaps refreash_window(); } With this scheme it would also be easy to add the ability to bring up a new frame for the next mesage to view. So, in XView, you might put a "pin" on the view window's frame. If the user pushes the pin in, then the application would know that it should bring up the next message to view in a new window. When the user takes out the pin, then the view window would be dismissed. The same option could be supplied on a menu as well in an entry such as "view next message in new window". If no editor were specified or specified incorrectly, the default view window could be textsw instead of a ttysw. I know of at least two people porting mh to XView, so perhaps they're reading this? ;-) Heather