unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Jim Porter <jporterbugs@gmail.com>,
	Stefan Monnier <monnier@iro.umontreal.ca>,
	Michael Albinus <michael.albinus@gmx.de>
Cc: dhowells@redhat.com, 64439@debbugs.gnu.org
Subject: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Date: Mon, 10 Jul 2023 14:59:26 +0300	[thread overview]
Message-ID: <83zg447za9.fsf@gnu.org> (raw)
In-Reply-To: <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@gmail.com> (message from Jim Porter on Sun, 9 Jul 2023 11:00:46 -0700)

> Date: Sun, 9 Jul 2023 11:00:46 -0700
> Cc: dhowells@redhat.com, 64439@debbugs.gnu.org
> From: Jim Porter <jporterbugs@gmail.com>
> 
> 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'

I don't understand how this is possible with local variables.  Maybe
because some code calls makunbound for it?  Does local-variable-p
still return non-nil for auto-fill-function when this triggers?

Stefan, are there any other situations where setting a buffer-local
variable will actually set its default value?

Btw, it is possible that your trap snaps too late: that the default
value of auto-fill-function is non-nil does not yet mean this happens
when your hook is called, it could have happened earlier.  Because
setting the buffer-local value will DTRT regardless of the global
value, AFAIU.

> 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.

As I say above, I don't understand how this can happen.  Even if we
are "confused" about the current buffer, at worst we will set
auto-fill-function in the wrong buffer.

> 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.

"Timings"? is this stuff asynchronous in some sense?  Michael, any
ideas?





  reply	other threads:[~2023-07-10 11:59 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-03 15:55 bug#64439: 28.2; auto-fill-mode gets turned on all over the place David Howells
2023-07-03 16:15 ` Eli Zaretskii
2023-07-03 17:48 ` David Howells
2023-07-03 18:29   ` Eli Zaretskii
2023-07-09  5:57     ` Jim Porter
2023-07-09  6:45       ` Eli Zaretskii
2023-07-09 18:00         ` Jim Porter
2023-07-10 11:59           ` Eli Zaretskii [this message]
2023-07-10 16:00             ` Jim Porter
2023-07-10 17:28               ` Michael Albinus
2023-07-10 17:28             ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-10 20:57               ` Jim Porter
2023-07-10 21:54                 ` Jim Porter
2023-07-10 23:53                   ` Jim Porter
2023-07-11 11:31                     ` Eli Zaretskii
2023-07-11 16:07                       ` Jim Porter
2023-07-11 18:44                         ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-07-12  2:23                           ` Jim Porter
2023-07-12 12:13                             ` Eli Zaretskii
2023-07-03 18:14 ` Jim Porter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=83zg447za9.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=64439@debbugs.gnu.org \
    --cc=dhowells@redhat.com \
    --cc=jporterbugs@gmail.com \
    --cc=michael.albinus@gmx.de \
    --cc=monnier@iro.umontreal.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).