From mboxrd@z Thu Jan 1 00:00:00 1970 MIME-Version: 1.0 References: <20160519215144.GG22691@wopr> <461FFF1E-B3DA-43E1-BC4C-1672E4C628A6@orthanc.ca> <1463707391.4126990.613229361.7308302E@webmail.messagingengine.com> <48ECC010-AAE2-4535-B5BF-42D46EC1CD90@orthanc.ca> <1463709745.4136967.613259513.7C5C1955@webmail.messagingengine.com> <5B039617-11E1-4D3E-AE61-E29C067220AD@orthanc.ca> <29966939-1C45-4025-BB7A-8E49BD78C5E5@quintile.net> In-Reply-To: <29966939-1C45-4025-BB7A-8E49BD78C5E5@quintile.net> From: Mark Lee Smith Date: Sat, 21 May 2016 21:52:53 +0000 Message-ID: To: Fans of the OS Plan 9 from Bell Labs <9fans@9fans.net> Content-Type: multipart/alternative; boundary=001a114b295c428c830533613bfa Subject: Re: [9fans] problem with acme on 9front Topicbox-Message-UUID: 92ed6894-ead9-11e9-9d60-3106f5b1d025 --001a114b295c428c830533613bfa Content-Type: text/plain; charset=UTF-8 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. Maybe I'm completely off base here? All the best, Mark On Fri, 20 May 2016 at 22:05 Steve Simon wrote: > > I started with Sam a sit ran on all the different unixes I used an vi an > emacs just felt clunky. > > I never got into help and when acme replaced that I just never made the > transition. > > I love Sam, though it is because I know it so well. > > btw, anyone written scripts to allow the plan9 wiki to be edited from Sam? > maybe the wiki is outmoded these days? > > -Steve > > > > --001a114b295c428c830533613bfa Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable
Thanks for the interesting comments.

I&= #39;ve been making an effort to use Sam, in the interest of my own understa= nding. One of the biggest barriers I've hit is that there doesn't a= ppear to be a good way to save complex edit commands for later. The man pag= e suggests that it's possible to send commands to Sam from shell script= s.

=C2=A0 =C2=A0 =C2=A0 =C2=A0 External commu= nication
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Sam listens to the ed= it plumb port.=C2=A0 If plumbing is not
=C2=A0 =C2=A0 =C2=A0 =C2= =A0 =C2=A0 active, on invocation sam creates a named pipe /srv/sam.user
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 which acts as an additional sourc= e of commands.=C2=A0 Characters
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 written to the named pipe are treated as if they had been
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 typed in the command window.

=
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 B is a shell-level command th= at causes an instance of sam
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 r= unning on the same terminal to load the named files. B uses
=C2= =A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 either plumbing or the named pipe, whicheve= r service is
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 available.=C2=A0 = If plumbing is not enabled, the option allows a
=C2=A0 =C2=A0 =C2= =A0 =C2=A0 =C2=A0 line number to be specified for the initial position to d= is-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 play in the last named fil= e (plumbing provides a more gen-
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2= =A0 eral mechanism for this ability).

=C2=A0 =C2= =A0 =C2=A0 =C2=A0 =C2=A0 E is a shell-level command that can be used as $ED= ITOR in a
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 Unix environment.=C2= =A0 It runs B on file and then does not exit
=C2=A0 =C2=A0 =C2=A0= =C2=A0 =C2=A0 until file is changed, which is taken as a signal that file<= /div>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 is done being edited.

I use Plan9Port on OpenBSD and typically use the plu= mber 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 obv= ious 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? Ul= timately what I'd like to know is how you go about reusing common comma= nds? Do you snarf and paste them? I was thinking that it would be useful to= create scripts like "ap" which select the current paragraph (nam= e inspired by Vim.) What's the typical workflow when using Sam? I don&#= 39;t deny that it's a great editor. Writing several thousand words in S= am yesterday was a pleasure.

Maybe I'm complet= ely off base here?

All the best,

Mark





On Fri, 20 May 201= 6 at 22:05 Steve Simon <steve@quintile.net> wrote:

I started with Sam a sit ran on all the different unixes I used an vi an em= acs just felt clunky.

I never got into help and when acme replaced that I just never made the tra= nsition.

I love Sam, though it is because I know it so well.

btw, anyone written scripts to allow the plan9 wiki to be edited from Sam? = maybe the wiki is outmoded these days?

-Steve



--001a114b295c428c830533613bfa--