code: plan9front

Download patch

ref: f704965a457bd9766af9b929dbf30941cdfd9e52
parent: 51f4f46ae05251967a6152514d9a935e960d022b
author: moody <moody@posixcafe.org>
date: Sat Feb 27 14:35:06 EST 2021

B, Bfn: fix invocation with multiple files, improve manual page

--- a/rc/bin/B
+++ b/rc/bin/B
@@ -10,6 +10,14 @@
 	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 /*
@@ -17,14 +25,6 @@
 	case *
 		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
--- a/rc/bin/Bfn
+++ b/rc/bin/Bfn
@@ -14,5 +14,5 @@
 case 0
 	echo $1: not found >[2=1]
 case 1
-	plumb $res
+	B $res
 }
--- a/sys/man/1/sam
+++ b/sys/man/1/sam
@@ -17,9 +17,6 @@
 .B sam.save
 .PP
 .B B
-[
-.BI -nnnn
-]
 .I file ...
 .SH DESCRIPTION
 .I Sam
@@ -866,16 +863,13 @@
 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