From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Gregory Heytings Newsgroups: gmane.emacs.bugs Subject: bug#56393: Actually fix the long lines display bug Date: Tue, 19 Jul 2022 12:49:33 +0000 Message-ID: References: <38c1a31040d2d2bc47ae@heytings.org> <83sfna3gzq.fsf@gnu.org> <83fsja36an.fsf@gnu.org> <34362AA6-6404-4727-9C60-6B6CA6736DD4@gnus.org> <83v8rvpxx7.fsf@gnu.org> <209e6aa436f84e1f729a@heytings.org> <83sfmzpw4e.fsf@gnu.org> <83h73epq7v.fsf@gnu.org> <83cze2pmtk.fsf@gnu.org> <838roqpkjs.fsf@gnu.org> <831quipdt2.fsf@gnu.org> <83r12intar.fsf@gnu.org> <83lespomnu.fsf@gnu.org> <83fsixnwh3.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; format=flowed; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21025"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, larsi@gnus.org, 56393@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 19 14:50:31 2022 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 1oDmgB-0004x7-D2 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 14:50:23 +0200 Original-Received: from localhost ([::1]:56268 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oDmgA-0007lr-61 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 19 Jul 2022 08:50:22 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:60464) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oDmfr-0007h2-7X for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 08:50:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:55331) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oDmfq-00083G-RG for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 08:50:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oDmfq-0005P4-Ig for bug-gnu-emacs@gnu.org; Tue, 19 Jul 2022 08:50:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Gregory Heytings Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 19 Jul 2022 12:50:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 56393 X-GNU-PR-Package: emacs Original-Received: via spool by 56393-submit@debbugs.gnu.org id=B56393.165823498320741 (code B ref 56393); Tue, 19 Jul 2022 12:50:02 +0000 Original-Received: (at 56393) by debbugs.gnu.org; 19 Jul 2022 12:49:43 +0000 Original-Received: from localhost ([127.0.0.1]:53090 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDmfW-0005OT-Nw for submit@debbugs.gnu.org; Tue, 19 Jul 2022 08:49:43 -0400 Original-Received: from heytings.org ([95.142.160.155]:43930) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oDmfP-0005OF-Bl for 56393@debbugs.gnu.org; Tue, 19 Jul 2022 08:49:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heytings.org; s=20220101; t=1658234974; bh=VKec8UC93UFNzvgfgkuqbQlu8eKJajDZwwsxWvhxwDA=; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:From; b=NIPGwaAohjYTarTOzWuSbIMdjn7Qm6U4BxxWG5A0jgAMqI50eANN+3tfMVuROitVT msT1v2DVzucYfIXgdWtwUtTe/LNictWbgF+CbywsuDJPgfPxstZf/ByEI7DfB7UHhV gRIxXZ71YNV0VrW4Z4pEGWR+2Lu0pWM69Kn8EUC/bbSJYj5i2eeC5pAF6Tirb3fyI9 9rh6J0LYwNNWIlGxGyzdVjcmftstQBRIv0PUmSaulEk9UQTqlMekzpxUjIWK9k9D0E F5totfIty/NvRJMKphNc3afy8fmKIgeeWnOW6vns59e4xvN8xloDWLAOgVYeNh3uUm 6jqkKa9jnSGcg== In-Reply-To: <83fsixnwh3.fsf@gnu.org> 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" Xref: news.gmane.io gmane.emacs.bugs:237430 Archived-At: >> And it's inconvenient that you have to keep a copy of its previous >> value around, using MODIFF != UNCHANGED_MODIFIED as I did earlier is >> much easier. > > We could indeed keep using MODIFF != UNCHANGED_MODIFIED (and I'm not > really sure why you decided it was not good enough: can you describe the > problems using it?). > The problem is that the loop under that condition is called whenever redisplay_window is called. For a file like xdisp.c or dictionary.json, that loop takes about 1 ms (on my laptop). For a file with 150K lines, it takes about 13 ms. As I said earlier, I would prefer to avoid calling that loop for normal typing, namely when only one character has been added or removed from the buffer since the last redisplay. IOW, I want to make the heuristic more precise. > > Alternatively, we could add a new member of 'struct buffer_text' called, > say, unchanged_chars_modiff, and use it instead of MODIFF != > UNCHANGED_MODIFIED in the same way as we use MODIFF != > UNCHANGED_MODIFIED. > > My point is that if you want the member you added, unchanged_size, to be > as responsive to text changes as BUF_CHARS_MODIFF, you will need to add > code to increment it in all the places where we already do that with > BUF_CHARS_MODIFF, and that sounds like redundancy, since we don't really > care about how many characters were added/deleted/replaced. > AFAIU that's not correct: like unchanged_modified, unchanged_size must be updated only when redisplay ends, namely in mark_window_display_accurate_1.