Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 6 Dec 2017 15:23:33 -0700
From:      Alan Somers <asomers@freebsd.org>
To:        Jamie Landeg-Jones <jamie@catflap.org>
Cc:        FreeBSD CURRENT <freebsd-current@freebsd.org>,  "freebsd-hackers@freebsd.org" <freebsd-hackers@freebsd.org>, by@meetlost.com
Subject:   Re: Strange behavior about pattern matching on manual pages [FIXED]
Message-ID:  <CAOtMX2hWLefYvC51w=1bb2=TodnkhjB2jH9Zb9xKFmKORxWvjQ@mail.gmail.com>
In-Reply-To: <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net>
References:  <620CD9B7-201A-46FD-8C9D-DD8DDA3A05C3@meetlost.com> <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Wed, Dec 6, 2017 at 3:04 PM, Jamie Landeg-Jones <jamie@catflap.org>
wrote:

> by <by@meetlost.com> wrote:
>
> > Hi,
> >
> > I encounter a problem when viewing manuals via man(1) command.
> >
> > The case is simple, when I try to search something, I press =E2=80=98/=
=E2=80=99, and
> then input the pattern, If it got something in the page, it will direct m=
e
> into the specified place, and then, I continue with =E2=80=99n=E2=80=99, =
and it goes well.
> > But the problem is, after a sequence of =E2=80=99n=E2=80=99, the screen=
 go to the end of
> the manual pages, and keeping press =E2=80=99n=E2=80=99, I got annoying =
=E2=80=9C...skipping...=E2=80=9D,
> the page is full of skipping and parts of the end of the manual page.
>
> Yes. This has been annoying me too - your email prompted me to finally wo=
rk
> on a fix for it!
>
> Firstly, it isn't man(1) itself - man(1) uses more(1) as the pager.
> more(1) is in itself actually the program less(1), running in "more
> emulation mode".
>
> And less(1) isn't FreeBSD native code - it's imported into the project
> from http://www.greenwoodsoftware.com/less/
>
> I noticed the very latest version of less(1) has been checked into
> freebsd-current, and the issue still occurs there.
>
> Anyway, the fix is two small patches to less(1), please let me know
> if they work for you, and if you see any bad side-effects in man(1) /
> more(1) and less(1) and I'll then try and get them applied upstream.
>
> The patches have been tested against FreeBSD 11.1-STABLE and 12-CURRENT
>
> cheers! Jamie
>
> --- contrib/less/forwback.c.orig        2017-11-20 08:52:33.978356000 +00=
00
> +++ contrib/less/forwback.c     2017-12-05 15:53:50.517550000 +0000
> @@ -255,7 +255,7 @@
>                  * start the display after the beginning of the file,
>                  * and it is not appropriate to squish in that case.
>                  */
> -               if ((first_time || less_is_more) &&
> +               if ((first_time) &&
>                     pos =3D=3D NULL_POSITION && !top_scroll &&
>  #if TAGS
>                     tagoption =3D=3D NULL &&
> --- contrib/less/main.c.orig    2017-11-20 08:52:33.978356000 +0000
> +++ contrib/less/main.c 2017-12-05 15:53:57.291394000 +0000
> @@ -168,7 +168,10 @@
>         }
>
>         if (less_is_more)
> +       {
>                 no_init =3D TRUE;
> +               scan_option("--tilde");
> +       }
>
>  #if EDITOR
>         editor =3D lgetenv("VISUAL");
>
>
How about just setting MANPAGER=3Dless in your environment?



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAOtMX2hWLefYvC51w=1bb2=TodnkhjB2jH9Zb9xKFmKORxWvjQ>