Subject: bug#13675: Extremely slow redisplay when lines are very long

From: Eli Zaretskii <[email-masked]>
Date: Fri, 20 Oct 2017 19:10:32 +0300

> Date: Fri, 20 Oct 2017 08:50:19 -0700
> Cc: [email-masked]
> From: Mark Diekhans <[email-masked]>
> 
> I would be gladly work on a patch to ask a question or stop on
> files that might cripple emacs.
> 
> However, before one dives into work, it's important to know the
> history and if there is existing work one can help with as opposed
> to start fresh.  That leads to annoying questions like mine.
> 
> The meta issue is not a user wanting something for nothing.
> It's that it's a lot of work for someone who is not a core
> developer to come up to speed on an issue since the discussions
> are not linked to bug reports and the mailing lists are very
> hard to search.

I don't think you have anything to fear, because AFAIR this particular
approach was never suggested or discussed.

So I'd start with a feature that read the first N bytes from the file,
and if no newlines were found in those N bytes, pop up the warning and
the question.  A good place for this would be inside
insert-file-contents, which is where Emacs reads files into memory.

Let me know if I can help you further with making this happen.

Thanks.