I was just starting to do an exercise on a programming practice
website, and happened to paste some example data from the site
in to my Emacs buffer, without thinking anything of it.

It happened to be over 2000 characters on one line and Emacs froze
for a while.  Fortunately, it wasn't much more, or the freeze
would have been even longer.

Somehow, I think we have to find a solution that works when
any long line has to be displayed in a buffer, not just when
we open a file.

By the way, I tried adding the longlines.el workaround function to my
compilation-mode-hook and running a program that printed 10000
characters on a single line to the compilation-mode buffer, and
the longlines.el workaround did not help.  Emacs still froze.