From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#64439: 28.2; auto-fill-mode gets turned on all over the place Date: Mon, 10 Jul 2023 14:59:26 +0300 Message-ID: <83zg447za9.fsf@gnu.org> References: <83h6qlm0oc.fsf@gnu.org> <1034974.1688399705@warthog.procyon.org.uk> <1211099.1688406521@warthog.procyon.org.uk> <837crgn90u.fsf@gnu.org> <11d9848d-5a70-c1e5-cbc8-e00341889398@gmail.com> <83edlhbn1y.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33968"; mail-complaints-to="usenet@ciao.gmane.io" Cc: dhowells@redhat.com, 64439@debbugs.gnu.org To: Jim Porter , Stefan Monnier , Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Jul 10 14:00:43 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qIpZK-0008gg-Il for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 10 Jul 2023 14:00:42 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qIpYp-00037F-IP; Mon, 10 Jul 2023 08:00:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIpYi-00036U-0a for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 08:00:05 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qIpYh-0004wf-8d for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 08:00:03 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qIpYg-0000Dk-NZ for bug-gnu-emacs@gnu.org; Mon, 10 Jul 2023 08:00:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 10 Jul 2023 12:00:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 64439 X-GNU-PR-Package: emacs Original-Received: via spool by 64439-submit@debbugs.gnu.org id=B64439.1688990398810 (code B ref 64439); Mon, 10 Jul 2023 12:00:02 +0000 Original-Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 11:59:58 +0000 Original-Received: from localhost ([127.0.0.1]:47873 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIpYb-0000Cz-D8 for submit@debbugs.gnu.org; Mon, 10 Jul 2023 07:59:57 -0400 Original-Received: from eggs.gnu.org ([209.51.188.92]:55976) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qIpYV-0000Ch-H4 for 64439@debbugs.gnu.org; Mon, 10 Jul 2023 07:59:54 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIpYC-0004q9-4q; Mon, 10 Jul 2023 07:59:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=MifidAgSaExJmEtc9r4+6ayahIhB0Mhwvaf/bIXCX34=; b=Jg0wgFa5DpP1 GPiVWAunfxqkmqRcvthrj8Kq4coVjtrezy6HcLrXq12zt3yAWkooOYWVMX8qY15GKwnztdSzqb2XO TcfowUIXAqBUYwDlNfUHLnnL1aK+SeRwqOduZXRxO9SY/s/e42e7ZgN/Zodv/kuxolxL5ubwk5B3s qpf68fuu10PfyoNiT5/0L+3WlRocLgM9YGfStjkBWhSByDoncEZLYihyTaNNjUk9JtRoE5HUJo8jo yLslFRfzEZej1Cb7KJdanggQTiOINVPTeQ6+udDl6KhPC97DamMQ+4n/dLJ5wWwNx19SX0kwGffVV +aEdYTh0a91U+TzNKDN0fA==; Original-Received: from [87.69.77.57] (helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qIpXx-0003ny-Db; Mon, 10 Jul 2023 07:59:31 -0400 In-Reply-To: (message from Jim Porter on Sun, 9 Jul 2023 11:00:46 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:264877 Archived-At: > Date: Sun, 9 Jul 2023 11:00:46 -0700 > Cc: dhowells@redhat.com, 64439@debbugs.gnu.org > From: Jim Porter > > 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?