sam-fans - fans of the sam editor
 help / color / mirror / Atom feed
From: (Steve_Kilbane)
Subject: 9term/9wm hacks
Date: Tue, 7 Feb 1995 07:59:20 -0500
Message-ID: <> (raw)

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 2275 bytes --]

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 <window label><space><windowid>.
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.


             reply	other threads:[~1995-02-07 13:14 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1995-02-07 12:59 Steve_Kilbane [this message]
1995-04-28 20:41 hc05
1995-05-01  8:18 Steve_Kilbane

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

sam-fans - fans of the sam editor

This inbox may be cloned and mirrored by anyone:

	git clone --mirror

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 sam-fans sam-fans/ \
	public-inbox-index sam-fans

Example config snippet for mirrors.
Newsgroup available over NNTP:

AGPL code for this site: git clone