From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from cegelecproj.co.uk ([159.245.72.6]) by hawkwind.utcs.utoronto.ca with SMTP id <24011>; Tue, 7 Feb 1995 08:14:44 -0500 Received: from vampire.cegelecproj.co.uk (cerberus.cegelecproj.co.uk) by cegelecproj.co.uk (4.1/SMI-4.1) id AA01143; Tue, 7 Feb 95 13:15:24 GMT Received: from spirit.cegelecproj.co.uk (spirit.limbo.cegelecproj.co.uk) by vampire.cegelecproj.co.uk (5.0/SMI-SVR4) id AA27750; Tue, 7 Feb 1995 13:18:09 +0000 Received: by spirit.cegelecproj.co.uk (5.0/SMI-SVR4) id AA06143; Tue, 7 Feb 1995 12:59:20 +0000 Date: Tue, 7 Feb 1995 07:59:20 -0500 From: Steve_Kilbane@cegelecproj.co.uk (Steve_Kilbane) Message-Id: <9502071259.AA06143@spirit.cegelecproj.co.uk> X-Planation: X-Faces images can be viewed with the XFaces program To: sam-fans@hawkwind.utcs.toronto.edu Subject: 9term/9wm hacks X-Face: Iqsa(US9p?)Y^W+6Ff[Z]rM"uFE) lFDjag1e]\/#2 I've been playing with some small hacks to 9term and 9wm which I thought I'd mention to the list, since they might be of interest. Basically, I was wondering how some of the characteristics of 8½ and Help could be implemented using the existing arrangement. Basically I was after some level of programmability without having to change the tools much (or do much work:-)). In 9term, I've implemented command inputs via a pipe, similar to the command pipe sam uses. Each 9term creates a named pipe with the name /tmp/.9terms.$USER.$DISPLAY/$WINDOWID. Characters read from this pipe get sent to the shell, and also appear on the screen. The directory that the pipes are created in is mode 700, as a nod towards security, but how safe this is, I don't know. In 9wm, each time a window is made current the file /tmp/.9wm-windows is re-written, containing a line for each window. Each line contains . The lines are written in the same order as the window focus list, so the current window is the first line, the previous current window is the second line, and so on. >From here on in, it's just script writing. The most common script determines which 9term was the most recently used, and sends its arguments to that 9term's pipe. Another script is similar, but uses xv_get_sel to determine text that was last snarfed, and uses that in the command. Scripts are normally run from 9menu popped up from the main 9menu. One contains the commands used while producing a document with latex, another has commands often used while building an instance of the current program I'm working on, and a third pops up the last 15 commands from $history, for re-execution. Although I haven't done this, 9menus could be created which send commonly-used commands to the current instance of sam (personally, I don't have many sam commands I use a lot). It's not a perfect system. Security is bound to be a problem, the 9wm file should have a more unique name, and if you send text to a 9term pipe it doesn't currently set dot first, so the text appears in the wrong place. The command still works, though. Finally, the hacks aren't to the most recent version of 9term (they're to 1.3.2, and I know that matty's up to at least 1.5). Comments are welcome. steve