9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: Chris Gorman <chrisjohgorman@gmail.com>
To: 9fans <9fans@9fans.net>
Subject: Re: [9fans] use of plumber for new rule
Date: Thu, 20 Oct 2022 09:18:19 -0400	[thread overview]
Message-ID: <CAHVeOW8qoKxJ+1QKZ=o0fytJOz3XYkph=KofEkiz_PBUnkcCaQ@mail.gmail.com> (raw)
In-Reply-To: <63C9218A73720FBF83C58AB34B4E8116@prosimetrum.com>

Thank you Umbraticus!

On Thu, Oct 20, 2022 at 4:56 AM <umbraticus@prosimetrum.com> wrote:
>
> Here's my rule for manpages:
>
> data matches (.+)\(([0-9])\)
> arg isfile /sys/man/$2/$1
> plumb start rc -c 'man -t '$2' '$1' | plumb -id image'
>
> which replumbs the cmd output to the image port; then:
>
> dst is image
> plumb to image
> plumb client rc -c 'window -r 380 0 1600 900 ''echo -n page >/dev/label; bind /dev/mordor /dev/label; page -i -p180 -m64'''
>
> either sends it to any existing page instance
> or else starts a new one to send it to.
> Worth noting I am using 9front's version of page,
> which listens on the image port; can't recall if the original
> listens on the postscript port in a similar way: probably.
> If you just want to pop open a new window with
> your dvi each time you can use a plumb start rule
> that does whatever you want; something like:
>
> data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)'
> arg isfile $0
> plumb start window kertex/dvips $0 '|' page
>

This solution works near perfectly for me.  I needed to add a $wdir
before the filename, but otherwise it works!  To be clear, my rule is
now...

data matches '([a-zA-Z¡-�0-9_\-.,/]+)\.(dvi|DVI)'
arg isfile $0
plumb start window kertex/dvips $wdir/$0 '|' page

> There are other workflows too, if what you want is a tight
> loop for editing a document and seeing the new version.
> Some people use a watch(1) program that runs a command
> whenever a given file changes. I prefer to tie the file write
> and doc gen to a single command using (9front) sam's ^ cmd,
> which sends its output to sam's command window:
>
> ^echo w; window troff $% '|' page
>
> The last shell command is remembered, so subsequent
> write'n'reviews are a simple ^ thereafter.

Very nice suggestion.  I will try to put this one in my bag of tricks.

>
> umbraticus

Thank you again.

Take care,

Chris


------------------------------------------
9fans: 9fans
Permalink: https://9fans.topicbox.com/groups/9fans/Tce7385fe52c532d6-M62d39a71195ef5c3462e8b42
Delivery options: https://9fans.topicbox.com/groups/9fans/subscription

  reply	other threads:[~2022-10-20 13:18 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-19 13:24 Chris Gorman
2022-10-20  8:56 ` umbraticus
2022-10-20 13:18   ` Chris Gorman [this message]
2022-10-20 16:52     ` Chris Gorman
2022-10-20 17:00       ` umbraticus
2022-10-20 17:52         ` Chris Gorman
2022-10-21  1:10           ` Chris Gorman

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='CAHVeOW8qoKxJ+1QKZ=o0fytJOz3XYkph=KofEkiz_PBUnkcCaQ@mail.gmail.com' \
    --to=chrisjohgorman@gmail.com \
    --cc=9fans@9fans.net \
    /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).