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#56393: Actually fix the long lines display bug Date: Sat, 09 Jul 2022 12:20:38 +0300 Message-ID: <83o7xy3amx.fsf@gnu.org> References: <38c1a31040d2d2bc47ae@heytings.org> <38c1a310405bd4bbe370@heytings.org> <87a69n98yy.fsf@yahoo.com> <38c1a31040f5546dbd3a@heytings.org> <87czej6buq.fsf@gnus.org> <38c1a31040e66d2b273e@heytings.org> <834jzt59jt.fsf@gnu.org> <831qux5806.fsf@gnu.org> <9C70BEF7-08EC-46A0-89D3-547417FA01F8@gmail.com> <83let43xg9.fsf@gnu.org> <83sfna3gzq.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="30082"; mail-complaints-to="usenet@ciao.gmane.io" Cc: gerd.moellmann@gmail.com, larsi@gnus.org, 56393@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sat Jul 09 11:21:11 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 1oA6eE-0007cC-Ll for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 11:21:10 +0200 Original-Received: from localhost ([::1]:41788 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA6eC-0006Eb-U4 for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 05:21:08 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:54426) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA6e6-0006ET-DB for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:21:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39850) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oA6e6-0005uU-4u for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oA6e6-0007X7-0K for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:21: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, 09 Jul 2022 09:21:01 +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.165735845128918 (code B ref 56393); Sat, 09 Jul 2022 09:21:01 +0000 Original-Received: (at 56393) by debbugs.gnu.org; 9 Jul 2022 09:20:51 +0000 Original-Received: from localhost ([127.0.0.1]:33747 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA6dv-0007WM-BS for submit@debbugs.gnu.org; Sat, 09 Jul 2022 05:20:51 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39920) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA6du-0007WA-BG for 56393@debbugs.gnu.org; Sat, 09 Jul 2022 05:20:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38640) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA6do-0005tS-Kw; Sat, 09 Jul 2022 05:20: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=RvUWXrWStmGD+CN81TMRlRV7tZaFi602KHdNJNYH20o=; b=OOA8Lr7bjVA6 0IH/GJU2EZdgcNZAIQ9BmAMJ80vk3YIa30zY3PCgkFP93pDeRDuLNkO6zqjEv9CD6pksYM/HLtyid BBeeUQuJclHTEfo34scWDrgkCBCVKN1W6kTkiWQhjpz32uzthBompk+TP2rvGv3S0j4IpMy2L5vKQ W3KilMfFnqmuamYE+wqaqi4csT/bArZNipymrFbNYICkATT7CjiUSEXoxKo7TGP1tCiVDdJ1xZ/aY 0AL6a03VLnPmJZZQ4iDrrshcQ7nY6WQWDNDln1yw/U44Uxg7T8iPmt1DNRNkiIRsavEh65PYL/LPx uG3WWB+7pCUB8mMePKXllQ==; Original-Received: from [87.69.77.57] (port=2325 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 1oA6do-0000jV-3o; Sat, 09 Jul 2022 05:20:44 -0400 In-Reply-To: (message from Gregory Heytings on Sat, 09 Jul 2022 08:56:16 +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" Xref: news.gmane.io gmane.emacs.bugs:236487 Archived-At: > Date: Sat, 09 Jul 2022 08:56:16 +0000 > From: Gregory Heytings > cc: gerd.moellmann@gmail.com, larsi@gnus.org, 56393@debbugs.gnu.org > > > . init_iterator is also called to display strings, and I'm not sure I > > understand what you intended to do in that case, since BEGV/ZV are not > > relevant to strings. > > I guess moving the calculation of the restriction into start_display > should fix that problem. Then it->narrowed_begv will be 0 for strings. OK. It wasn't celar to me what you intended to do, because find_automatic_composition can be also invoked on strings. > > . The WITH_NARROWED_BEGV macro is IMO awkward and not very convenient to > > use in C. For starters, it cannot accommodate multi-line code, except > > via the 'do { ... } while(0);' kludge, which I think will make the code > > less readable. It also should set up an unwind-protect handler, so that > > any non-local exit from the code will restore BEGV/ZV. So I think it > > will be better to have two separate functions (and a third one to > > unwind). > > > > Hmmm... I'll see what I can do. (But I don't understand why you write > that it cannot accomodate multi-line code: you can write > "WITH_NARROWED_BEGV (frobnicate (foo); frobnicate (bar));".) What if the multi-line code includes an if clause or a for loop with just one line in their bodies? > > . You currently only apply the "restriction" in a few places where the > > code calls functions like find_newline_no_quit. What about the rest of > > display code -- are you saying that it doesn't need to be "restricted"? > > or do you intend to add that in the future? > > Yes, that's what I'm saying. You asked me to make sure that the > restriction would have the least possible impact, which I did. If this is enough, then it's great. I'm just asking myself how come font-lock, for example, no longer slows things down as it did before? Do you understand why?