Environment variable MANLESS is described wrong in man(1)
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.