9front - general discussion about 9front
 help / color / mirror / Atom feed
* Re: [9front] rio exit menu
@ 2018-12-09 21:38 kvik
  2018-12-09 21:40 ` Steve Simon
  2018-12-11 21:24 ` Ethan Gardener
  0 siblings, 2 replies; 17+ messages in thread
From: kvik @ 2018-12-09 21:38 UTC (permalink / raw)
  To: 9front

[-- Attachment #1: Type: text/plain, Size: 92 bytes --]

I find it useful to have an "Exit" menu entry, sometimes.
An opt-in option seems reasonable.

[-- Attachment #2: Type: text/plain, Size: 782 bytes --]

diff --git a/sys/src/cmd/rio/rio.c b/sys/src/cmd/rio/rio.c
--- a/sys/src/cmd/rio/rio.c
+++ b/sys/src/cmd/rio/rio.c
@@ -120,21 +120,22 @@ void
 threadmain(int argc, char *argv[])
 {
 	char *initstr, *kbdin, *s;
+	int exitdoor;
 	char buf[256];
 	Image *i;
 	Rectangle r;
 
-	if(strstr(argv[0], ".out") == nil){
-		menu3str[Exit] = nil;
-		Hidden--;
-	}
 	initstr = nil;
 	kbdin = nil;
 	maxtab = 0;
+	exitdoor = 0;
 	ARGBEGIN{
 	case 'b':
 		reverse = ~0xFF;
 		break;
+	case 'e':
+		exitdoor = TRUE;
+		break;
 	case 'f':
 		fontname = EARGF(usage());
 		break;
@@ -155,6 +156,11 @@ threadmain(int argc, char *argv[])
 	default:
 		usage();
 	}ARGEND
+	
+	if(exitdoor == 0){
+		menu3str[Exit] = nil;
+		Hidden--;
+	}
 
 	if(getwd(buf, sizeof buf) == nil)
 		startdir = estrdup(".");

^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:38 [9front] rio exit menu kvik
@ 2018-12-09 21:40 ` Steve Simon
  2018-12-09 21:55   ` Kurt H Maier
  2018-12-09 22:28   ` Stanley Lieber
  2018-12-11 21:24 ` Ethan Gardener
  1 sibling, 2 replies; 17+ messages in thread
From: Steve Simon @ 2018-12-09 21:40 UTC (permalink / raw)
  To: 9front

The one I miss was the Look option from 9term,

that was very handy on occasion, to find a previous
command that was lost in voluminous output.

-Steve


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:40 ` Steve Simon
@ 2018-12-09 21:55   ` Kurt H Maier
  2018-12-09 22:04     ` Steve Simon
  2018-12-09 22:28   ` Stanley Lieber
  1 sibling, 1 reply; 17+ messages in thread
From: Kurt H Maier @ 2018-12-09 21:55 UTC (permalink / raw)
  To: 9front

On Sun, Dec 09, 2018 at 09:40:59PM +0000, Steve Simon wrote:
> The one I miss was the Look option from 9term,
> 
> that was very handy on occasion, to find a previous
> command that was lost in voluminous output.
> 
> -Steve

This?

changeset:   3211:1f1596dbca51
user:        cinap_lenrek@felloff.net
date:        Sat Jan 11 10:14:35 2014 +0100
summary:     rio: implement "look" (thanks lf94)

khm


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:55   ` Kurt H Maier
@ 2018-12-09 22:04     ` Steve Simon
  2018-12-09 22:07       ` Kurt H Maier
  0 siblings, 1 reply; 17+ messages in thread
From: Steve Simon @ 2018-12-09 22:04 UTC (permalink / raw)
  To: 9front

Marvelous!

don't shoot me I am still in the land of the labs
code with some bits of 9front, rio will now be one of those.

Thanks,

-Steve


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 22:04     ` Steve Simon
@ 2018-12-09 22:07       ` Kurt H Maier
  0 siblings, 0 replies; 17+ messages in thread
From: Kurt H Maier @ 2018-12-09 22:07 UTC (permalink / raw)
  To: 9front

On Sun, Dec 09, 2018 at 10:04:36PM +0000, Steve Simon wrote:
> Marvelous!
> 
> don't shoot me I am still in the land of the labs
> code with some bits of 9front, rio will now be one of those.

That's why I included the commit info, so you could grab the code if you
wanted.  I'm a big fan of Look in rio!

khm


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:40 ` Steve Simon
  2018-12-09 21:55   ` Kurt H Maier
@ 2018-12-09 22:28   ` Stanley Lieber
  1 sibling, 0 replies; 17+ messages in thread
From: Stanley Lieber @ 2018-12-09 22:28 UTC (permalink / raw)
  To: 9front

Look was added to 9front rio years ago.

sl



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:38 [9front] rio exit menu kvik
  2018-12-09 21:40 ` Steve Simon
@ 2018-12-11 21:24 ` Ethan Gardener
  2018-12-11 21:34   ` hiro
  1 sibling, 1 reply; 17+ messages in thread
From: Ethan Gardener @ 2018-12-11 21:24 UTC (permalink / raw)
  To: 9front

On Sun, Dec 9, 2018, at 9:38 PM, kvik wrote:
> I find it useful to have an "Exit" menu entry, sometimes.
> An opt-in option seems reasonable.

I implemented rio exit with confirmation in exactly the same way as mothra; same "ok?" icon and everything.  Does this sound good?  If so, I'll update my patch, health permitting.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-11 21:24 ` Ethan Gardener
@ 2018-12-11 21:34   ` hiro
  2018-12-11 21:54     ` Ethan Gardener
  0 siblings, 1 reply; 17+ messages in thread
From: hiro @ 2018-12-11 21:34 UTC (permalink / raw)
  To: 9front

no, that's horrible. if i want to exit i want to exit.
(now i can see this will never get anywhere. give up hope everybody)


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-11 21:34   ` hiro
@ 2018-12-11 21:54     ` Ethan Gardener
  2018-12-11 23:11       ` Ethan Gardener
  0 siblings, 1 reply; 17+ messages in thread
From: Ethan Gardener @ 2018-12-11 21:54 UTC (permalink / raw)
  To: 9front

On Tue, Dec 11, 2018, at 9:34 PM, hiro wrote:
> no, that's horrible. if i want to exit i want to exit.
> (now i can see this will never get anywhere. give up hope everybody)

Well, everyone always did maintain their own rio. :)  I have no objections whatever anyone wants to do, any more.  I have just discovered my old code is buried on the old FS I couldn't be bothered with any more.  (Quite liberating, forgetting about all the things you once wanted to save.)  I could dig it out or I could re-create it, but frankly, if I could create it in the first place, so could just-about anybody else. :)

cursor source:
/sys/src/cmd/mothra/mothra.c:/confirmcursor

that goes in rio/data.c; then I think you want to pull a very short function from mothra too, and assign it as callback for the exit menu entry.  It then should probably call rio's own exit menu callback which can be invoked if rio is started as 8.out or whatever.  Something like that!  Huh... I could have done the work in the time it took to type that! lol not really.

-- 
Progress might have been all right once, but it has gone on too long -- Ogden Nash


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-11 21:54     ` Ethan Gardener
@ 2018-12-11 23:11       ` Ethan Gardener
  0 siblings, 0 replies; 17+ messages in thread
From: Ethan Gardener @ 2018-12-11 23:11 UTC (permalink / raw)
  To: 9front

I decided to post my patch to 9front contrib, when it's redone.  I'm thinking it might be best if all these patches were put on contrib.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 20:26 qwx
  2018-12-09 20:38 ` [9front] " Julius Schmidt
@ 2018-12-13 10:44 ` Ethan Gardener
  1 sibling, 0 replies; 17+ messages in thread
From: Ethan Gardener @ 2018-12-13 10:44 UTC (permalink / raw)
  To: 9front

More complete patch, only because it turned up as a preliminary to what I intended to do.  I can't post it on my contrib now although I do think that's the best place for such patches.  I'm too stressed to look up how.

diff -c /sys/src/cmd/rio/rio.c rio_exit_conf/rio.c
/sys/src/cmd/rio/rio.c:52,57 - rio_exit_conf/rio.c:52,58
  	Delete,
  	Hide,
  	Exit,
+ 	Hidden,
  };
  
  enum
/sys/src/cmd/rio/rio.c:81,88 - rio_exit_conf/rio.c:82,87
  	menu2str
  };
  
- int	Hidden = Exit+1;
- 
  char		*menu3str[100] = {
   [New]		"New",
   [Reshape]	"Resize",
/sys/src/cmd/rio/rio.c:124,133 - rio_exit_conf/rio.c:123,128
  	Image *i;
  	Rectangle r;
  
- 	if(strstr(argv[0], ".out") == nil){
- 		menu3str[Exit] = nil;
- 		Hidden--;
- 	}
  	initstr = nil;
  	kbdin = nil;
  	maxtab = 0;
/sys/src/cmd/rio/rio.c:730,740 - rio_exit_conf/rio.c:725,732
  		hide();
  		break;
  	case Exit:
- 		if(Hidden > Exit){
- 			send(exitchan, nil);
- 			break;
- 		}
- 		/* else fall through */
+ 		send(exitchan, nil);
+ 		break;
  	default:
  		unhide(i);
  		break;


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:03     ` hiro
  2018-12-09 21:29       ` qwx
@ 2018-12-13  8:56       ` Ethan Gardener
  1 sibling, 0 replies; 17+ messages in thread
From: Ethan Gardener @ 2018-12-13  8:56 UTC (permalink / raw)
  To: 9front

On Sun, Dec 9, 2018, at 9:03 PM, hiro wrote:
> when you want to reuse the window.

I used it to close the window, being tidier and sometimes more accessible than selecting Delete in the parent.  Come to think of it, I didn't close subrios very often.  It only got used when I was shutting down to get the window out of the way so I didn't think its contents (extra editors) still needed to be closed properly.

I'm starting to think that old patch of mine shouldn't have worked when it did, calling emouse from a program which doesn't normally include event.h.  Yay for blundering into functionality.  I remember doing that & then fixing it at a later date, but can't remember how (or how well) I fixed it.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:03     ` hiro
@ 2018-12-09 21:29       ` qwx
  2018-12-13  8:56       ` Ethan Gardener
  1 sibling, 0 replies; 17+ messages in thread
From: qwx @ 2018-12-09 21:29 UTC (permalink / raw)
  To: 9front

Fair enough.  Calling off the paratroops.

Fwiw, I use subrios a lot, and it comes handy.

Thanks!

qwx


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 21:01   ` Stanley Lieber
@ 2018-12-09 21:03     ` hiro
  2018-12-09 21:29       ` qwx
  2018-12-13  8:56       ` Ethan Gardener
  0 siblings, 2 replies; 17+ messages in thread
From: hiro @ 2018-12-09 21:03 UTC (permalink / raw)
  To: 9front

when you want to reuse the window.


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 20:38 ` [9front] " Julius Schmidt
  2018-12-09 20:53   ` Steve Simon
@ 2018-12-09 21:01   ` Stanley Lieber
  2018-12-09 21:03     ` hiro
  1 sibling, 1 reply; 17+ messages in thread
From: Stanley Lieber @ 2018-12-09 21:01 UTC (permalink / raw)
  To: 9front

I agree with Julius.

Serious question: When and why do you need to kill rio cleanly?

sl



^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 20:38 ` [9front] " Julius Schmidt
@ 2018-12-09 20:53   ` Steve Simon
  2018-12-09 21:01   ` Stanley Lieber
  1 sibling, 0 replies; 17+ messages in thread
From: Steve Simon @ 2018-12-09 20:53 UTC (permalink / raw)
  To: 9front

I agree with aiju, don't do it.

-Steve


^ permalink raw reply	[flat|nested] 17+ messages in thread

* Re: [9front] rio exit menu
  2018-12-09 20:26 qwx
@ 2018-12-09 20:38 ` Julius Schmidt
  2018-12-09 20:53   ` Steve Simon
  2018-12-09 21:01   ` Stanley Lieber
  2018-12-13 10:44 ` Ethan Gardener
  1 sibling, 2 replies; 17+ messages in thread
From: Julius Schmidt @ 2018-12-09 20:38 UTC (permalink / raw)
  To: 9front

I'm opposed to this change.
I would kill too many rios by accident :)

On Sun, 9 Dec 2018, qwx wrote:

> Hello,
>
> Currently, rio hides an 'Exit' entry in mouse menu 3 unless argv[0] contains
> the string ".out".
>
> The inlined patch below removes the check and exposes the entry.
>
> While potentially dangerous, it is more convenient than manually killing a
> given rio, and several people including me have been using this or similar
> patches for a while.
>
> What do you think?  Would anyone else like to see this merged?
>
> Thanks,
>
> qwx
>
>
> diff -r 49bd5e4c9bde sys/src/cmd/rio/rio.c
> --- a/sys/src/cmd/rio/rio.c	Wed Feb 07 18:53:08 2018 +0000
> +++ b/sys/src/cmd/rio/rio.c	Thu Feb 15 23:00:00 2018 +0100
> @@ -125,10 +125,6 @@
> 	Image *i;
> 	Rectangle r;
>
> -	if(strstr(argv[0], ".out") == nil){
> -		menu3str[Exit] = nil;
> -		Hidden--;
> -	}
> 	initstr = nil;
> 	kbdin = nil;
> 	maxtab = 0;
>


^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2018-12-13 10:44 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-09 21:38 [9front] rio exit menu kvik
2018-12-09 21:40 ` Steve Simon
2018-12-09 21:55   ` Kurt H Maier
2018-12-09 22:04     ` Steve Simon
2018-12-09 22:07       ` Kurt H Maier
2018-12-09 22:28   ` Stanley Lieber
2018-12-11 21:24 ` Ethan Gardener
2018-12-11 21:34   ` hiro
2018-12-11 21:54     ` Ethan Gardener
2018-12-11 23:11       ` Ethan Gardener
  -- strict thread matches above, loose matches on Subject: below --
2018-12-09 20:26 qwx
2018-12-09 20:38 ` [9front] " Julius Schmidt
2018-12-09 20:53   ` Steve Simon
2018-12-09 21:01   ` Stanley Lieber
2018-12-09 21:03     ` hiro
2018-12-09 21:29       ` qwx
2018-12-13  8:56       ` Ethan Gardener
2018-12-13 10:44 ` Ethan Gardener

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).