From: Phil Sainty <psainty@orcon.net.nz>
To: Eli Zaretskii <eliz@gnu.org>, Robert Pluim <rpluim@gmail.com>
Cc: pieter@vanoostrum.org, 38407@debbugs.gnu.org
Subject: bug#38407: 27.0.50; infinite loop with display of large file without newlines
Date: Fri, 6 Dec 2019 09:38:05 +1300 [thread overview]
Message-ID: <002bd5c4-a9c1-4bda-6005-a98a6118d94b@orcon.net.nz> (raw)
In-Reply-To: <83fthyizpq.fsf@gnu.org>
On 6/12/19 4:01 AM, Eli Zaretskii wrote:
> If we want [so-long] to be enabled by default, it "needs work", IMO.
> For starters, the default line length beyond which it kicks in, 250
> characters, is waaay too low. IME, problems start with much longer
> lines, perhaps more than 10000 characters.
Agreed. There is a whole discussion pending (I intended to raise it
soon), asking people to test the library more widely, and to help to
figure out what the default settings should actually be. The current
settings are almost entirely based on modes and features I have tried
personally, after all.
That 250 value is, as you note, incredibly small. 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?
In conjunction is the "how many lines do we test" variable. It would
be nice to arrive at a decision without doing a lot of work, so we
don't want to inspect a really large number of lines; but we also
don't necessarily want to *require* that we've seen a line which will
definitely cause problems -- a shorter line which strongly suggests
that we're looking at minified code/data may be sufficient.
With the current conservative (*very* conservative) values we very
quickly reach a decision, but we're more likely to trigger in false-
positive situations (this has happened to me, but only very rarely;
and by default `so-long-revert' is a C-c C-c away). With larger
values we may more effort to reach a decision. With *much* larger
values, that extra effort might be noticeable (on slower systems
even if not on faster ones), so I think we want to be a bit careful
of that.
(Not that I've been testing large values for performance -- I've been
leaving that for the later discussion, and in the meantime I've been
content to have the small default values, in part because it seemed
more likely that people would discover potential problems with the
library if it was a bit more trigger-happy.)
As with most things in so-long, there's no single right solution;
but I'm keen to arrive at a set of defaults that people can agree
are a reasonable starting point for most users; and I'm certainly
not suggesting that I've done that already ("what should the default
settings be?" has been an open question from the outset, really.)
-Phil
next prev parent reply other threads:[~2019-12-05 20:38 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-27 21:52 bug#38407: 27.0.50; infinite loop with display of large file without newlines Pieter van Oostrum
2019-11-27 23:38 ` Phil Sainty
2019-11-28 0:30 ` Phil Sainty
2019-11-28 1:22 ` Phil Sainty
2019-11-28 6:51 ` Pieter van Oostrum
2019-11-28 15:14 ` Eli Zaretskii
2019-11-28 18:30 ` Pieter van Oostrum
2019-11-28 18:53 ` Eli Zaretskii
2019-11-28 22:09 ` Pieter van Oostrum
2019-11-29 7:12 ` Eli Zaretskii
2019-11-29 11:48 ` Phil Sainty
2019-11-29 13:20 ` Eli Zaretskii
2019-11-29 13:48 ` Dmitry Gutov
2019-11-29 14:26 ` Eli Zaretskii
2019-11-29 14:31 ` Dmitry Gutov
2019-11-29 15:03 ` Eli Zaretskii
2019-11-29 16:53 ` Dmitry Gutov
2019-11-29 19:28 ` Eli Zaretskii
2019-11-29 17:24 ` Pieter van Oostrum
2019-11-29 19:30 ` Eli Zaretskii
2019-11-30 8:25 ` Pieter van Oostrum
2019-12-01 7:23 ` Pieter van Oostrum
2019-12-01 10:37 ` Phil Sainty
2019-12-01 16:35 ` Pieter van Oostrum
2019-12-01 18:40 ` Pieter van Oostrum
2019-12-02 16:23 ` Eli Zaretskii
2019-12-01 17:45 ` Eli Zaretskii
2019-12-02 10:27 ` Robert Pluim
2019-12-03 11:20 ` Robert Pluim
2019-12-03 16:05 ` Eli Zaretskii
2019-12-04 9:15 ` Robert Pluim
2019-12-04 15:45 ` Eli Zaretskii
2019-12-05 7:27 ` Robert Pluim
2019-12-05 15:01 ` Eli Zaretskii
2019-12-05 20:38 ` Phil Sainty [this message]
2019-12-06 8:04 ` Eli Zaretskii
2019-12-07 1:28 ` Phil Sainty
2019-12-07 7:56 ` Eli Zaretskii
2019-11-28 15:06 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=002bd5c4-a9c1-4bda-6005-a98a6118d94b@orcon.net.nz \
--to=psainty@orcon.net.nz \
--cc=38407@debbugs.gnu.org \
--cc=eliz@gnu.org \
--cc=pieter@vanoostrum.org \
--cc=rpluim@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).