Thanks for the interesting comments.
I've been making an effort to use Sam, in the interest of my own understanding. One of the biggest barriers I've hit is that there doesn't appear to be a good way to save complex edit commands for later. The man page suggests that it's possible to send commands to Sam from shell scripts.
External communication
Sam listens to the edit plumb port. If plumbing is not
active, on invocation sam creates a named pipe /srv/sam.user
which acts as an additional source of commands. Characters
written to the named pipe are treated as if they had been
typed in the command window.
B is a shell-level command that causes an instance of sam
running on the same terminal to load the named files. B uses
either plumbing or the named pipe, whichever service is
available. If plumbing is not enabled, the option allows a
line number to be specified for the initial position to dis-
play in the last named file (plumbing provides a more gen-
eral mechanism for this ability).
E is a shell-level command that can be used as $EDITOR in a
Unix environment. It runs B on file and then does not exit
until file is changed, which is taken as a signal that file
is done being edited.
I use Plan9Port on OpenBSD and typically use the plumber with Acme. I've changed "editor" to sam, and read the B and E scripts. As I understand it the plumbing approach doesn't allows sending arbitrary commands, so I've stopped the plumber. I'm unable to find the named pipe and looking at the sam source code it's not obvious to me how or whether such a pipe is created. Is this capability still present in Sam? Perhaps the plumber has completely subsumed this by now? Ultimately what I'd like to know is how you go about reusing common commands? Do you snarf and paste them? I was thinking that it would be useful to create scripts like "ap" which select the current paragraph (name inspired by Vim.) What's the typical workflow when using Sam? I don't deny that it's a great editor. Writing several thousand words in Sam yesterday was a pleasure.