From owner-freebsd-current@freebsd.org Wed Dec 6 22:04:14 2017 Return-Path: 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 3EF71E8D40B; Wed, 6 Dec 2017 22:04:14 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:a:dead:bad:faff]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 028D564311; Wed, 6 Dec 2017 22:04:13 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id vB6M4CXC026346; Wed, 6 Dec 2017 22:04:12 GMT (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id vB6M4B03026339; Wed, 6 Dec 2017 22:04:11 GMT (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net> Date: Wed, 06 Dec 2017 22:04:11 +0000 Organization: Dyslexic Fish To: freebsd-current@freebsd.org, freebsd-hackers@freebsd.org, by@meetlost.com Cc: jamie@catflap.org Subject: Re: Strange behavior about pattern matching on manual pages [FIXED] References: <620CD9B7-201A-46FD-8C9D-DD8DDA3A05C3@meetlost.com> In-Reply-To: <620CD9B7-201A-46FD-8C9D-DD8DDA3A05C3@meetlost.com> User-Agent: Heirloom mailx 12.4 7/29/08 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Wed, 06 Dec 2017 22:04:12 +0000 (GMT) X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 06 Dec 2017 22:04:14 -0000 by 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 ‘/’, and then input the pattern, If it got something in the page, it will direct me into the specified place, and then, I continue with ’n’, and it goes well. > But the problem is, after a sequence of ’n’, the screen go to the end of the manual pages, and keeping press ’n’, I got annoying “...skipping...”, 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 work 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 +0000 +++ 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 == NULL_POSITION && !top_scroll && #if TAGS tagoption == 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 = TRUE; + scan_option("--tilde"); + } #if EDITOR editor = lgetenv("VISUAL");