From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#38407: 27.0.50; infinite loop with display of large file without newlines Date: Fri, 06 Dec 2019 10:04:04 +0200 Message-ID: <83fthxhocr.fsf@gnu.org> References: <39c498717f8958e7fdc408d4da51d378@webmail.orcon.net.nz> <24031.28277.201123.531348@cochabamba.vanoostrum.org> <83r21sowx1.fsf@gnu.org> <24032.4698.256238.87458@cochabamba.vanoostrum.org> <83k17jq1ch.fsf@gnu.org> <24032.17845.921546.629745@cochabamba.vanoostrum.org> <83fti7p349.fsf@gnu.org> <4B1ABCA7-A69C-4251-8EBD-A11654A92642@vanoostrum.org> <83v9r2o4z9.fsf@gnu.org> <24035.27244.755074.180653@cochabamba.vanoostrum.org> <83lfrwlz2w.fsf@gnu.org> <83o8wpjsx5.fsf@gnu.org> <83zhg8hz6j.fsf@gnu.org> <83fthyizpq.fsf@gnu.org> <002bd5c4-a9c1-4bda-6005-a98a6118d94b@orcon.net.nz> Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="151620"; mail-complaints-to="usenet@blaine.gmane.org" Cc: rpluim@gmail.com, pieter@vanoostrum.org, 38407@debbugs.gnu.org To: Phil Sainty Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Fri Dec 06 19:07:31 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1idI0p-000dJV-1E for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 19:07:31 +0100 Original-Received: from localhost ([::1]:42964 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idI0n-0005qd-AY for geb-bug-gnu-emacs@m.gmane.org; Fri, 06 Dec 2019 13:07:29 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:51552) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1idGK3-0005x3-Qo for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:17 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1idGK1-0003ES-Fq for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:15 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:40972) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1idGK1-000358-B9 for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:19:13 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1idGGx-00054M-Fc for bug-gnu-emacs@gnu.org; Fri, 06 Dec 2019 11:16:03 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 06 Dec 2019 16:16:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 38407 X-GNU-PR-Package: emacs Original-Received: via spool by 38407-submit@debbugs.gnu.org id=B38407.157564894219364 (code B ref 38407); Fri, 06 Dec 2019 16:16:03 +0000 Original-Received: (at 38407) by debbugs.gnu.org; 6 Dec 2019 16:15:42 +0000 Original-Received: from localhost ([127.0.0.1]:46925 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGc-000525-9g for submit@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:42 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:56999) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1idGGa-00050u-22 for 38407@debbugs.gnu.org; Fri, 06 Dec 2019 11:15:40 -0500 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:43175) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1idGGN-0001JP-Bi; Fri, 06 Dec 2019 11:15:27 -0500 Original-Received: from [176.228.60.248] (port=1919 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1id8ar-0002wR-Go; Fri, 06 Dec 2019 03:04:05 -0500 In-reply-to: <002bd5c4-a9c1-4bda-6005-a98a6118d94b@orcon.net.nz> (message from Phil Sainty on Fri, 6 Dec 2019 09:38:05 +1300) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:172975 Archived-At: > Cc: pieter@vanoostrum.org, 38407@debbugs.gnu.org > From: Phil Sainty > Date: Fri, 6 Dec 2019 09:38:05 +1300 > > That 250 value is, as you note, incredibly small. It is okay for a feature that is off by default. I'm saying that turning this on by default with such a low threshold would be wrong. > As with many things in so-long it's something of a heuristic and > trade-off. The reasoning was that not all files with extremely long > lines are just one line -- newline chars may still occur in the text > for reasons other than the formatting of the file -- and so the > question was: "given the context of a buffer in some prog-mode > derivative, what length is "long enough" to indicate that we're not > looking at a normal file, but something which probably contains > minified code? Did you try a different heuristic for detecting long lines, one that isn't based on searching some portion of the buffer? E.g., what about going to a couple of random places and looking at the value returned by current-column? In general, searching for a newline is very fast in Emacs, so if you use the right primitives, you should be able to scan quite a lot of text before the time begins affecting responsiveness.