From: Romano <me+unobe@fallglow.com>
To: 9front@9front.org
Subject: Re: [9front] drawterm lib configuration
Date: Wed, 28 Aug 2024 09:55:51 -0700 [thread overview]
Message-ID: <4DD9E1C4F82182303A7893CB307F3FBF@smtp.pobox.com> (raw)
In-Reply-To: <378b3dc3-e759-46f2-87e8-01c25c0f1b56@posixcafe.org>
On Wed Aug 28 07:31:20 -0700 2024, moody@posixcafe.org wrote:
> What defaults are you changing here?
Setting up different plumbing rules, different fonts
(remember that bad patch for rio border size?), certain
mounts. For example, when I drawterm from a mac I use
osascript to open a new tab for web links, and open any docx
files on the Mac. I also create a 9pfs mount (as explained on
the wiki) to browse files using the Finder, if I prefer.
> Most of our scripts have this blank line, it's style.
Thanks for pointing that out. I see 77/135 of the scripts in
/bin/rc have a second blank line, so 57% overall:
cpu% { for (f in `{walk -f /rc/bin}) { echo `{sed 2q $f | tail -1} } } | sort | uniq -c | sort -r | sed 4q
77
25 rfork e
3 rfork en
2 if(~ $#* 3){
cpu% ls /rc/bin | wc -l
135
This isn't comprehensive by any means, but just a directory I knew
had a lot of system rc scripts. For comparison, /bin/git directory (like /sys/lib/newuser) isn't included in the numbers above:
cpu% { for (f in `{walk -f /bin/git}) { echo `{sed 2q $f | tail -1} } } | sort | uniq -c | sort -r | sed 3q
8 rfork ne
5 rfork en
3
In your experience, is calling rfork on the second line an exception to
that style? If so, that would make about 78% of the scripts in /rc/bin
conform to the style. But removing the '| sed 4q' at the end, you'd also
see quite a few first lines being explanatory comments of what the script
does, and about a dozen that just call exec.
I haven't checked out a Plan 9's 4th edition or previous edition to
compare to see if it has been newer style, or just always been a
hodge-podge.
Regardless, it's good for me to be aware of that: thank you.
> What do you mean "forcing directory creation" you're calling mkdir,
> you're creating directories. The two calls with -p or not with your
> ordering are equivalent.
Forcing intermediate directory creation, so really the 'bin' dir. This
just reflected how the long-form was before my patch: it didn't use -p.
I didn't know if there was a good reason for that, and thought it might
have been for some esoteric but valid reason related to creating bin
first, before its subdirectories. So I decided to write it without -p.
> >>> @@ -22,38 +21,41 @@
> >>> font=/lib/font/bit/vga/unicode.font
> >>> switch($x^service){
> >>> case terminal
> >>> - webcookies
> >>> - webfs
> >>> - plumber
> >>> echo -n accelerated > '#m/mousectl'
> >>> echo -n 'res 3' > '#m/mousectl'
> >>> prompt=('term% ' ' ')
> >>> fn term%{ $x^* }
> >>> + webcookies
> >>> + webfs
> >>> + plumber
> >>> rio
> >>>
> >>> What does moving this around achieve?
> >>
> >> I didn't think it was foolish to have consistency with the other case
> >> (cpu) to have those run at the end. I didn't see the point of having
> >> them before those other commands.
>
> The point is to avoid churn, but I'm bikeshedding.
I'm not sure it's bikeshedding here. My perspective is that a script should
not do the same thing in a different order unless called for. I was trying
to determine why the first three calls were separated from the last, when
that isn't the case for cpu. I assume I will read this script again, and so
considered it a benefit for the human reader to consolidate the calls as is
done in the cpu case.
> Right, drawterm does add it's own /dev/ to the root before exposing the
> namesapce to the remote system so you'll see drawterm's /dev.
> My recollection of the ordering was wrong and in retrospect doesn't make sense.
>
> That first check is just checking to see if we should make use of the /mnt/term/dev anyway,
> so it seems fine to have that be the check there.
*Whew*, well I'm glad that was one less thing I had possibly fumbled!
Thanks again for the feedback, moody.
prev parent reply other threads:[~2024-08-28 16:57 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-27 18:40 Romano
2024-08-27 22:05 ` Jacob Moody
2024-08-28 8:15 ` Romano
2024-08-28 8:30 ` Romano
2024-08-28 14:29 ` Jacob Moody
2024-08-28 16:55 ` Romano [this message]
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=4DD9E1C4F82182303A7893CB307F3FBF@smtp.pobox.com \
--to=me+unobe@fallglow.com \
--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).