Subject: bug#39658: 26.3; can't edit file with terminal escape sequences

From: Phil Sainty <[email-masked]>
Date: Sun, 23 Feb 2020 17:42:32 +1300

On 19/02/20 2:58 am, Robert Pluim wrote:
> The problem is more likely to be the extremely long lines in the
> file. If you have emacs-27 or emacs-master, you can try 'M-x
> global-so-long-mode' before visiting the file, which attempts to
> improve Emacs' behaviour in such cases.

On 21/02/20 3:26 am, Robert Pluim wrote:
> 19 feb. 2020 kl. 18.47 skrev Eli Zaretskii:
> > Ah, yes.  Set bidi-inhibit-bpa non-nil, and Bob's your uncle.
> 
> Doesn't so-long-mode turn off bpa?

Yes it does and so that does provide a solution -- provided that
the original major mode used for the file is one that so-long is
interested in.  The example file here had no file name extension,
nor any magic-mode-alist content, and consequently the default
list of so-long-target-modes was never going to match this.

Perhaps fundamental-mode should be in so-long-target-modes?

Experimentally, that does do the trick in this example; and would
surely cover other similar cases as well.

The big question is whether that might cause more problems than
it solves.  Offhand I think it's probably ok: as far as the major
mode aspects are concerned, so-long-mode is little more than
fundamental-mode, so any file which opened in fundamental-mode
ought to be fine in so-long-mode as well.

I suspect we would also want that large increase to the default
value of so-long-threshold which has previously been discussed,
just on account of the number of different kinds of file which
might now be subject to this, as the heuristic of "programming
code lines are expected to be pretty short" would no longer be
adequate.  I was intending to go ahead with that change in any
case, and IIRC a value of 10,000 seemed to be quite reasonable
in my initial tests.  I was going to do more testing, and still
haven't gotten around to it.

-Phil