code: purgatorio

Download patch

ref: a411870ee4640241e3c494367d922847da84f972
parent: a5cb451b299b03f44154fac5780b6a57ca130ce0
author: henesy <henesy.dev@gmail.com>
date: Fri Jul 9 12:29:25 EDT 2021

acme, plumb: correct plumbing to acme with line numbers (thanks joe7)

--- a/appl/acme/look.b
+++ b/appl/acme/look.b
@@ -114,7 +114,7 @@
 		r = nil;
 		return;
 	}
-	if(0 && dat->plumbed){	# don't do yet : 2 acmes running => only 1 receives msg
+	if(1 && dat->plumbed){	# don't do yet : 2 acmes running => only 1 receives msg
 		m := ref Msg;
 		m.src = "acme";
 		m.dst = nil;
--- a/appl/cmd/plumber.b
+++ b/appl/cmd/plumber.b
@@ -521,7 +521,14 @@
 	"dst" =>	text = msg.dst;
 	"dir" =>	text = msg.dir;
 	"kind" =>	text = msg.kind;
-	"attr" =>	text = msg.attr;
+	"attr" =>	
+		# this is a hack, 9front provides an add verb
+		# better yet, replace the plumbing rules with a sh script
+		al := plumbmsg->string2attrs(text);
+		for(l := al; l!= nil; l = tl l){
+			in.attrs = hd l :: in.attrs;
+		}
+		msg.attr = plumbmsg->attrs2string(in.attrs);
 	"data" =>	text = in.text;
 	* =>
 		sys->fprint(stderr, "plumb: don't recognize pattern field %s\n", p.field);
--- a/usr/inferno/lib/plumbing
+++ b/usr/inferno/lib/plumbing
@@ -41,8 +41,10 @@
 
 # existing files, possibly tagged by line number, go to wm/brutus
 kind is text
-data matches '([.a-zA-Z0-9_/\-]+[a-zA-Z0-9_/\-])(:[0-9]+)?'
+data matches '([.a-zA-Z0-9_/\-]+[a-zA-Z0-9_/\-])(:([0-9]+))?'
 data isfile     $1
+data set $1
+attr set addr=$3
 plumb to edit
 plumb start /dis/wm/brutus.dis $file$2