From owner-freebsd-current@freebsd.org Tue Dec 12 17:26: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 353B0E9FBD1 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 6BD9966ED9 for ; Tue, 12 Dec 2017 17:26:12 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-lf0-x244.google.com with SMTP id e137so24056166lfg.5 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=ivnxDIb0KvPok8UQ87ad5w8OwgarUADE0ae7afdo7Vw=; b=kgxbY5ySwzJQvV4B6PovWfcdGsHzLSWQDcpNSD51cg6aktL1D04drT/goqEZxhG9XE n26IYCfCrafe6Bj0MttTK66m7i+g63JtWYuA65qYS0KqaeKoZHqz3x41F5FstsJHkI2Z SilfgK6OHE+WWT5WQQDiRbz5ja2SSgzQVE9i+E8bWNxLNSHmZl16+q4pAe++qVeokuen PtIBxTNQ9OTOGF7zIbuDRM2elct+m+3o6MYZx3xQImO+c8v+T6nPI+IO9sioWC3nPor2 xpjgCGY334yrHCeOg9bKu3LxJPmzOYZgnC+mDFdsZ/IGHsSQknAoGm+rnpZl09/uFGdv w31w== 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=ivnxDIb0KvPok8UQ87ad5w8OwgarUADE0ae7afdo7Vw=; b=QejYYieF9Utu5eCMA3vekB+IgfH0U3bPn01MuKLwDJe+/hl63bUShJXrnBauDe7eD+ ZAO4ymtC4jNadtFo9Q8/qv5bRUgSazmfRTodQGEId4VqeuVP2v1JlZZTEQ8w5fGf0T4G IQrB9w9V/YG6Co4SP4+lUQcejoVRIzNmcayATlqWlHIf2sJckKk+HLexA2Op6Jex7p26 90URhxxfHwK6H4roJH9ZAc6hC/2i2VjySAA9tjOl/XSNxhE3AzRN4X9eSGrdDdFDATm0 IRv6Zjm/iHT+tPjfrbkBRe5DLtFhPpR2ygjPRyp6PI/FAmqjSSm7/EVjGJTH+tgYYndt Cc0A== X-Gm-Message-State: AKGB3mKCS1KYZcywMejYuFQhBAQN5xRoayA5oEEmO42r1vRG2CC5u2Ly 0MvVJIWF3DUki7y96j5pbJWX+VubkrbYPFJyjvBI3A== X-Received: by 10.46.84.86 with SMTP id y22mt2765681ljd.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-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: 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