9fans - fans of the OS Plan 9 from Bell Labs
 help / color / mirror / Atom feed
From: umbraticus@prosimetrum.com
To: 9fans@9fans.net
Subject: Re: [9fans] use of plumber for new rule
Date: Thu, 20 Oct 2022 21:56:09 +1300	[thread overview]
Message-ID: <63C9218A73720FBF83C58AB34B4E8116@prosimetrum.com> (raw)
In-Reply-To: <16661858650.19CAe129.83221@composer.9fans.topicbox.com>

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

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.

umbraticus

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

  reply	other threads:[~2022-10-20  8:55 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 [this message]
2022-10-20 13:18   ` Chris Gorman
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=63C9218A73720FBF83C58AB34B4E8116@prosimetrum.com \
    --to=umbraticus@prosimetrum.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).