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

From: Gregory Heytings <[email-masked]>
Date: Wed, 06 Jul 2022 13:45:27 +0000

Hi Phil,

Thanks for your detailed feedback.

>
> I can cause it to glitch by visiting a large file and leaning on the 
> page down key.  After a little while it fails to widen, and I'm left in 
> some narrowed portion of the buffer until I use a command which 
> re-triggers it.
>

That probably means you have a very big frame, you should set 
auto-narrow-display-length to a larger value than its default one (30000).

>
> I see an explicit list of supported commands in the code though, and I 
> worry about that.  Surely(?) we can't insist that all commands (if not 
> functions generally?) which need to deal with the full buffer (including 
> all the custom code out there in users' configs) should be updated to 
> make them explicitly aware of this new mode?  That doesn't seem 
> maintainable to me, and I can only imagine it causing lots of problems.
>

This new mode isn't necessary for ordinary files, so it will be activated 
only rarely.  That already means that it cannot cause "lots of problems". 
I think it's okay if it "breaks" a few commands, especially if the fix is 
only to add these commands to a list or to put a property on them.

>
> So-long is conservative in when it triggers by comparison, partly to be 
> confident of not causing unwanted issues, and partly by necessity 
> because its default action (a major mode) is very disruptive.
>

I see, so-long restricts its action to so-long-target-modes, is that 
correct?  I'm not sure such a restriction is necessary for 
auto-narrow-mode, it does not change anything apart from turning 
font-lock-mode off (by default) and narrowing the buffer.