Help with manpage plumbing on macOS

95 views
Skip to first unread message

Brendan Desmond

unread,
May 25, 2021, 1:04:25 PM5/25/21
to plan9p...@googlegroups.com
Hello,

I'm having an issue with plumbing man page references within Acme. If the command also exists on my host system, I am taken to the macOS man page for the command, not the p9p man page.

Examples:

1. Right-click 'intro(1)'
2. Produces macOS/BSD intro(1) man page

1. Right-click 'ls(1)'
2. Produces macOS/BSD ls(1) man page

1. Right-cick 'mc(1)'
2. Produces plan9port mc(1) man page

My ~/lib/plumbing file only contains `editor = acme` and `include basic` currently, and I am running Acme without any command line flags or customizations. The only env variable I have set relating to man pages that I can find is `MPAGE="-t -bLetter"`. $PLAN9/bin is appended to the end of my $PATH.

Am I missing something obvious here?

-Brendan

Bakul Shah

unread,
May 25, 2021, 1:46:52 PM5/25/21
to bre...@fastmail.com, plan9p...@googlegroups.com
You can use this plumbing entry:

type is text
data matches '([a-zA-Z¡- 0-9_\-./]+)\(([1-8])\)'
plumb start rc -c '9 man '$2' '$1' >[2=1] | nobs | plumb -i -d edit -a ''action=showdata filename=/man/'$1'('$2')'''

Brendan Desmond

unread,
May 27, 2021, 2:17:41 PM5/27/21
to plan9port-dev
This does work—thank you. The cost, obviously, is that I can no longer access the manpages of my host system in the same manner via the plumber. Perhaps this would be a good exercises in hacking up a workaround so I can have the best of both worlds. I appreciate the tip.

-Brendan
> --
>
> ---
> You received this message because you are subscribed to the Google
> Groups "plan9port-dev" group.
> To unsubscribe from this group and stop receiving emails from it, send
> an email to plan9port-de...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/plan9port-dev/A506B02E-4B72-4D0E-A14A-9B2C020C9528%40iitbombay.org.
>

Brendan Desmond

unread,
May 27, 2021, 5:20:54 PM5/27/21
to plan9port-dev
This does work—thank you. The cost, obviously, is that I can no longer access the manpages of my host system in the same manner via the plumber. Perhaps this would be a good exercises in hacking up a workaround so I can have the best of both worlds. I appreciate the tip.

-Brendan

Lyndon Nerenberg (VE7TFX/VE6BBM)

unread,
May 27, 2021, 5:20:54 PM5/27/21
to bre...@fastmail.com, plan9p...@googlegroups.com
Brendan Desmond writes:
> This does work=E2=80=94thank you. The cost, obviously, is that I can no lon=
> ger access the manpages of my host system in the same manner via the plumbe=
> r. Perhaps this would be a good exercises in hacking up a workaround so I c=
> an have the best of both worlds. I appreciate the tip.

In the default setup you get the manpage that corresponds to the
binary that would run from the command line. I.e. UNIX man(1)
searches based on $PATH, and plan9 man searches just plan9 manpages.
So, running /usr/bin/man will defer to the UNIX manpage over the
plan9 one; you'll only see the plan9 page if there's no corresponding
UNIX page.

This is the behaviour you want. It ensures the documentation matches
the actual binary you'll be running. Since you know how your $PATH
is set up you will know which manpage to expect. If you only want
the plan9 or UNIX page, you need to explicitly run man prefixed by
'9' or 'u' respectively. E.g., to get the plan9 ls(1), you need
to run '9 man ls' in a normal MacOS setup.

You could also try changing the plumber to invoke 'u man -a' instead
of bare 'man'. In theory this will print both the UNIX and plan9
pages, but I haven't tested it. It might give you more than you
asked for, though.

--lyndon

Andrew Eggenberger

unread,
May 27, 2021, 5:54:45 PM5/27/21
to bre...@gmail.com, plan9port-dev
You could create a new format like grep(1-9) that would give print the 9 version of the utility. It’s not as convenient for navigating among man pages though.--
Andrew Eggenberger

Ethan Gardener

unread,
May 30, 2021, 12:27:06 PM5/30/21
to 'Shoce' via plan9port-dev
On Thu, May 27, 2021, at 10:32 PM, Andrew Eggenberger wrote:
You could create a new format like grep(1-9) that would give print the 9 version of the utility. It’s not as convenient for navigating among man pages though.

Unless you hack in a sed or awk command to change the man page cross-references. ;)
Reply all
Reply to author
Forward
0 new messages