Re: [9fans] Command to set samterm label

2021-07-19 Thread umbraticus
Sorry, didn't mean to come off as insisting you had to do it
my way (I am guilty of hacking all kinds of things into my
own samterm); just wanted to point out there are other ways
besides adding a new command to sam.

> The next step is add an option (or better an environment variable)
> to use the rio snarf buffer directly.

There is a patch for this floating around somewhere: perhaps
whoever wrote it can chime in.

Below is a quick illustration of the other thought I had,
having label reflect the most recently topped buffer, in
case you are or anyone else is interested.

umbraticus

diff -u /sys/src/cmd/samterm/main.c ./main.c
--- /sys/src/cmd/samterm/main.c Thu Apr 30 10:24:09 2020
+++ ./main.cMon Jul 19 23:36:12 2021
@@ -150,6 +150,7 @@
 current(Flayer *nw)
 {
Text *t;
+   int fd;
 
if(which)
flborder(which, 0);
@@ -160,8 +161,13 @@
buttons(Up);
t = (Text *)nw->user1;
t->front = nw->l[0];
-   if(t != )
+   if(t != ){
work = nw;
+   if((fd = open("/dev/label", OWRITE)) >= 0){
+   fprint(fd, "sam %s", 
(char*)name[whichmenu(t->tag)] + 1);
+   close(fd);
+   }
+   }
}
which = nw;
 }
@@ -170,11 +176,15 @@
 closeup(Flayer *l)
 {
Text *t=(Text *)l->user1;
-   int m;
+   int m, fd;
 
m = whichmenu(t->tag);
if(m < 0)
return;
+   if((fd = open("/dev/label", OWRITE)) >= 0){
+   write(fd, "sam", 4);
+   close(fd);
+   }
flclose(l);
if(l == which){
which = 0;

--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/Tf1e211daf823c0e0-M2dfbf5d65c86fcf89c315484
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription


Re: Posix implementation of Plan 9 cpu(1) (Was: [9fans] Command to set samterm label)

2021-07-19 Thread Steve Simon


my cpu for windows was always incomplete, but good enough that i never finished 
it properly.

for posix i just use sftpfs or now cinap’s sshftp to import the filesystem from 
the posix box as /n/fred and run sam locally (i am a samista rather than an 
acmeite)

i cannot run stuff remotely but i can edit in a nice environment. is this not 
enough?

-Steve



--
9fans: 9fans
Permalink: 
https://9fans.topicbox.com/groups/9fans/T09fcdec9c87bfde4-M1d424bd90cc86bc378222ce4
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription