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

From: Phil Sainty <[email-masked]>
Date: Sat, 21 Oct 2017 00:57:43 +1300

On 20/10/17 19:44, Eli Zaretskii wrote:
> What mode/kind of file needs font lock and has such long lines?

The common cases I would run into were with 'minified' files of
programming code, where as much whitespace as possible has been
removed to reduce the file size.

e.g. Things like https://code.jquery.com/jquery-git.min.js

That kind of file is not intended to be edited by hand, but so
far as Emacs is concerned it's just a regular javascript file,
and therefore font-lock and all the other modes which would be
enabled for editing javascript will be used.

> Patches for presenting a warning for such files, like we do with
> very large files, are welcome.

FWIW I wrote https://savannah.nongnu.org/projects/so-long which
tries to avoid performance issues in buffers with unexpectedly
long lines by automatically changing the major mode and disabling
various minor modes for that buffer (based on a pre-configured
list).

It can only address certain classes of problem, mind, and it
needs some more work (and has been waiting for me to get back
to it); but it more or less does what it's intended to do, so
others might find it useful as-is (I certainly use it myself).

See https://www.emacswiki.org/emacs/SoLong for more information.

-Phil