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: Tue, 05 Jul 2022 17:14:56 +0300 Message-ID: <835ykb8x3z.fsf@gnu.org> References: <38c1a31040d2d2bc47ae@heytings.org> <38c1a310405bd4bbe370@heytings.org> <87a69n98yy.fsf@yahoo.com> <38c1a31040f5546dbd3a@heytings.org> <83a69n90t8.fsf@gnu.org> <38c1a31040ad21b41adc@heytings.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="16729"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 56393@debbugs.gnu.org To: Gregory Heytings Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jul 05 16:16:27 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 1o8jLm-00044X-0Y for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 16:16:26 +0200 Original-Received: from localhost ([::1]:40940 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1o8jLj-0005VA-63 for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Jul 2022 10:16:23 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:56826) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8jLO-0005U5-GV for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:16:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57291) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1o8jLO-0002Hx-6R for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:16:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1o8jLO-0006Tg-02 for bug-gnu-emacs@gnu.org; Tue, 05 Jul 2022 10:16: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: Tue, 05 Jul 2022 14:16: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.165703052624851 (code B ref 56393); Tue, 05 Jul 2022 14:16:01 +0000 Original-Received: (at 56393) by debbugs.gnu.org; 5 Jul 2022 14:15:26 +0000 Original-Received: from localhost ([127.0.0.1]:51187 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jKn-0006Sk-W1 for submit@debbugs.gnu.org; Tue, 05 Jul 2022 10:15:26 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:43448) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1o8jKj-0006SU-7L for 56393@debbugs.gnu.org; Tue, 05 Jul 2022 10:15:24 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:54400) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1o8jKd-00027X-HT; Tue, 05 Jul 2022 10:15:15 -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=mlvHca1xzUMDKO3HIofpEkuUWVYrO9l26110PKgpsIE=; b=ZWfpXPAmwPT8 +b6Wrkr3ogYhD5eUuSyQd+ZEPfHIDF2/CSxtFJ/JKEwCqA0ArcJlERR4ZkTZdU4MeroN/twNgswlt eZ/hHOlNQzayjOaZRmieLbrxViXu1b9dLsvLgkdN7xB4wqOt2EGCocJHdS9XTwCv0OLYDhDgvoOw+ tx3SdX7J3HctVnFdZs5o2HBHmqDZSEUpli0JXPQSgTSs0B+ovDJJHtkPH24AX4zILobOT+LuwvqlT rPGAptZGcpfu85bh5kPWpcA3Wic1tZWxLhjPh6kt0Fm6amysMJbznQvQX6Rrmk1MbW/z94TW6vLV+ y7Pd77CePZhWO4haqu9KaA==; Original-Received: from [87.69.77.57] (port=1531 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 1o8jKT-0001ll-HX; Tue, 05 Jul 2022 10:15:14 -0400 In-Reply-To: <38c1a31040ad21b41adc@heytings.org> (message from Gregory Heytings on Tue, 05 Jul 2022 13:53:36 +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:236119 Archived-At: > Date: Tue, 05 Jul 2022 13:53:36 +0000 > From: Gregory Heytings > cc: 56393@debbugs.gnu.org > > >> -** 'longlines-mode' is no longer obsolete. > > > > Likewise here. > > > > This mode was unobsoleted a few days ago, because the conclusion was that > there was no better mechanism available to cope with large files. Now > there is. Well, the cursor motion problems I mentioned? longlines doesn't have them. > > This will invoke auto-narrow-mode for any file that is for some reason > > inserted by Emacs into some buffer. Many Emacs commands insert files > > into temporary buffers or buffers that are never meant for display, and > > AFAIU the above will narrow such a buffer if a file inserted happens to > > have long lines, is that correct? > > It might, everything is possible with software. Let's see if it happens > in practice and take the appropriate measure if it happens. I did try this, and it does happen. Here: (with-temp-buffer (insert-file-contents "long-line.xml") (point-max)) (where long-line.xml is the file whose URL I've shown in my message). This gives me 30001, whereas the correct value is 306666. > And the cure for these potential cases is easy: (let > ((auto-narrow-long-line-threshold nil)) ...) Where do you suggest doing this? > > I don't quite see clearly what these general issues could mean, but they > > are at least worrisome, I think, because they could potentially mean > > significant breakage in many places. > > > > Again, let's see if it happens in practice and take the appropriate > measure if it actually happens. See above. I think it will happen quite a lot in the wild. > > Also for commands written by users: for example, if someone writes a > > command that is a trivial wrapper around goto-line, that command will no > > longer automatically widen as goto-line does, right? > > Indeed, that's the purpose of the auto-narrow-widen-automatically > defcustom: users can easily add their own commands to that list. That means the list will be very long and users will have to constantly update it. E.g., whenever they install a new package or even a new version of a package. > > Alternatively, maybe you will explain that I'm bothered by a > > non-existent problem? > > What I think is that you are bothered with a potential problem which is > far less important than seeing Emacs becoming unresponsive. I'm not sure. A broken command might be important, especially if this feature is going to be on by default. > > Since the narrowing is basically in effect only during redisplay, it > > doesn't help with commands that use display code outside of redisplay > > proper. For example, C-n, C-v, C-l, and other commands are still > > extremely sluggish in files with long lines. E.g., try the file > > long-line.xml mentioned here: > > > > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=45898#80 > > Did you actually try the patch? Yes. > > Also, the automatic restriction is very visible and causes surprising > > effects: (point-min) and (point-max) evaluate to the narrowed region (so > > it's basically very hard to know the real size of the buffer), and > > scrolling through the buffer causes the scroll-bar thumb move in a > > non-monotonic manner: I scroll towards the end of the buffer, but the > > thumb sometimes jumps back up, as if I moved towards the beginning. > > Indeed. Users will see the "Auto-Narrow" indication in the modeline with > which they can easily find an explanation for that behavior. If this > behavior is problematic, it could be fixed by using the dimensions of the > whole buffer when updating the scroll bar (and perhaps also the modeline), > when auto-narrow-mode is active. I think it should be fixed, yes.