From f704965a457bd9766af9b929dbf30941cdfd9e52 Mon Sep 17 00:00:00 2001 From: moody Date: Sat, 27 Feb 2021 19:35:06 +0100 Subject: [PATCH] B, Bfn: fix invocation with multiple files, improve manual page --- rc/bin/B | 16 ++++++++-------- rc/bin/Bfn | 2 +- sys/man/1/sam | 20 +++++++------------- 3 files changed, 16 insertions(+), 22 deletions(-) diff --git a/rc/bin/B b/rc/bin/B index a724ccd4c..56cccaa38 100755 --- a/rc/bin/B +++ b/rc/bin/B @@ -10,6 +10,14 @@ if(~ $#* 0){ exit usage } +if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){ + for(i) + plumb -s B -d edit $i + exit +} + +# using sam srv file + for(i) switch($i){ case /* @@ -18,14 +26,6 @@ for(i) files = ( $files `{cleanname `{pwd}^/$i} ) } - -if(test -f /mnt/plumb/edit || test -f /mnt/term/mnt/plumb/edit){ - plumb -s B -d edit $files - exit -} - -# using sam srv file - if(test -f /mnt/term/srv/sam.$user) dest = /mnt/term/srv/sam.$user if not if(test -f /srv/sam.$user) dest = /srv/sam.$user if not { diff --git a/rc/bin/Bfn b/rc/bin/Bfn index 907a414ee..d9b77ac9b 100755 --- a/rc/bin/Bfn +++ b/rc/bin/Bfn @@ -14,5 +14,5 @@ switch($#res){ case 0 echo $1: not found >[2=1] case 1 - plumb $res + B $res } diff --git a/sys/man/1/sam b/sys/man/1/sam index 5c1455b22..d2d1a8f19 100644 --- a/sys/man/1/sam +++ b/sys/man/1/sam @@ -17,9 +17,6 @@ sam, B, sam.save, samterm \- screen editor with structural regular expressions .B sam.save .PP .B B -[ -.BI -nnnn -] .I file ... .SH DESCRIPTION .I Sam @@ -866,16 +863,13 @@ 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. .PP .I B -is a shell-level command that causes an instance of -.I sam -running on the same terminal to load the named -.IR files . -.I 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 display in the last named file -(plumbing provides a more general mechanism for this ability). +is a shell command that sends the named +.IR files +to the edit port of the plumber. +If plumbing is not available, +it attempts to load +.IR files +through the named pipe. .SS Abnormal termination If .I sam