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:13:35 +0300 Message-ID: <83pmie3ayo.fsf@gnu.org> References: <38c1a31040d2d2bc47ae@heytings.org> <38c1a310405bd4bbe370@heytings.org> <87a69n98yy.fsf@yahoo.com> <38c1a31040f5546dbd3a@heytings.org> <83a69n90t8.fsf@gnu.org> <38c1a31040ad21b41adc@heytings.org> <835ykb8x3z.fsf@gnu.org> <38c1a310403dbabc7270@heytings.org> <834jzv8sv4.fsf@gnu.org> <38c1a31040ba2976eb4d@heytings.org> <83y1x77c2w.fsf@gnu.org> <87k08rkvgb.fsf@gnus.org> <38c1a31040e94458bd3d@heytings.org> <83o7y277b8.fsf@gnu.org> <762d224809bcab0d6bbc@heytings.org> <83fsje74pz.fsf@gnu.org> <762d224809bc038d2030@heytings.org> <838rp672p7.fsf@gnu.org> <762d224809114fbaf4af@heytings.org> <834jzu6wnu.fsf@gnu.org> <762d224809c7a439895e@heytings.org> <83wncq5dvu.fsf@gnu.org> <3ffab1919622ce555e12@heytings.org> <83ilo95uz8.fsf@gnu.org> <3ffab19196bc0451adb6@heytings.org> <83edyx5j2u.fsf@gnu.org> <83tu7q3iz5.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="37911"; 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:14:17 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 1oA6XY-0009hZ-Lg for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 11:14:16 +0200 Original-Received: from localhost ([::1]:38824 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oA6XX-0003s5-6O for geb-bug-gnu-emacs@m.gmane-mx.org; Sat, 09 Jul 2022 05:14:15 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:53512) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA6XL-0003q1-01 for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:14:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:39844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oA6XK-0004nO-NY for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:14:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oA6XK-0007Lj-HA for bug-gnu-emacs@gnu.org; Sat, 09 Jul 2022 05:14: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:14: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.165735803328225 (code B ref 56393); Sat, 09 Jul 2022 09:14:02 +0000 Original-Received: (at 56393) by debbugs.gnu.org; 9 Jul 2022 09:13:53 +0000 Original-Received: from localhost ([127.0.0.1]:33741 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA6XB-0007LA-HK for submit@debbugs.gnu.org; Sat, 09 Jul 2022 05:13:53 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:39004) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oA6XA-0007Ky-1N for 56393@debbugs.gnu.org; Sat, 09 Jul 2022 05:13:52 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:38596) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oA6X4-0004lb-FD; Sat, 09 Jul 2022 05:13:46 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=SoTgVwryucJs/CGAu67bLyEA7ExZCS1UdaSKRCPUmbA=; b=Bxg/IGu0rluFqzfIqj0F FiyEk37cWqbFcAv5PiiNvS1TOlogiA7B8VNutjAXNEvdM885DPBaq9suoH7dGi074tyHh6LjmKviI N0Sg5YiQT2VP4eb94/8gnLWLd+9FDUCa0uh9NNjzRPvHclOnnrIuUdzEdWODWsOrbGPULzgF+X7s3 Els7HLbhB2phz++sSvSVkjoZ+R4KAurV4hPguPuTdQ5X8Gzhiv4g49xlXeMbTveGd3av5OIWGEKT6 WO2QKpWOkyZnUVel6EDXo3F1xg9CXlUWml0NT0HcM2bAN5sHc1CuAuULPT12MgSlAGW1K27XKQgoP YLiWKNdFMbIpgQ==; Original-Received: from [87.69.77.57] (port=1899 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 1oA6Wz-0000Wk-L1; Sat, 09 Jul 2022 05:13:45 -0400 In-Reply-To: (message from Gregory Heytings on Sat, 09 Jul 2022 08:24:38 +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:236486 Archived-At: > Date: Sat, 09 Jul 2022 08:24:38 +0000 > From: Gregory Heytings > cc: larsi@gnus.org, Gerd Möllmann , > 56393@debbugs.gnu.org > > I see that you decided to produce the "restriction" in init_iterator, > > which would, of course, work, but IMO it has a disadvantage: > > init_iterator is called a lot, so computing the "restriction" in it > > should be very fast. Your current implementation _is_ fast, but AFAIU > > its result is that we _always_ restrict the display code from seeing the > > entire buffer, even if there are no long lines in it, which I think is > > unnecessary. The original implementation only did that when it detected > > a long line, and I think we should keep it that way, because the > > "restriction" will inevitably have some negative effects, however minor, > > on what we display. > > I don't think we can detect long lines reliably enough. The problem of > the original implementation is what Gerd mentioned: "What happens when > evaluating an expression in *scratch* that returns a really large result? That problem doesn't exist when you run the detection code at the beginning of redisplay (either in redisplay_window or in start_display or in init_iterator), because by the time redisplay runs the buffer text was already updated by the insertion that is the result of the evaluation. > Or maybe in a Shell buffer some large output?" and similar cases, like > inserting the result of a shell command in the buffer. Detecting long > lines in insert-file-contents is not enough to make sure that Emacs will > always continue to behave normally when a long line is on display. I agree, but doing this in insert-file-contents was not what I had in mind. > Note that we the current implementation does not always restrict display > code from seeing the entire buffer, it does so in a few well-chosen > places, everywhere else the display code sees the entire buffer. And this is enough to make Emacs responsive? If yes, that's great.