9front - general discussion about 9front
 help / color / mirror / Atom feed
From: kvik@a-b.xyz
To: 9front@9front.org
Subject: Re: [9front] [PATCH] rio: add -label wctl param; improve window(1)
Date: Wed, 13 May 2020 15:14:17 +0200	[thread overview]
Message-ID: <AA875B8F23C43D0E6E24C4A428E0FF57@a-b.xyz> (raw)
In-Reply-To: <f8365b06-4800-46c8-96df-6cfc0d17f793@www.fastmail.com>

> Good in principle, I think, but just to note: if window(1) no longer calls
> itself, users will probably have to change quoting in scripts which call
> window.

I may be missing something but I don't see how this would be the case.

The arguments constituting a command are evaluated once by the calling
shell and are passed into window(1), ending up in the $cmd list.  Before
or after this patch this list stays the same as it is passed along;
specifically it does not get reevaluated until the final rc -c in either
rio itself or in (new) window(1).  Consider the example:

	fn nargs {
		echo $#* : $*
	}
	fn once {
		nargs $*
		twice $*
	}
	fn twice {
		nargs $*
		echo 'nargs '$"*
		rc -c 'nargs '$"*
	}

	; once 1 '2 3' '''4 5'''
	3 : 1 2 3 '4 5'
	3 : 1 2 3 '4 5'
	nargs 1 2 3 '4 5'
	4 : 1 2 3 4 5

You see that the initial argument list stays the same as it is being
passed along, that is until another round of evaluation inside the
rc -c subshell where the next layer of quotes is stripped.

In the argument parsing sense removing the recursive call to window -x
is the same as skipping the call to 'once' in the above example.

> window -r 268 0 868 400 -scroll rc -c \
> 	'''label -f kprint; echo kprint; tail -f /tmp/kprint'''
> window -r 0 0 128 128 colorclock_l
> window -r 0 124 128 252 rc -c \
> 	'''font=/lib/font/bit/dejavusans/unicode.12.font; stats -Ime'''

These commands run as expected with the patch.

> Now I think of it, I don't really agree with window(1) setting the label
> at all, but it's a minor point.

I'm not a fan of automatic labeling either.  Ideally the programs would
set the label themselves if the user didn't request a name, but I don't
think this is easily accomplished.


  reply	other threads:[~2020-05-13 15:12 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-13 10:20 kvik
2020-05-13 13:34 ` [9front] " Ethan Gardener
2020-05-13 13:14   ` kvik [this message]
2020-05-14 13:28     ` Ethan Gardener
2020-05-14 12:20       ` kvik
2020-05-16 12:22   ` cinap_lenrek
2020-05-16 11:53     ` kvik
2020-05-16 18:04       ` cinap_lenrek
2020-05-16 14:04 ` cinap_lenrek
2020-05-16 16:08   ` kvik
2020-05-16 20:30     ` cinap_lenrek
2020-05-16 19:05       ` kvik

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=AA875B8F23C43D0E6E24C4A428E0FF57@a-b.xyz \
    --to=kvik@a-b.xyz \
    --cc=9front@9front.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).