Subject: bug#56393: Actually fix the long lines display bug

From: Gregory Heytings <[email-masked]>
Date: Tue, 05 Jul 2022 23:10:12 +0000

Okay, I've now pushed an improved version of the patch to the 
feature/fix-the-long-lines-display-bug branch.

A few additional comments:

Auto-narrow mode is now entered only when the buffer is actually 
displayed, which solves the problem of (with-temp-buffer 
(insert-file-contents ...) ...) and friends.

The scroll bar and modeline now display information relative to the whole 
buffer.

Instead of the command list in auto-narrow-widen-automatically, a symbol 
property could also be used, which would perhaps be easier to manage for 
users and package maintainers.  That being said, in most cases buffers 
with very long lines will typically be opened literally, so advanced 
editing commands will not be available anyway.

The auto-narrow-pre-command-function and auto-narrow-post-command-function 
could perhaps be moved before pre-command-hook and after 
post-command-hook, but even if that were the case the buffer that 
functions in pre-command-hook and post-command-hook would see would still 
be, in most cases, the narrowed one.

I think it might make sense to automatically disable font-lock-mode when 
auto-narrow is entered, as it seems to be the cause of the remaining 
display slowdowns, and it is not an essential editing feature.