From owner-freebsd-hackers@freebsd.org Tue Dec 12 17:26:14 2017 Return-Path: Delivered-To: freebsd-hackers@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 36960E9FBD2 for ; Tue, 12 Dec 2017 17:26:14 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-lf0-x244.google.com (mail-lf0-x244.google.com [IPv6:2a00:1450:4010:c07::244]) (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 6C95E66EDA for ; Tue, 12 Dec 2017 17:26:13 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x244.google.com with SMTP id f18so24065437lfg.8 for ; Tue, 12 Dec 2017 09:26:12 -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:cc; bh=X3QzjHhz4dZL6Jg+3WPa4fBxJJOvvzPpM0shuTeko34=; b=j9/ilHKNJAaBZOMAOvmfpWHB9FJBoc7uFg8nP6NCj8VHzadx3pGBppAXeB8odQIN0q 5DG9wZGDAOBYEcM81f3KaupP+5QJMLnK/fmej31vbbQPqbnuKmTwsm5D85aDnCEybHSS Ql/hnrWXVWrWxyAzoOOY/Ry8qp0yCDjl0VPcnA7J2Rgsv42Vb870psISH1gWJSCo5VsL +2jU/O1YnxTAlhDMixG1tXsyhujYIWdpL+Q3GkllCxhJIh96E4Us835ELWTBWi+mdPRN hTuH3di1b+neilQof7C3+IayHWXyemalRVrDu4gKoIxs2R6K5lB19iLeesA1dwF7DX05 2FDw== 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:cc; bh=X3QzjHhz4dZL6Jg+3WPa4fBxJJOvvzPpM0shuTeko34=; b=tJLTkLnpv/Srg+noeuxgWRTnktRqLUXRPfIFLaYijNGjOVlkHMzg0OxT5Rw5BfN2/q CJw5CbfXO/zZWRW49FA+f8tyz+5CFAz7BUW3x09Q7erMrREgDd7jqTOOJRqJMABkZEEe pVCKTGKGykPNXnPoFmo4ku1Ap2hgVvG6H5vk7puHemBwJzPoM+n99Wa+erUJkS83aspy p2Pe6hCOxPtJx9RSI1jocIgyuKIdPvX9HK5bN21QVlxCazSVjb4q5SFwqmbzaSu06cR6 Vlywq8ILrMmsO6JgZTHvJ6mM92PVgAaWeQnSTR4wdxdOvo8htLOxSh0kA6n9JgU77yr2 l6uQ== X-Gm-Message-State: AKGB3mJ//mJT2qV2zz4s6AUQ41Gij9yQsPDNSy0Of9PA+IC1bWksfvCd G6c2OwTvKKsceXejGhCG28MfjnAJsqEvnSQKyjc= X-Received: by 10.46.84.86 with SMTP id y22mt2765680ljd.89.1513099570809; Tue, 12 Dec 2017 09:26:10 -0800 (PST) MIME-Version: 1.0 Sender: asomers@gmail.com Received: by 10.179.76.19 with HTTP; Tue, 12 Dec 2017 09:26:10 -0800 (PST) In-Reply-To: References: <620CD9B7-201A-46FD-8C9D-DD8DDA3A05C3@meetlost.com> <201712062204.vB6M4B03026339@donotpassgo.dyslexicfish.net> <201712062235.vB6MZlQv034650@donotpassgo.dyslexicfish.net> From: Alan Somers Date: Tue, 12 Dec 2017 10:26:10 -0700 X-Google-Sender-Auth: DA9PJwQPopD53BO7SVWR3aVGm-M Message-ID: Subject: Re: Strange behavior about pattern matching on manual pages [FIXED] Cc: Jamie Landeg-Jones , "freebsd-hackers@freebsd.org" , FreeBSD CURRENT , by@meetlost.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 12 Dec 2017 17:26:14 -0000 On Wed, Dec 6, 2017 at 3:53 PM, Alan Somers wrote: > On Wed, Dec 6, 2017 at 3:35 PM, Jamie Landeg-Jones > wrote: > >> Alan Somers wrote: >> >> > How about just setting MANPAGER=less in your environment? >> >> Because some of us prefer "more"? >> >> And as I said, it's related to searching using the more(1) command >> generally. >> >> I was under the impression that fixing bugs in existing commands was a >> better >> solution than telling someone to simply use something else. >> > > Yes, it certainly is. Are you sure this is actually a bug in less, or is > it just weird-but-intended behavior when less is emulating some old version > of more? It would be worth comparing our less sources to upstream's to see > what differences have crept in, and svn blaming them to see why. > I finally traced down the origin of this weird behavior. It dates from FreeBSD r60816, which imported NetBSD's r1.6 (from CVS), which fixed NetBSD PR 227. While your patch fixes the problem by@meetlost.com reported, it regresses the problem described by PR 227. So I don't think we can commit it as-is. http://cvsweb.netbsd.org/bsdweb.cgi/src/usr.bin/less/less/Attic/forwback.c.diff?r1=1.5&r2=1.6&only_with_tag=MAIN&f=h https://gnats.netbsd.org/cgi-bin/query-pr-single.pl?number=227 For reference, I'll restate a reproduction case for PR 227: 1) Size your terminal to 25 lines 2) jot 20 > ~/tmp/20lines.txt 3) jot 100 120 1 > /tmp/20lines.2.txt 4) more /tmp/20lines.* 5) At the prompt, press spacebar to display the second file. The first file should remain in the scrollback buffer. -Alan