2017-10-13 23:24 GMT+09:00 LCD 47 <[email protected]>:

> On 13 October 2017, Kazunobu Kuriyama <[email protected]>
> wrote:
> > 2017-10-13 22:25 GMT+09:00 LCD 47 <[email protected]>:
> [...]
> > >     I don't think the MANPAGER way can be salvaged without MAN_PN
> > > (i.e. the problem of "man Xorg" and "man Net::DNS" can't be solved
> > > reasonably without it).  That's why my patch only addresses the case
> > > where "man" sets $MAN_PN.  That only covers some Linux systems.  On
> > > other systems I suggest using a wrapper script instead, that tries
> > > to syntesize a $MAN_PN before running "man".
> > >
> >
> > I didn't try addressing the issue for systems not having MAN_PN.
> >
> > But, according to :h manpager, it clams that it works for macOS with
> >
> > export MANPAGER="env MAN_PN=1 vim -M +MANPAGER -"
> >
> > Since macOS doesn't has MAN_PN, I have no idea as to what it is and
> > what it is for, and I hadn't known about the mentioned wrapper script
> > solution until you told me.  True, macOS doesn't have MAN_PN, but the
> > help asks to set it to 1, and I'm following the instructions...
>
>     "man-db", which is a "man" implementation used on some Linux
> distributions, sets the environment variable MAN_PN to something like
> "ls(1)", and passes it to programs run from $MANPAGER.  To the best of
> my knowledge no other "man" implementation does that.
>
>     The manual asks you to set MAN_PN to 1.  If it's still 1 (as opposed
> to something like "ls(1)") when Vim is run from $MANPAGER, your "man"
> didn't set MAN_PN to anything useful.  When that happens, Vim tries to
> parse the name and the section of the man page from the first line in
> the formatted page.  However, said line looks something like this:
>
> LS(1)                       General Commands Manual
> LS(1)
>
>     To get from "LS(1)" to "ls(1)" Vim uses tolower().  That breaks for
> man pages such as "Xorg", or "Net::DNS".  This is the problem I'm trying
> to address.
>

What I found was that your solution wasn't enough for Mac.   The header
which begins with something like LS(1) is not always on line 1 for Mac.
And the proposed logic making everything lower via tolower() doesn't work
for handling Xorg or Net::DNS for Mac.  My patch is an compliment to yours.

>
> [...]
> > >
> > >     It isn't that I don't _like_ it.  Your patch changes the
> > > non-MAN_PN branch, it's unrelated to mine.  As I said, I'm
> > > suggesting the wrapper script as a possibly better solution for that
> > > ("better" as in, it solves the "man Xorg" and "man Net::DNS" problem
> > > I described in my first message).
> >
> > No, my patch actually changes the MAN_PN branch ("if MAN_PN is 1"),
> > and now I can use Vim as a stand-alone man pager which can work nicely
> > with both "man Xorg" and "man Net::DNS", which I think shares the same
> > goal of your patch.
>
>     As I explained above, "$MAN_PN is 1" is the non-MAN_PN case.
>

But what makes your patch not working nicely for Mac is exactly what it
does in that branch, no matter what it is called :)


>     /lcd
>

Kazunobu

>
> --
> --
> You received this message from the "vim_dev" maillist.
> Do not top-post! Type your reply below the text you are replying to.
> For more information, visit http://www.vim.org/maillist.php
>
> ---
> You received this message because you are subscribed to the Google Groups
> "vim_dev" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
-- 
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php

--- 
You received this message because you are subscribed to the Google Groups 
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Raspunde prin e-mail lui