From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#56682: feature/improved-locked-narrowing 9dee6df39c: Reworked locked narrowing. Date: Sat, 01 Apr 2023 14:11:59 +0300 Message-ID: <83edp3zwjk.fsf@gnu.org> References: <166939872890.18950.12581667269687468681@vcs2.savannah.gnu.org> <6943e04e30a40824e107@heytings.org> <83k0143q37.fsf@gnu.org> <94821a0ef100102ac9e0@heytings.org> <83bkmdz04y.fsf@gnu.org> <43562d4dd9dffd81938f@heytings.org> <83357ozhx0.fsf@gnu.org> <83wn4zurit.fsf@gnu.org> <83bkmaueib.fsf@gnu.org> <83357fnwyy.fsf@gnu.org> <83ttzsk6v4.fsf@gnu.org> <83wn4le8s3.fsf@gnu.org> <0f053182b02103503c26@heytings.org> <83pmaccnz7.fsf@gnu.org> <0f053182b04357300cb1@heytings.org> <83lel0chku.fsf@gnu.org> <0f053182b00a59a41caa@heytings.org> <835yc3cdhk.fsf@gnu.org> <9e9ed8043fc8bfe49bfe@heytings.org> <83h6vnaukn.fsf@gnu.org> <9e9ed8043f4ff9316461@heytings.org> <83k00exj56.fsf@gnu.org> <10ececa33f0a4af46fd2@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8075"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Apr 01 13:12:27 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1piZ9m-0001st-7l for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 01 Apr 2023 13:12:26 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1piZ9R-0003Zd-GI; Sat, 01 Apr 2023 07:12:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piZ9O-0003ZN-Lc for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 07:12:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1piZ9O-0001Vd-DP for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 07:12:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1piZ9O-0003QA-5H for bug-gnu-emacs@gnu.org; Sat, 01 Apr 2023 07:12:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 01 Apr 2023 11:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56682 X-GNU-PR-Package: emacs Original-Received: via spool by 56682-submit@debbugs.gnu.org id=B56682.168034751513122 (code B ref 56682); Sat, 01 Apr 2023 11:12:02 +0000 Original-Received: (at 56682) by debbugs.gnu.org; 1 Apr 2023 11:11:55 +0000 Original-Received: from localhost ([127.0.0.1]:35597 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piZ9G-0003Pa-Og for submit@debbugs.gnu.org; Sat, 01 Apr 2023 07:11:55 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:52686) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1piZ9D-0003PK-Nk for 56682@debbugs.gnu.org; Sat, 01 Apr 2023 07:11:53 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piZ96-0001UZ-9o; Sat, 01 Apr 2023 07:11:44 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=cmn3z6akts4r/rkut5Qr8pKT9STVb8Mo0qPVf8oRCqY=; b=ViJ1e0n6icvi ofVo1kRDnWvKjEvHdRoHE9VeI4EwPzV7TmVxT8EefoaD2jl7x1y7YjUFLrwmeS/urvaqjtsXL/PQW lY/e+hYoVHmI0He+APIKG+yIhltboQyq7f+VHUmuoNBLvyUJYso033vHBalzyZsHO8xgrx1KMy7WO x8gGBAxQDIyRmkqure3J5Tcz0YKvbzg1CNuzRuC3xip07erg+S0pRYpFZQV5sB7mDdklzrOPAkptQ l3cUnTW9zWLAO59EmbU0sd3fr2AsYkfXy94lQ+uA7yrTcodAPqVKWpKt3eQnKMOjAFaIU1rViKpWQ RQ1qDX5JNbhc/St8DtC6Pg==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1piZ95-0007Fu-Ob; Sat, 01 Apr 2023 07:11:44 -0400 In-Reply-To: <10ececa33f0a4af46fd2@heytings.org> (message from Gregory Heytings on Wed, 29 Mar 2023 14:52:08 +0000) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:259044 Archived-At: > Date: Wed, 29 Mar 2023 14:52:08 +0000 > From: Gregory Heytings > cc: 56682@debbugs.gnu.org, monnier@iro.umontreal.ca > > > > > > I finally had enough free time to do that. You will find the result in > > the scratch/long-lines-cleanup branch. I contains the following four > > commits, in that order: > > > > 1. 85ed1c9ca6 with the renamings and documentation improvements > > > > 2. 7e26a5c774 with the patch mentioned above > > > > 3. afc2c6c13c with a bug fix, which makes cursor motion commands much > > more accurate in long lines > > > > 4. 974e4f3333 with a minor cleanup > > > > I just pushed a fifth commit (2093e010dc) to fix character motion commands > in terminals. Thanks. I took a look, and these commits do more than just renaming. They also change the code in non-trivial ways, and I'm not thrilled about changing code in those parts at this late stage. Specific comments: afc2c6c13c: . Misses an optimization opportunity: where pos == BEGV, you can use BEGV_BYTE instead of calling CHAR_TO_BYTE. . I'm not sure I'm happy about calling find_newline in a loop where previous code just made a trivial calculation. Imagine a buffer with a lot of short lines. What problem exactly is being solved here, and how does this change solve it? 2093e010dc: . Why such a strange method of finding out whether we are on a TTY frame? The usual method is FRAME_WINDOW_P (XFRAME (w->frame)). . The continuation glyph can be present not only on TTY frames, but also on GUI frames when one or both of the fringes are disabled, so the test needs to be augmented. I think you need to use WINDOW_LEFT_FRINGE_WIDTH and WINDOW_RIGHT_FRINGE_WIDTH.