Subject: bug#64439: 28.2; auto-fill-mode gets turned on all over the place

From: Jim Porter <[email-masked]>
Date: Sun, 9 Jul 2023 11:00:46 -0700

On 7/8/2023 11:45 PM, Eli Zaretskii wrote:
> I must be missing something: why is the above deemed to be a bug?
> AFAIU, you asked any text-mode derivative mode to turn on auto-fill,
> and this is what happened here: normal-mode called outline-mode, which
> turned on auto-fill.  What am I missing?

The bug is that when this occurs, rather than setting 
'auto-fill-function' buffer-locally in text modes, it actually (somehow) 
sets the default value of 'auto-fill-function', so *every* buffer has 
'auto-fill-mode' enabled.

I've instrumented this code in a few other ways previously, and the best 
I can guess so far is that at some point during this backtrace, Emacs 
gets confused about the current buffer, so that when we ultimately call 
"(setq auto-fill-function X)", the code to set the value buffer-locally 
doesn't run.

I've only ever seen this happen when 
'ask-user-about-supersession-threat' is in the stack. The backtraces 
I've captured all include Tramp too, but I'm not sure the latter is 
actually necessary to reproduce this bug, or if it just changes the 
timings to make it more likely.