public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: bugzilla-daemon@kernel.org
To: linux-man@vger.kernel.org
Subject: [Bug 216603] New: Environment variable MANLESS is described wrong in man(1)
Date: Tue, 18 Oct 2022 19:55:24 +0000	[thread overview]
Message-ID: <bug-216603-11311@https.bugzilla.kernel.org/> (raw)

https://bugzilla.kernel.org/show_bug.cgi?id=216603

            Bug ID: 216603
           Summary: Environment variable MANLESS is described wrong in
                    man(1)
           Product: Documentation
           Version: unspecified
          Hardware: All
                OS: Linux
            Status: NEW
          Severity: normal
          Priority: P1
         Component: man-pages
          Assignee: documentation_man-pages@kernel-bugs.osdl.org
          Reporter: karttu+bugzilla@gmail.com
        Regression: No

In an example for setting MANLESS environment variable, man(1) claims:

    For example, if you want to set the prompt string unconditionally
    to "my prompt string", set $MANLESS to '-Psmy prompt string'.

However, this is not not correct as man uses the entire MANLESS variable
as a prompt for less.  I'll demonstrate:

    $ MANLESS='-Ps(prompt)' man man
    <ctrl-z>
    $ cat /proc/$(pgrep -P $(pgrep -f "man man"))/environ |
    tr '\0' '\n' | grep "^LESS="

    LESS=-ix8RmPm-Ps(prompt)$PM-Ps(prompt)$

As seen, man(1) defines -Pm and -PM prompts using the MANLESS variable as is.
The same applies to the command line option -r:

    $ man -r'-Ps(prompt)' man
    <ctrl-z>
    $ cat /proc/$(pgrep -P $(pgrep -f "man .* man"))/environ |
    tr '\0' '\n' | grep "^LESS="

    LESS=-ix8RmPm-Ps(prompt)$PM-Ps(prompt)$

Option -r does not make the same claim, but it says:

    By default man sets the -ix8 options.

Which also is a bit outdated as we can see it sets -ix8R.

So in summary, at least the '-Ps' part should be removed from the MANLESS
description example.  Furthermore, option -r description could elaborate on
how LESS variable is formed (-ix8RmPm<MANLESS or -r>$PM<MANLESS or -r>$).

Note: Dollar sign in less prompt definition is an end-of-string marker.

-- 
You may reply to this email to add a comment.

You are receiving this mail because:
You are watching the assignee of the bug.

             reply	other threads:[~2022-10-18 19:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-18 19:55 bugzilla-daemon [this message]
2022-10-18 20:05 ` [Bug 216603] Environment variable MANLESS is described wrong in man(1) bugzilla-daemon
2022-10-18 20:19 ` bugzilla-daemon

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=bug-216603-11311@https.bugzilla.kernel.org/ \
    --to=bugzilla-daemon@kernel.org \
    --cc=linux-man@vger.kernel.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