Subject: Re: bug#38407: 27.0.50; infinite loop with display of large file without newlines

From: Eli Zaretskii <[email-masked]>
Date: Thu, 28 Nov 2019 17:14:34 +0200

> Date: Thu, 28 Nov 2019 07:51:33 +0100
> From: Pieter van Oostrum <[email-masked]>
> Cc: [email-masked]
> 
> Normally I wouldn't open such a bizarre file, but I was doing an 'rgrep' on my home directory, and this was one of the files that came up in the grep results. When I was scrolling though the *grep* buffer, I got this problem. Then I decided to just open the file, to eliminate the possibility that grep-mode was one of the causes.
> 
> And yes, I checked it all with emacs -Q.

As an aside, using Text mode for such files, and visual-line-mode on
top of that, is exactly the opposite of what one should do to make
redisplay performance better.  Text mode resets
bidi-paragraph-direction to nil, which makes redisplay work harder
because it needs to find the beginning of the current paragraph each
time redisplay starts.  And visual-line-mode makes redisplay a bit
slower, because of the need to find a suitable point to break the
line.

So I suggest to use the default mode for visiting JSON files.