From owner-freebsd-current@freebsd.org  Wed Dec  6 22:23:41 2017
Return-Path: <owner-freebsd-current@freebsd.org>
Delivered-To: freebsd-current@mailman.ysv.freebsd.org
Received: from mx1.freebsd.org (mx1.freebsd.org
 [IPv6:2001:1900:2254:206a::19:1])
 by mailman.ysv.freebsd.org (Postfix) with ESMTP id 51440E8E1C7;
 Wed,  6 Dec 2017 22:23:41 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: from mail-lf0-x241.google.com (mail-lf0-x241.google.com
 [IPv6:2a00:1450:4010:c07::241])
 (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
 (Client CN "smtp.gmail.com",
 Issuer "Google Internet Authority G2" (verified OK))
 by mx1.freebsd.org (Postfix) with ESMTPS id C79216546A;
 Wed,  6 Dec 2017 22:23:40 +0000 (UTC)
 (envelope-from asomers@gmail.com)
Received: by mail-lf0-x241.google.com with SMTP id f20so6001013lfe.3;
 Wed, 06 Dec 2017 14:23:40 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025;
 h=mime-version:sender:in-reply-to:references:from:date:message-id
 :subject:to:cc;
 bh=APkbrG3xZofywJ8qjIraM1jtmVUZ+pJLVuPWHilzzKI=;
 b=Lh8lp1s2d4t/cG1Hed9rbBezIpQpLfS7tlHIJ+/rLC3/inOXdGm/3uwyt5OO9W2AAs
 SsMJ36SmCQ83a3+hKcLkbWjaIy2ViekwF3oBX0tMu5SFbGpMHMQ1r1v9+VeeBfM42n57
 q87YqOiYFrPiOp4HXfweWhol4YgrjMrPXjY+3UCUKLcENhwQyzaOf2CO1MgofxOLdno7
 Gzigd5Jg3K6XTAPQBlw18nWhdgzAuJNbPvI8p6HCe/QqlapvmP2QJRWzyHQaWbme+6Na
 sH9KX/Vw7W/AQ+c8iFft9EgvJJ+E7j29uokIAyfsAXC4dm7LKhBe/u49BQkM1iYs6XJV
 e4KA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20161025;
 h=x-gm-message-state:mime-version:sender:in-reply-to:references:from
 :date:message-id:subject:to:cc;
 bh=APkbrG3xZofywJ8qjIraM1jtmVUZ+pJLVuPWHilzzKI=;
 b=RpWHW6o71E3JVg0VPqKwfMAzlQ+qZ6MIAptuAvLka6lQoR0GmhcsBkvXsgql5tsPNw
 F87C8dWIOMiOv/SKd7RLGJ0Da9X7X0ITJuhUSTqCiCRn8gLsfJQsvZFWy6iNG9q92wsk
 YZ/DQ032W8EwgqO5mxbSzWBwcYEMIxAVK41b7P0TDGBKLPU+Q2xoWCFuLzvETZMR5NUV
 lDJ85SOskasD5EbB7ZePnRUjt7cVbwYTenvuu5933atyUbrvXpYeqKSgKdxWRZ9wyFRB
 jJfuVk1Tyzqz0u9DhitkN0jcSDvd8g/QHz4dR/vUPWTKmkcqwp732O9XjgEckD02XihY
 Yxrw==
X-Gm-Message-State: AJaThX6nZKZyTIsW0PDv/zUjR1AE0jYsPH3K+iMIJmjq99J/ClK0vfTM
 Vr0e8tHZsPVB8J5BqRpGv6mv4XHqHgTcDhtNR3g=
X-Google-Smtp-Source: AGs4zMbXTfM91peHPELjflGn3rKilQ5QJdTOlY6/DAkYeqeKM1j+Wg7Mfx5adwHvqp6s1LzlFxj4uT87ToYpC7AfwKM=
X-Received: by 10.25.27.18 with SMTP id b18mr10864510lfb.177.1512599013965;
 Wed, 06 Dec 2017 14:23:33 -0800 (PST)
MIME-Version: 1.0
Sender: asomers@gmail.com
Received: by 10.179.76.19 with HTTP; Wed, 6 Dec 2017 14:23:33 -0800 (PST)
In-Reply-To: <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net>
References: <620CD9B7-201A-46FD-8C9D-DD8DDA3A05C3@meetlost.com>
 <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net>
From: Alan Somers <asomers@freebsd.org>
Date: Wed, 6 Dec 2017 15:23:33 -0700
X-Google-Sender-Auth: PbHdgm82FpjFJisFwVRSJ66iRhc
Message-ID: <CAOtMX2hWLefYvC51w=1bb2=TodnkhjB2jH9Zb9xKFmKORxWvjQ@mail.gmail.com>
Subject: Re: Strange behavior about pattern matching on manual pages [FIXED]
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
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Content-Filtered-By: Mailman/MimeDel 2.1.25
X-BeenThere: freebsd-current@freebsd.org
X-Mailman-Version: 2.1.25
Precedence: list
List-Id: Discussions about the use of FreeBSD-current
 <freebsd-current.freebsd.org>
List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=unsubscribe>
List-Archive: <http://lists.freebsd.org/pipermail/freebsd-current/>
List-Post: <mailto:freebsd-current@freebsd.org>
List-Help: <mailto:freebsd-current-request@freebsd.org?subject=help>
List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-current>, 
 <mailto:freebsd-current-request@freebsd.org?subject=subscribe>
X-List-Received-Date: Wed, 06 Dec 2017 22:23:41 -0000

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?