GNU bug report logs - #64439
28.2; auto-fill-mode gets turned on all over the place

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: David Howells <dhowells@HIDDEN>; dated Mon, 3 Jul 2023 15:57:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 11 Jul 2023 11:31:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Tue Jul 11 07:31:56 2023
Received: from localhost ([127.0.0.1]:49843 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qJBb1-0005B0-Fo
	for submit <at> debbugs.gnu.org; Tue, 11 Jul 2023 07:31:56 -0400
Received: from eggs.gnu.org ([209.51.188.92]:54790)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qJBaw-0005Ak-Fy
 for 64439 <at> debbugs.gnu.org; Tue, 11 Jul 2023 07:31:54 -0400
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 <eliz@HIDDEN>)
 id 1qJBap-0007cn-8w; Tue, 11 Jul 2023 07:31:44 -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=oiZsUheQsmrFwzbM+PPyBvAC9UjRwr7x/3tn50Mhkv4=; b=GYq1WKMFlfaW
 zOvnxRBm/pMvo/Da1YmwseQLqD7uZfdLvpZnjJg//Wos5TIoWpzpz26s30ntYoB8pjgAlrAOztktc
 jS1Bk0uH+K+aaJQnswqh8/X8rRdr8PFrvxCgOxQBVXd9TyXRGh99QIpb+knqhGa5qjnB1cteVcNb/
 BhQHb2d8aG9slY3rToqh9lmJerCnv6ZsqnpKfgDQc4OH9e1DH+Do2QJNYyXGITOv7LkdMd7IzE7I7
 7HWEzkVjW2DTXia9oVlaXbZSlgjVIQ04SjrUokfMnZhYBCSmlRNUaxYA4dx9XVodAG/7EMPSK+0P1
 3qy3wObVFmAo6o28vdRrxA==;
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 <eliz@HIDDEN>)
 id 1qJBaj-0001Z2-Gf; Tue, 11 Jul 2023 07:31:43 -0400
Date: Tue, 11 Jul 2023 14:31:48 +0300
Message-Id: <83351u8z17.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <2cc838cc-058e-7275-9b84-fb872b65fa24@HIDDEN> (message from
 Jim Porter on Mon, 10 Jul 2023 16:53:41 -0700)
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> <83zg447za9.fsf@HIDDEN>
 <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
 <6e26e6cf-5784-48fa-4822-5657e8e2db60@HIDDEN>
 <f1919eb5-552c-ca50-9ba2-5518b8830cd1@HIDDEN>
 <2cc838cc-058e-7275-9b84-fb872b65fa24@HIDDEN>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, npostavs@HIDDEN, michael.albinus@HIDDEN,
 monnier@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Mon, 10 Jul 2023 16:53:41 -0700
> From: Jim Porter <jporterbugs@HIDDEN>
> Cc: dhowells@HIDDEN, Michael Albinus <michael.albinus@HIDDEN>,
>  64439 <at> debbugs.gnu.org, Noam Postavsky <npostavs@HIDDEN>
> 
> On 7/10/2023 2:54 PM, Jim Porter wrote:
> > Interestingly, I can't reproduce this on Emacs 30 (latest master), but I 
> > *can* on Emacs 28.2 and the latest rev on the Emacs 29 branch. I haven't 
> > dug any further yet to see which commit could have changed this though.
> 
> ... and it looks like you're the one who fixed this, Stefan! Should this 
> get backported into the emacs-29 branch?

Sorry, no.  We've lived with this subtle problem for 40 years, we can
live another one or two.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 23:53:52 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 19:53:52 2023
Received: from localhost ([127.0.0.1]:49408 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qJ0hT-0007VC-T2
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 19:53:52 -0400
Received: from mail-pg1-f173.google.com ([209.85.215.173]:50352)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qJ0hR-0007Uz-7S
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 19:53:50 -0400
Received: by mail-pg1-f173.google.com with SMTP id
 41be03b00d2f7-55b5a3915f5so3483325a12.0
 for <64439 <at> debbugs.gnu.org>; Mon, 10 Jul 2023 16:53:49 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1689033223; x=1691625223;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=NOtanIt8XX3b2oYLJ0FUo6ylLfu1MgEu6o833C/5bIY=;
 b=po9t+pFSc/MRW0vvsgFuc3m5jd/jpYkFCcv68IzCLnJXdKo/Ahd57J7sFA1J5HQuSz
 z1TT+n26Cx0/PuNmMFFHn7dEorPVNYKnV5NiM4erOm/MOsryQ4WYxKJ0mbUyw578lxbq
 2dy1r69luAHiV92btxpxBjufWIotvmbwnRSVWtCdgPOhNkLBqKMl9vPv6WXX5MZL3BmZ
 uWihT2LFbDb01f2BzEqeydDDusubvwIp/wooxiQxyfXp0+rO5oHCyWjPZMxUcjpuWYwV
 b4HSaDICoaZwP5ewyTeMWg6qgadfqIBS2CY8CaXuz1glvdeXf3gW5j4sC8jEixDGDuve
 5MJg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1689033223; x=1691625223;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=NOtanIt8XX3b2oYLJ0FUo6ylLfu1MgEu6o833C/5bIY=;
 b=GoJzcqfiLoi60zIvPsNi6s1faUFvEVSe+ZQAwfn7cuvCS9+YSZ3c5jUKOb7gtgKr1m
 mz2BJ/KUjGDL3JE4P+2qPFzfUexCbuaKQqIXJi9iX9j65vMTIbvKpGqK94uiYtuhkqy5
 eOMsgn90lVTvW6sVz+4cw/AfP+pmT7X0elFFhUZmybXSWowxk6GpTUdWiBROuCqKbP9z
 +JqIYeRSUcOAEqaZQ665TWm533sDMFBr3H8e7HTNzgR3V8aUwxN8xHE6YaDznp8///wD
 q+k83bDE8qP9zzm5xcL44gT1ORjH0HpodEGT/TSQNUekA6+ptBuLMZS7LcGTuiofdk/k
 YHrA==
X-Gm-Message-State: ABy/qLaC1APHUsEIlP2xM58G3KuTlBjTdX/mjU3LXLikgdc1y6m3P90N
 woJxorzvNu4Ly5oBhly3Zu8=
X-Google-Smtp-Source: APBJJlEqeM9+BLtOvgUsfjCICu/bNazpWdlq/dhGC+dQYzdOPWs99076I3Q3At5+2AOkw/oBwPeelw==
X-Received: by 2002:a17:90a:df02:b0:25c:571:44bc with SMTP id
 gp2-20020a17090adf0200b0025c057144bcmr11801872pjb.28.1689033223105; 
 Mon, 10 Jul 2023 16:53:43 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 bg4-20020a1709028e8400b001b53be3d942sm432410plb.232.2023.07.10.16.53.42
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 10 Jul 2023 16:53:42 -0700 (PDT)
Message-ID: <2cc838cc-058e-7275-9b84-fb872b65fa24@HIDDEN>
Date: Mon, 10 Jul 2023 16:53:41 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Content-Language: en-US
From: Jim Porter <jporterbugs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> <83zg447za9.fsf@HIDDEN>
 <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
 <6e26e6cf-5784-48fa-4822-5657e8e2db60@HIDDEN>
 <f1919eb5-552c-ca50-9ba2-5518b8830cd1@HIDDEN>
In-Reply-To: <f1919eb5-552c-ca50-9ba2-5518b8830cd1@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, Michael Albinus <michael.albinus@HIDDEN>,
 64439 <at> debbugs.gnu.org, Noam Postavsky <npostavs@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 7/10/2023 2:54 PM, Jim Porter wrote:
> Interestingly, I can't reproduce this on Emacs 30 (latest master), but I 
> *can* on Emacs 28.2 and the latest rev on the Emacs 29 branch. I haven't 
> dug any further yet to see which commit could have changed this though.

... and it looks like you're the one who fixed this, Stefan! Should this 
get backported into the emacs-29 branch? It's a one-line fix, but I'm 
not sure if a fix to "src/eval.c" is too invasive for the release branch...

5223762e02ac84eee984cd1f7a17865766cdad9a is the first fixed commit
commit 5223762e02ac84eee984cd1f7a17865766cdad9a
Author: Stefan Monnier <monnier@HIDDEN>
Date:   Sun Apr 2 17:45:58 2023 -0400

     src/eval.c: Fix bug#62419

     Yup, almost 40 years after ELisp first combined them, buffer-local
     and let bindings still don't work quite right :-(

     The "automatically buffer-local if set" semantics should follow the
     principle that it becomes buffer-local iff the var's current binding
     refers to the top-level/global/non-let binding.

     * src/eval.c (let_shadows_buffer_binding_p): Disregard non-global
     let-bindings.

     * test/src/eval-tests.el (eval-test--bug62419): New test.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 21:55:01 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 17:55:01 2023
Received: from localhost ([127.0.0.1]:49325 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIyqT-0007po-5P
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 17:55:01 -0400
Received: from mail-pj1-f44.google.com ([209.85.216.44]:55735)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qIyqQ-0007pa-B4
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 17:54:59 -0400
Received: by mail-pj1-f44.google.com with SMTP id
 98e67ed59e1d1-262dc1ced40so3644204a91.3
 for <64439 <at> debbugs.gnu.org>; Mon, 10 Jul 2023 14:54:58 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1689026092; x=1691618092;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=S8Nu0cBGyA2n4WNWobLQwGxMNbg2zMtWwG54t/CouxA=;
 b=OTS25Vm36WYOSwY5lBZawIZTAVbaXVfAybLgk3w2nV08vydmdhyENB1dmHP7BQgEJI
 bWHSPNrgpl7r/b3ROFWGVx4d/Auq3srSE05y11U91VPWNDJyFNQGkzuDUAv4/6xLqBNQ
 KNa7xxqMv4XRtCBeZ37xo4PaToqd8JPrwlL7RyK4HOF3g5vN0tyrmmNXkJgBWIUctvhg
 +oCUVVwgUjv/1YxtIPM+HIj6pj+teTJv17XkuV6GOkuwWs96cmhII9Wqf7eeu3Xcrr8M
 /pGMzygtR0FPpdV1Y8FTQiajURTvNTSbuIYFIj+WSt3jZLE7JaxnzmGyS9pHSfahbk0h
 /vxg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1689026092; x=1691618092;
 h=content-transfer-encoding:in-reply-to:references:cc:to:from
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=S8Nu0cBGyA2n4WNWobLQwGxMNbg2zMtWwG54t/CouxA=;
 b=kxZ28POJAoPRqr7912/zzwT9zw6Jle7nQlMLWoOlxjzuTAibZc+VEkOFQs4KOmdm1H
 kKW2oRsic6qLLXm8eb3y6LtmSRBpcKxD0MmKiwTqo6pUZyfNYduNarRP8ZbmG1yqafZx
 NgG1RXiOigQXbo/l8Bps5tEu2oc4QbRc3CPgqUZqNO5vpoXr4AVc5NuohOXd1sEgkztp
 nO+WubfJBJggSfUwiSMf2ALxMdXYuDOfHDUwJQe9yzSbfUAYnYKY9hhNGCn95vvRy579
 KdshGzoCKNye2gtaLAC23I/GfHmEbU1k63J3hLfLYSiN6jNI2YfH8veIav1WAr3ZzIGH
 1DfQ==
X-Gm-Message-State: ABy/qLaa99G7XevjEiKcFYagVxVxEsUPQTQv+hKfc1IPLRBrF1+tN6kg
 oNsC7PomfLVANU6SMyx8+5A=
X-Google-Smtp-Source: APBJJlE4yM87PtS4T9QNj+V9I7y8mhTHCQ1V5vVh6qpw23axcaZwqGzsDYMNP3LhY6JEVNF38M5aIg==
X-Received: by 2002:a17:90a:4946:b0:262:ea57:43f with SMTP id
 c64-20020a17090a494600b00262ea57043fmr14491118pjh.37.1689026092427; 
 Mon, 10 Jul 2023 14:54:52 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 b6-20020a17090acc0600b00263b4b1255esm6657493pju.51.2023.07.10.14.54.51
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 10 Jul 2023 14:54:52 -0700 (PDT)
Message-ID: <f1919eb5-552c-ca50-9ba2-5518b8830cd1@HIDDEN>
Date: Mon, 10 Jul 2023 14:54:51 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Content-Language: en-US
From: Jim Porter <jporterbugs@HIDDEN>
To: Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> <83zg447za9.fsf@HIDDEN>
 <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
 <6e26e6cf-5784-48fa-4822-5657e8e2db60@HIDDEN>
In-Reply-To: <6e26e6cf-5784-48fa-4822-5657e8e2db60@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, Michael Albinus <michael.albinus@HIDDEN>,
 64439 <at> debbugs.gnu.org, Noam Postavsky <npostavs@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Interestingly, I can't reproduce this on Emacs 30 (latest master), but I 
*can* on Emacs 28.2 and the latest rev on the Emacs 29 branch. I haven't 
dug any further yet to see which commit could have changed this though.

On 7/10/2023 1:57 PM, Jim Porter wrote:
> On 7/10/2023 10:28 AM, Stefan Monnier via Bug reports for GNU Emacs, the 
> Swiss army knife of text editors wrote:
>> Jim, did you collect various backtraces?  Do you still have them?
>> Can you check more thoroughly to try and see what they all have in common
>> (in addition to `ask-user-about-supersession-threat` and "Tramp")?

Ok, the common factors I can see right now are:

* 'ask-user-about-supersession-threat'
* Only happens when I press Enter

Tramp seems to have nothing to do with this.

>> Can you get an interactive backtrace buffer?  If so, I'd be curious to
>> know the values that
>>
>>      e (list auto-fill-function (default-value 'auto-fill-function)) RET
>>
>> returns and more importantly, how it varies from frame to frame.

The result appears to be (do-auto-fill do-auto-fill) everywhere.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 20:57:41 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 16:57:41 2023
Received: from localhost ([127.0.0.1]:49237 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIxwz-0006LA-3f
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 16:57:41 -0400
Received: from mail-pl1-f172.google.com ([209.85.214.172]:54481)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qIxwy-0006Kx-4F
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 16:57:40 -0400
Received: by mail-pl1-f172.google.com with SMTP id
 d9443c01a7336-1b8ad8383faso36664635ad.0
 for <64439 <at> debbugs.gnu.org>; Mon, 10 Jul 2023 13:57:40 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1689022654; x=1691614654;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=Hx5t3su5rsbnhklTa8ljXl5CgBsl8X4nh5x4sw9WWhM=;
 b=bix1JMjUDE8YyI1gOKYBKflIKig/00YUxBl1FCt/KVcclLvcHl8YK9F9ezoOlbeedr
 iQi/dNVHElXGwFmhGm4eTWhRk871Vb1Bus1J/UQeWW4h9QMYATYLxlYn538pxGtH1ER4
 +3CpJ2Yc5vLx+MoXWKumdQwCA+3Bi29jq6ScFKde4zKRt4fUgDQ7GJiNnU+X/9fJsbx8
 Lo3HPflJ1U5zFiXeE/BTVA7zecc9nbaLjDfJFu/Zerx/M5RFcH1SJfx+f1bGDBJZNxao
 WVKZQr5AWxNjRWpYx4QtC2rwan6pLUqFL8ygqEdWCanMCdW6kpGkADjx5XuKAAMSqFCA
 8CVA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1689022654; x=1691614654;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=Hx5t3su5rsbnhklTa8ljXl5CgBsl8X4nh5x4sw9WWhM=;
 b=VTA7N+A1djBicpiB2XTdsAY8kajkSvZsGmGT+QZgZnERT84e+wuXUHnXpeAz3OK9eF
 jwdMhVM7KP9TDPnEe2Lx5EmwfQLRjeSk0Z0IsHqOBlN4kBibiJwjXSHs+UUBx7PBPYYZ
 BZLZoJutWqFKUss0b0uujx80G8xw6JBX1bU0cLySKHyHfupMSvvslGvXLCtG0Z8vGkKy
 thEMkGrUN05lzy2UI9H/zL3BXj2PkXUcPE46CIiSh7t3IHgUJ48BALzj0lJQYuoJEuEs
 zIAFp2AG76ebTOxIQsojFoP8DKyXiba0Fj4/TWq/xRYDGctcYbEMqmEnOb3G5Rf+me8q
 GOSA==
X-Gm-Message-State: ABy/qLbtAQUSD2qmiZnYWBI7lopo1IYit9RwiQaYNDG3S3mMPomMH2xu
 22PBhHIlwidL2zb2dMHbNNg=
X-Google-Smtp-Source: APBJJlHV5dNmF9UU212YUpyJmy0l0AzidonWs3SW6y6m5sjogct0YjqF5YgpMRVDeSwdJ+fCW+R0Ww==
X-Received: by 2002:a17:902:b698:b0:1b8:53b5:8518 with SMTP id
 c24-20020a170902b69800b001b853b58518mr13205105pls.63.1689022654177; 
 Mon, 10 Jul 2023 13:57:34 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 w2-20020a170902904200b001b86e17ecacsm318412plz.131.2023.07.10.13.57.33
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 10 Jul 2023 13:57:33 -0700 (PDT)
Message-ID: <6e26e6cf-5784-48fa-4822-5657e8e2db60@HIDDEN>
Date: Mon, 10 Jul 2023 13:57:32 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Content-Language: en-US
To: Stefan Monnier <monnier@HIDDEN>, Eli Zaretskii <eliz@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> <83zg447za9.fsf@HIDDEN>
 <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, Michael Albinus <michael.albinus@HIDDEN>,
 64439 <at> debbugs.gnu.org, Noam Postavsky <npostavs@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 7/10/2023 10:28 AM, Stefan Monnier via Bug reports for GNU Emacs, the 
Swiss army knife of text editors wrote:
> Jim, did you collect various backtraces?  Do you still have them?
> Can you check more thoroughly to try and see what they all have in common
> (in addition to `ask-user-about-supersession-threat` and "Tramp")?

Unfortunately no. I set this issue aside previously, since I was having 
a hard time making progress. I'll try to keep them around going forward 
though.

> Can you get an interactive backtrace buffer?  If so, I'd be curious to
> know the values that
> 
>      e (list auto-fill-function (default-value 'auto-fill-function)) RET
> 
> returns and more importantly, how it varies from frame to frame.

Will do. The next time I hit my (updated) debug code, it'll drop into 
the debugger and I'll try to get some info out of it.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 17:29:08 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 13:29:08 2023
Received: from localhost ([127.0.0.1]:49055 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIuhA-0000yu-0U
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 13:29:08 -0400
Received: from mout.gmx.net ([212.227.15.19]:43419)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <michael.albinus@HIDDEN>) id 1qIuh7-0000y8-L8
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 13:29:07 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.de;
 s=s31663417; t=1689010135; x=1689614935; i=michael.albinus@HIDDEN;
 bh=+au6Q1okCuo4/LcQRMkbt5GNaDlvbnWi5DVYAzzb8W4=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date;
 b=WsEarOEiNmRywOVQ2oZYht/+GmaEYfQkhzA4SQZA94HUiVC2VuL4KJow29Uyy6pWYbZ2S25
 NPvuQgMDgdwxxgSNXWMaN3Ijle6oBccbxzPpxTxcrIZEstMGDTxF89hCU3gNxJirxK91N686q
 tFs+t1HRELIgBH1V0mObt/PbbcVa3KBYkXVGmS6xrZUd9ppfkfBIwtSQQuunsIpW3QpgkyDHg
 qfSqjI8k8NsA42gSsD9H3gUPM1PCkKhJwgHm4ga47tleyolMq5ZqtHXgL89HhRgCYNKODL+gQ
 a5JfNeknBsdsmPSrH8IBew6adEJiQnAWnN8roCfvZl8KlNjnz+Vw==
X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a
Received: from gandalf.gmx.de ([185.89.39.22]) by mail.gmx.net (mrgmx005
 [212.227.17.190]) with ESMTPSA (Nemesis) id 1Mlw3N-1pbqBI0nWV-00j2TQ; Mon, 10
 Jul 2023 19:28:55 +0200
From: Michael Albinus <michael.albinus@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
In-Reply-To: <f7d76a26-4fdf-2eca-3678-29b1ab4cb2da@HIDDEN> (Jim Porter's
 message of "Mon, 10 Jul 2023 09:00:14 -0700")
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN>
 <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN>
 <83zg447za9.fsf@HIDDEN>
 <f7d76a26-4fdf-2eca-3678-29b1ab4cb2da@HIDDEN>
Date: Mon, 10 Jul 2023 19:28:53 +0200
Message-ID: <87351v3cbu.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:zqKjreeDPGYfmi1GuG1NsLijtirFRkHTJc+M0Qdc/pCFWk0OR0A
 dujtfTzF+WNYwahSI3IglK22OeVQvIpNSuw4dccswW9+q5AuQdiEDuKBBiPrkapBa8o+BPI
 ApztxxfrA2R3RAnGfVSfPC45JCQOI25xwKTj75fmZGPXcMLYE2340U25KZRL9ZExXVRwYio
 rLTCmlrX6kuoEiG8GlDyQ==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:PMgYRfGTk5U=;SRCNc0uA1yi0GyWSmTSjW+9LkW3
 zFqFsMjeFfvA4mU9IVBBoUoes5AibBhdjQ21Wtkb7kih90yLqJzCPuSAhMbOKH/MSDKLHu4e+
 seKDhh0C/7ZPCbbKZGj7trS7BmEwixiEnBu3uZ8CakrJ/uaXQZL4M0qhxSJhwL4NA9XqY+aGZ
 qgxGrdsvPbKy/VZu6KfywZb2k5fJ8P1Uz1e4M6aEaaII/eGp3PJUkQpvdA+JykEwtwTKciV/g
 9jnWAzjfjtNa+JyYEcn72khVYsgFrEcskwJn4zYHY9i72074cOKDmPkmQGLbcE3spZJALQTzy
 /dRkeL25DWNgTJ+Fs3OaTNLXccrsnw0/1xVPK5iO6gDspsfdqTh8z3BthyLavCAijsMMG/3XE
 xQauM1Jz2+NTVRP7TrMhgtgDbMW02AE9lDN4pBLF6/VT00FieboW0A1JXOj8S+OHDyhUYZpr3
 EwxeIlykut1nw+DogbLT6hmOH+te+AJDwdDr3xiFmGeGvn47q9yMBCUdXfrat1qeFoqLaB2EJ
 hAqXxaYwgyPBXIJweJ40DrAeDjN11RN6T4mUO1WlgbkRLXKxCdpVNABW36y1+ER98aypACp/z
 VO7gVsdstSwos51YcA/gyb+GyH7Xh4zlr+D47k2ZpZzlXwRg+HMkhToyhJG7cutu2peuyDEg4
 hDpJS46FovQg826U5kraHIg6rI9rVHtT7ME/hBjHCge/SxpQacBwAe/D0oUcHqghqzOh/V8z0
 rnTLf2eotIuTIbvo2OBiZ/vLpejA//67VGvWWz+K1bX1n+T9frrHTTP6KExqT46RkdbPvC7Pj
 YXbiL6jRuus3xqQDzQxjBVUmT6r3ZKGYC+UsC+4pB7xykelHzjgs4EGN5bb2Ci3fJVOmWQ5Cw
 AYAPXprLPvPth0Lj3yILK0xhIQUdoKiZdtQyDNDpxFgb4vrsI7Q2Tvh20ZphoQ7muqEORhCG9
 kV4X5la8XEuR2HJSEJbk32SM9h0=
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, Eli Zaretskii <eliz@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.7 (-)

Jim Porter <jporterbugs@HIDDEN> writes:

Hi Jim,

>>> 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?
>
> It's just a guess, but if some other Lisp code can run while Tramp is
> fetching the file data, that could possibly cause some issue.

Sure, there timers, process filters, process sentinels, dbus
handlers, file notification handlers, you name it.

But my guess is that you're fighting with connection-local
variables. They do manipulate buffer-local variables.

Best regards, Michael.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 17:28:35 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 13:28:34 2023
Received: from localhost ([127.0.0.1]:49051 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIugc-0000xN-LD
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 13:28:34 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:17987)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <monnier@HIDDEN>) id 1qIugY-0000x3-7u
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 13:28:33 -0400
Received: from pmg1.iro.umontreal.ca (localhost.localdomain [127.0.0.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 8BC251000C4;
 Mon, 10 Jul 2023 13:28:24 -0400 (EDT)
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg1.iro.umontreal.ca (Proxmox) with ESMTP id 72C361000B9;
 Mon, 10 Jul 2023 13:28:23 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1689010103;
 bh=XCwzNzizV4NsKGb8v51WTR67OhZF3HBVBZrgGf9flcM=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=R05jYCjGtD1TedwdyEll9JxaM+Qf86pgcNP4FzncKfYLcPkuEkhwPdsZ/FnJDWi0v
 5GXt+6/SjfEgW7C2dG2WqFJQIbtdROv0nuWfU5BDVfGtamtur5l7+BPkbtJGs9VUf+
 NV8/nei3Q5Ac3X2DaJDwZnirIngewZ8FJkbk6v9a0vaxEVdb/+SiMApblgTWfIalS+
 7pc3Qzx+C+LAPTUgfn3QPWJm27mOpU+1fA/2ElFUPO78LEKvBezg0YSn593OJkeOM6
 rP8VgTO0jFslGrCHy3uu0NelhsKSogYxZ85sQdib3M01e9NHaLIP3fCIBVyxqEzB4M
 iUn58kv4a00Yw==
Received: from pastel (unknown [24.140.234.50])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 3D645120208;
 Mon, 10 Jul 2023 13:28:23 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
In-Reply-To: <83zg447za9.fsf@HIDDEN> (Eli Zaretskii's message of "Mon, 10 Jul
 2023 14:59:26 +0300")
Message-ID: <jwvh6qbog8g.fsf-monnier+emacs@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN>
 <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN>
 <83zg447za9.fsf@HIDDEN>
Date: Mon, 10 Jul 2023 13:28:22 -0400
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-SPAM-INFO: Spam detection results:  0
 ALL_TRUSTED                -1 Passed through trusted hosts only via SMTP
 AWL -0.000 Adjusted score from AWL reputation of From: address
 BAYES_00                 -1.9 Bayes spam probability is 0 to 1%
 DKIM_SIGNED               0.1 Message has a DKIM or DK signature,
 not necessarily valid
 DKIM_VALID -0.1 Message has at least one valid DKIM or DK signature
 DKIM_VALID_AU -0.1 Message has a valid DKIM or DK signature from author's
 domain
 DKIM_VALID_EF -0.1 Message has a valid DKIM or DK signature from envelope-from
 domain T_SCC_BODY_TEXT_LINE    -0.01 -
X-SPAM-LEVEL: 
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, Jim Porter <jporterbugs@HIDDEN>,
 Michael Albinus <michael.albinus@HIDDEN>, 64439 <at> debbugs.gnu.org,
 Noam Postavsky <npostavs@HIDDEN>
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

[ Adding Noam, because this seems related to
  https://github.com/joaotavora/yasnippet/issues/919.  ]

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

Depends what you mean, but if you do:

    (let ((auto-fill-function #'foo))
      [...]
      (setq auto-fill-function #'bar)
      [...])

then `auto-fill-function` will not be made buffer-local.  But that won't
set the toplevel default value either (that default value will be
reverted to nil when we leave the `let`).

Interactions between buffer-local values and let-bindings can be tricky,
tho, so there might still be bugs in there.

Jim, did you collect various backtraces?  Do you still have them?
Can you check more thoroughly to try and see what they all have in common
(in addition to `ask-user-about-supersession-threat` and "Tramp")?

Can you get an interactive backtrace buffer?  If so, I'd be curious to
know the values that

    e (list auto-fill-function (default-value 'auto-fill-function)) RET

returns and more importantly, how it varies from frame to frame.


        Stefan





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 16:00:28 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 12:00:28 2023
Received: from localhost ([127.0.0.1]:49007 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qItJL-000763-QJ
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 12:00:28 -0400
Received: from mail-pf1-f176.google.com ([209.85.210.176]:59897)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qItJG-00075j-7I
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 12:00:25 -0400
Received: by mail-pf1-f176.google.com with SMTP id
 d2e1a72fcca58-6687446eaccso4052718b3a.3
 for <64439 <at> debbugs.gnu.org>; Mon, 10 Jul 2023 09:00:22 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1689004816; x=1691596816;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:cc:to:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=V57qqnXrrZMsfI7mGZ2c7999QeT9hx4CisEfwtQNv7w=;
 b=X6UrICkVni8Ls7rNi5lVedbBv7B+rvKVfNZo2OeIvtGpTYEN/goH8OWPYdCs/q2OAJ
 OgzZ/gXl0wAOFTFifVKhHEPsiA/6andGPtOLNqNLpA8u6jIOdviXCW/xIGZa2TKCc4VH
 iUvssRrvyJpzBE2Mtz2j5H6rJLhi8sEMz54XvZRYKRxq6tVYkMs78taDB9BpyoAWsU9d
 DkAwex9lQZWs/Q6VH/gSUG4vfRFpPdc9UyLQNzBRZwAB+ZlAPie7C25i7GUpzx5axjQk
 SnC8c3Io+lBDfVezaMmWQ9RdOMOrSfBNeBWLLnVzDFl6miJUvmlU4+3AVyKTnDXgM0ou
 L35w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1689004816; x=1691596816;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:cc:to:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=V57qqnXrrZMsfI7mGZ2c7999QeT9hx4CisEfwtQNv7w=;
 b=g0xUcJ973IxV99g7KuxIG4kp3Hafcnvm59UJT6rxRxRBBxK4ruKbhTlPN67wXVx3eq
 VxjFcMnGKuvDoSbA/wiD5WClaQeiFMITcyytj07f3+EtcNokaKPNTnxwPzlh0Dntw+/s
 ypPApuSt+e6Xh0I0tBhnQqFNndqpqOi7DAHSuixuzFaACGN3k8y8ia7XOb9VJQI/ddV5
 Zo5tEEXQ+Dm+OqC62yuBc84a/aCFzYe7ETaMU7ANss1IhK6strXPY1t4cWO+OC8BBzvA
 nreRSxYFLVgbz648aNwPKCAYbKF0Lcl/xR9Ucja//F17URHpiBz6tq/u7wUl+DOgsgbP
 liLw==
X-Gm-Message-State: ABy/qLZBWcJavvHRMj3cnYdE90Mzbi3kdYroABH8j4vwW3y9+RmEAurF
 V3b2PEuvcUCR0aHIN7QgyMM=
X-Google-Smtp-Source: APBJJlGWaVjeN7PBsafxtKc/XoblHkGklhZz91K4VU3HZHM+u8sL2YVbnrZg2GfR4fUKr04LBsQv9A==
X-Received: by 2002:a05:6a00:248e:b0:674:ff6d:1b39 with SMTP id
 c14-20020a056a00248e00b00674ff6d1b39mr16337163pfv.9.1689004815837; 
 Mon, 10 Jul 2023 09:00:15 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 b11-20020a63930b000000b0055bc3b97f34sm7513510pge.19.2023.07.10.09.00.14
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 10 Jul 2023 09:00:15 -0700 (PDT)
Message-ID: <f7d76a26-4fdf-2eca-3678-29b1ab4cb2da@HIDDEN>
Date: Mon, 10 Jul 2023 09:00:14 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
To: Eli Zaretskii <eliz@HIDDEN>, Stefan Monnier <monnier@HIDDEN>,
 Michael Albinus <michael.albinus@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> <83zg447za9.fsf@HIDDEN>
Content-Language: en-US
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <83zg447za9.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 7/10/2023 4:59 AM, Eli Zaretskii wrote:
>> Date: Sun, 9 Jul 2023 11:00:46 -0700
>> Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
>> From: Jim Porter <jporterbugs@HIDDEN>
>>
>> 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?

I'll add a 'local-variable-p' check to my test code, but whatever's 
happening here, it only makes 'auto-fill-function' non-local 
temporarily. Immediately after the backtrace I posted, I evaled 
"(setq-default auto-fill-function nil)" to fix the default value, and 
then called 'normal-mode' in a text-mode buffer, and it correctly 
enabled auto-fill-mode in just that buffer.

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

That's true, though I'm pretty sure it's not the case here, since I 
noticed my prog-mode buffers suddenly have 'auto-fill-mode' (which 
prompted me to check my *Messages* output to get the backtrace. I'll add 
some extra checks here in my test code.

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

It's just a guess, but if some other Lisp code can run while Tramp is 
fetching the file data, that could possibly cause some issue.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 10 Jul 2023 11:59:58 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 10 07:59:58 2023
Received: from localhost ([127.0.0.1]:47873 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIpYb-0000Cz-D8
	for submit <at> debbugs.gnu.org; Mon, 10 Jul 2023 07:59:57 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55976)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qIpYV-0000Ch-H4
 for 64439 <at> debbugs.gnu.org; Mon, 10 Jul 2023 07:59:54 -0400
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 <eliz@HIDDEN>)
 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==;
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 <eliz@HIDDEN>)
 id 1qIpXx-0003ny-Db; Mon, 10 Jul 2023 07:59:31 -0400
Date: Mon, 10 Jul 2023 14:59:26 +0300
Message-Id: <83zg447za9.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>,
 Michael Albinus <michael.albinus@HIDDEN>
In-Reply-To: <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN> (message from
 Jim Porter on Sun, 9 Jul 2023 11:00:46 -0700)
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
 <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

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




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 9 Jul 2023 18:00:59 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 09 14:00:59 2023
Received: from localhost ([127.0.0.1]:47131 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIYiQ-0006li-Vo
	for submit <at> debbugs.gnu.org; Sun, 09 Jul 2023 14:00:59 -0400
Received: from mail-pf1-f178.google.com ([209.85.210.178]:45346)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qIYiM-0006lL-4z
 for 64439 <at> debbugs.gnu.org; Sun, 09 Jul 2023 14:00:57 -0400
Received: by mail-pf1-f178.google.com with SMTP id
 d2e1a72fcca58-66f5faba829so2051781b3a.3
 for <64439 <at> debbugs.gnu.org>; Sun, 09 Jul 2023 11:00:54 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1688925648; x=1691517648;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:cc:to:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=xI1NzTpCCiynnhzpBfURsFLlLKQHpTbKt1xftT2/Jf4=;
 b=ZkVQvWivgIsDjQl0hpR5eymj96OSJIdRlx5vgJrXIZec8eeWJPYVkNK0i2XiCuLVJG
 og4FB1NWwOg7fFbMBY1ys9MLnQUBg4JZK5JAKxjAwtzEAaGlKqLI0wDr21owFLBHZdc4
 6oHrNrekEnCB3cJvCkeQVgmk3uuYCOCQuzQ09f7EG8e38+Z9XG/dbzkg0psN/E5/RvEl
 tpmEztZzwf2S6O5nfsXtQ3GlQ+Evl8os3CymIX1VTyom/C2I4ATnbORz+NlfAEX8qGRo
 a4LTEP0CqcqNr0OvfPMrCHeKuh5beDm6lSsNMkTHgrOFpQqRC6Sk6ld25MZLarHZz0C1
 ZJ7w==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1688925648; x=1691517648;
 h=content-transfer-encoding:in-reply-to:from:content-language
 :references:cc:to:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=xI1NzTpCCiynnhzpBfURsFLlLKQHpTbKt1xftT2/Jf4=;
 b=Pna1v1aubbTRdNFv2vgCa09NupeZILEzpSqZf/4ZALr/i16QRKKWwyh6oGv/56iFiN
 YDHCZ/dijm0ReOKOn9MXd9/XnSV0omNOOO5CLI1eThfHC6cxZ3Uo1eULgXMgVefkLTYj
 61n1ENuQ9WE9jdPXnWkGR8gRwPvRFI1pTLxNeIdfLwl0ZuQ5D6cRr+UllCl1YjSDUOZY
 sEAjHIwNOsBS1PrEVWTrAK6SiP/EjFN7QFakcLO56+ZQfRbcwwAMFB8y0U3NMJxh9QU1
 tTXay1dOfKkFuUsd4Njz6d914OOPWoFSbN91xDNd0cwXaBOMIa9SyJ5JUWWaWXd3XEVV
 ajWw==
X-Gm-Message-State: ABy/qLZJLTWBgjZtb9lN7r0IwuJwjbF3ORsdhRh76D6YMOhnFLEW0Y3v
 0h/9idOXbWg6LKwH/QohgDs=
X-Google-Smtp-Source: APBJJlHyHkgCNVdBhaY3wb9eG7gTBd+cyoX8w01Ibuhs/31WugMcuiqvyD/vrbhc6erMuoyv46YZXA==
X-Received: by 2002:a05:6a00:190b:b0:66a:6339:e8f9 with SMTP id
 y11-20020a056a00190b00b0066a6339e8f9mr10493657pfi.0.1688925648136; 
 Sun, 09 Jul 2023 11:00:48 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 q17-20020a62e111000000b0062bc045bf4fsm5905683pfh.19.2023.07.09.11.00.47
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sun, 09 Jul 2023 11:00:47 -0700 (PDT)
Message-ID: <fe223c95-a2ae-35ce-73a8-72e26ee0fe38@HIDDEN>
Date: Sun, 9 Jul 2023 11:00:46 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
To: Eli Zaretskii <eliz@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> <83edlhbn1y.fsf@HIDDEN>
Content-Language: en-US
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <83edlhbn1y.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

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.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 9 Jul 2023 06:45:33 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 09 02:45:33 2023
Received: from localhost ([127.0.0.1]:45677 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qIOAm-0007bM-QD
	for submit <at> debbugs.gnu.org; Sun, 09 Jul 2023 02:45:33 -0400
Received: from eggs.gnu.org ([209.51.188.92]:55996)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qIOAk-0007b7-Ja
 for 64439 <at> debbugs.gnu.org; Sun, 09 Jul 2023 02:45:31 -0400
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 <eliz@HIDDEN>)
 id 1qIOAe-0007pe-KJ; Sun, 09 Jul 2023 02:45:24 -0400
DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org;
 s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From:
 Date; bh=cCAE3Ftp3Aj4zSREiDvsduCIWmOeoQLxdgema8yh4lk=; b=q3DDraaoOY+eJolhmIXm
 ooGn45yqbYISJim08ikh+XNXy+ZQ0tn48oJJSyqPDGpSfn60bJ0mVvMUJOtQfI+6qk8TioH7AaNzB
 1TL0anhadHhTcJKEBFwXKdaXBdflpNOa8+gHbHb5zM2e859sM3sxYYUM05vrrOnt/oeUqeYo3RmT8
 TpSZaNoFJT83ps0W+6Lyt79okR9oFK+zXqm6poXsb1J0wrD6KhzJ0INRkqUl2S9W04YYUnNdSTvTh
 qTUT4JfiWZhIZQ/Bqhv5VqYi/qZvW7sqoFBF2LWXFNxfTWrmZ0jEn2wAwqJIbn//rfOCyHodD+iYK
 O1nvg165Ynbjjw==;
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 <eliz@HIDDEN>)
 id 1qIOAc-0003lY-Eo; Sun, 09 Jul 2023 02:45:24 -0400
Date: Sun, 09 Jul 2023 09:45:29 +0300
Message-Id: <83edlhbn1y.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN> (message from
 Jim Porter on Sat, 8 Jul 2023 22:57:12 -0700)
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
 <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Date: Sat, 8 Jul 2023 22:57:12 -0700
> Cc: 64439 <at> debbugs.gnu.org
> From: Jim Porter <jporterbugs@HIDDEN>
> 
> On 7/3/2023 11:29 AM, Eli Zaretskii wrote:
> > I guess tracking down this problem will be harder, then.  I hope I at
> > least gave you some ideas with which you will be able to construct a
> > suitable trap and find the culprit.  Good luck!
> 
> I got a backtrace when this happened to me. Outside of Emacs, I checked 
> out a different Git branch, and then went back to Emacs and started 
> typing into "etc/NEWS" (the specific file probably doesn't matter much), 
> which triggered the supersession prompt as you'd expect. This was all 
> over Tramp/SSH (again, not sure this is relevant).
> 
> Here's the debug code I added to trace this:
> 
> ----------------------------------------
> 
> (use-package text-mode
>    :preface
>    (defun user/turn-on-auto-fill ()
>      "Turn on auto-fill, but log a warning if it's not local to a buffer."
>      (turn-on-auto-fill)
>      (when (default-value 'auto-fill-function)
>        (display-warning 'auto-fill :error
>                         "Default value of `auto-fill-function' was set!")
>        (backtrace)))
> 
>    :hook (text-mode . user/turn-on-auto-fill))
> 
> ----------------------------------------
> 
> And here's the backtrace (plus a couple lines immediately preceding):
> 
> ----------------------------------------
> 
> NEWS changed on disk; really edit the buffer? (y, n, r or C-h) r
> Tramp: Inserting ‘/sshx:jim@remote:/home/jim/src/emacs/etc/NEWS’...done
>    backtrace()
>    (progn (display-warning 'auto-fill :error "Default value of 
> `auto-fill-function' was set!") (backtrace))
>    (if (default-value 'auto-fill-function) (progn (display-warning 
> 'auto-fill :error "Default value of `auto-fill-function' was set!") 
> (backtrace)))
>    (when (default-value 'auto-fill-function) (display-warning 'auto-fill 
> :error "Default value of `auto-fill-function' was set!") (backtrace))
>    user/turn-on-auto-fill()
>    run-hooks(change-major-mode-after-body-hook text-mode-hook 
> outline-mode-hook)
>    apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
> outline-mode-hook))
>    run-mode-hooks(outline-mode-hook)
>    outline-mode()
>    set-auto-mode-0(outline-mode nil)
>    set-auto-mode()
>    normal-mode(t)
>    after-find-file(nil nil t nil nil)
>    revert-buffer--default(nil t)
>    revert-buffer(nil t)
>  
> ask-user-about-supersession-threat("/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    tramp-handle-lock-file("/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    apply(tramp-handle-lock-file "/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    tramp-sh-file-name-handler(lock-file 
> "/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    apply(tramp-sh-file-name-handler lock-file 
> "/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    tramp-file-name-handler(lock-file 
> "/sshx:jim@remote:~/src/emacs/etc/NEWS")
>    newline(nil 1)
>    funcall-interactively(newline nil 1)
>    command-execute(newline)
> 
> ----------------------------------------
> 
> This might not be the most useful backtrace in the world, but hopefully 
> it at least confirms one way this can happen. It's rare enough though 
> that I can't reproduce it on command. It does lead me to believe that 
> there's a bug with automatically-buffer-local variables, since 
> 'turn-on-auto-fill' should Just Work here (and it typically does).

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?




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 9 Jul 2023 05:57:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sun Jul 09 01:57:22 2023
Received: from localhost ([127.0.0.1]:45596 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qINQ9-0006MZ-L4
	for submit <at> debbugs.gnu.org; Sun, 09 Jul 2023 01:57:21 -0400
Received: from mail-pj1-f41.google.com ([209.85.216.41]:62542)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qINQ7-0006ML-H1
 for 64439 <at> debbugs.gnu.org; Sun, 09 Jul 2023 01:57:20 -0400
Received: by mail-pj1-f41.google.com with SMTP id
 98e67ed59e1d1-26598fc0825so684128a91.0
 for <64439 <at> debbugs.gnu.org>; Sat, 08 Jul 2023 22:57:19 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1688882233; x=1691474233;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=lEtONrOWg70/ps8+8jfX5q/K3AHuLpXAE4bAVJ/Bh9k=;
 b=NuHlM0cd/8rZ//TYxSAUfsnLkN8/tQUHtA+Rt2B9nU5j68pM5KnMr34YyQVWkU4VCo
 Fgjx8b/i5+wE69Y2Vgl57e+1P86nU4AMJteeCLUOWa1azvWzgZZIt9ixCieAoWzFqNsh
 IfdCz/rp+x5xu/tLgDaygFsWjBHJUBnhgnIspd2jwDLfdlmVuex/Eb3vcVoA1Mid4gl6
 AVcnuul2/FYk94uKQpAzOjzQf6kSVbBSYSanGcRv4SKAgYYYfb9k/647Y/NX0ZPfJqod
 HNbzVghyugQVNUEGqM0zyJrIfND1lVWDBKvb0wxEnfp3WeGDXIWNGfOHTsqoDdABlMbv
 5iuA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1688882233; x=1691474233;
 h=content-transfer-encoding:in-reply-to:from:references:cc:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=lEtONrOWg70/ps8+8jfX5q/K3AHuLpXAE4bAVJ/Bh9k=;
 b=Ccj//+VlWLnkeSedw/YJwuddk/1k+qVI2uBHfd207dXu+qq23aaZ1Z/8ICCyolm7Mj
 I9LkVIqskx0uCwJvBwC/XaMXjdb0FDZiiOUGyv/NYdhuVh39DgfthRkAjxNP37+BXnd2
 GTc9Y/Z099Pou/zWla0yJc5bP9fvLnozaeXfhG20UFDJo//RGu14nODzofJobyj+bHUh
 aqjgqfIBjSKVALrAOECT0FYZXKyfVra6W49ZjBP4B+gzUr1guRHfBNPRSick5XQOseWC
 enShCK2dcAJKiYv9gwq6ciplCdIA8V5yNAEV9HlMWNRm0msu0Jp+3g87esEBoIFBfqVq
 5LKA==
X-Gm-Message-State: ABy/qLbPIulvdp6UrBfbvUSpiwJNdn1IBEJDY5NQdtQXDtakBOkd0vua
 zUeIR4tHJK6RgQSNf5sY+ZQ=
X-Google-Smtp-Source: APBJJlGfQWMoviIFU9qhWhNi+anI7dbktbpbK6C/4MVJXP+IVKFUO2Rt8I1hwLuFCEhO5wT2UZL0Pw==
X-Received: by 2002:a17:90a:1b4f:b0:264:7a:6a84 with SMTP id
 q73-20020a17090a1b4f00b00264007a6a84mr14953917pjq.0.1688882233588; 
 Sat, 08 Jul 2023 22:57:13 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 l7-20020a17090aaa8700b00264044cca0fsm7328002pjq.1.2023.07.08.22.57.12
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Sat, 08 Jul 2023 22:57:13 -0700 (PDT)
Message-ID: <11d9848d-5a70-c1e5-cbc8-e00341889398@HIDDEN>
Date: Sat, 8 Jul 2023 22:57:12 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Content-Language: en-US
To: Eli Zaretskii <eliz@HIDDEN>, David Howells <dhowells@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN> <837crgn90u.fsf@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <837crgn90u.fsf@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 7/3/2023 11:29 AM, Eli Zaretskii wrote:
> I guess tracking down this problem will be harder, then.  I hope I at
> least gave you some ideas with which you will be able to construct a
> suitable trap and find the culprit.  Good luck!

I got a backtrace when this happened to me. Outside of Emacs, I checked 
out a different Git branch, and then went back to Emacs and started 
typing into "etc/NEWS" (the specific file probably doesn't matter much), 
which triggered the supersession prompt as you'd expect. This was all 
over Tramp/SSH (again, not sure this is relevant).

Here's the debug code I added to trace this:

----------------------------------------

(use-package text-mode
   :preface
   (defun user/turn-on-auto-fill ()
     "Turn on auto-fill, but log a warning if it's not local to a buffer."
     (turn-on-auto-fill)
     (when (default-value 'auto-fill-function)
       (display-warning 'auto-fill :error
                        "Default value of `auto-fill-function' was set!")
       (backtrace)))

   :hook (text-mode . user/turn-on-auto-fill))

----------------------------------------

And here's the backtrace (plus a couple lines immediately preceding):

----------------------------------------

NEWS changed on disk; really edit the buffer? (y, n, r or C-h) r
Tramp: Inserting ‘/sshx:jim@remote:/home/jim/src/emacs/etc/NEWS’...done
   backtrace()
   (progn (display-warning 'auto-fill :error "Default value of 
`auto-fill-function' was set!") (backtrace))
   (if (default-value 'auto-fill-function) (progn (display-warning 
'auto-fill :error "Default value of `auto-fill-function' was set!") 
(backtrace)))
   (when (default-value 'auto-fill-function) (display-warning 'auto-fill 
:error "Default value of `auto-fill-function' was set!") (backtrace))
   user/turn-on-auto-fill()
   run-hooks(change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook)
   apply(run-hooks (change-major-mode-after-body-hook text-mode-hook 
outline-mode-hook))
   run-mode-hooks(outline-mode-hook)
   outline-mode()
   set-auto-mode-0(outline-mode nil)
   set-auto-mode()
   normal-mode(t)
   after-find-file(nil nil t nil nil)
   revert-buffer--default(nil t)
   revert-buffer(nil t)
 
ask-user-about-supersession-threat("/sshx:jim@remote:~/src/emacs/etc/NEWS")
   tramp-handle-lock-file("/sshx:jim@remote:~/src/emacs/etc/NEWS")
   apply(tramp-handle-lock-file "/sshx:jim@remote:~/src/emacs/etc/NEWS")
   tramp-sh-file-name-handler(lock-file 
"/sshx:jim@remote:~/src/emacs/etc/NEWS")
   apply(tramp-sh-file-name-handler lock-file 
"/sshx:jim@remote:~/src/emacs/etc/NEWS")
   tramp-file-name-handler(lock-file 
"/sshx:jim@remote:~/src/emacs/etc/NEWS")
   newline(nil 1)
   funcall-interactively(newline nil 1)
   command-execute(newline)

----------------------------------------

This might not be the most useful backtrace in the world, but hopefully 
it at least confirms one way this can happen. It's rare enough though 
that I can't reproduce it on command. It does lead me to believe that 
there's a bug with automatically-buffer-local variables, since 
'turn-on-auto-fill' should Just Work here (and it typically does).




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 3 Jul 2023 18:29:11 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 14:29:11 2023
Received: from localhost ([127.0.0.1]:34472 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qGOIR-0001Ai-7w
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 14:29:11 -0400
Received: from eggs.gnu.org ([209.51.188.92]:51444)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qGOIN-0001AI-4a
 for 64439 <at> debbugs.gnu.org; Mon, 03 Jul 2023 14:29:10 -0400
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 <eliz@HIDDEN>)
 id 1qGOIH-0007hm-BU; Mon, 03 Jul 2023 14:29:01 -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=Opm8FhYScX3ymCL+WLjXiLTkTWZHxtxgaUnCoPPMU6I=; b=b7HwA9LV+BuS
 9kG3V1yXmms3mHLGFxhlwz2Wmr+A7NGcoi7mTDguX3Df8g+jbiB2eFF0LVtDqmIxOCc2DWUpp1xvt
 aZr0A9/EXvfgB28OzF9HuKIGazHkOLp8WVKdPJXA9QbkD/nGCf6BJogzzJgaFHCQcHCVf+qMbH0UB
 4d0xjSqy7gzgLAmOqK4fKiysGxrBimTYqkgy9lEpQLO5F3rzd/Y/jIQOuG0GJ6LOYsBFCdj08TIsg
 uxW2I8DUw3zbvukzBAG6KgoVOzcyb2G2lEQTPEsE9lLxSPqjPX0Z1Ly9QC3mbFTQj4VH+VyDdl3gE
 zDwveOQLrnxT2coqlY/wHg==;
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 <eliz@HIDDEN>)
 id 1qGOIG-00047t-R2; Mon, 03 Jul 2023 14:29:01 -0400
Date: Mon, 03 Jul 2023 21:29:38 +0300
Message-Id: <837crgn90u.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: David Howells <dhowells@HIDDEN>
In-Reply-To: <1211099.1688406521@HIDDEN> (message from David
 Howells on Mon, 03 Jul 2023 18:48:41 +0100)
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
 <1211099.1688406521@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64439
Cc: 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> From: David Howells <dhowells@HIDDEN>
> Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
> Date: Mon, 03 Jul 2023 18:48:41 +0100
> 
> Eli Zaretskii <eliz@HIDDEN> wrote:
> 
> > Try evaluating this:
> > 
> >   (defun my-watcher (_symbol new-value operation where)
> >     (error "auto-fill-mode: %s %s %s" new-value operation where))
> >   (add-variable-watcher 'auto-fill-function 'my-watcher)
> >   (debug-on-entry 'my-watcher)
> > 
> > and run your sessions with this.  Whenever auto-fill-mode is turned
> > on, you will get a backtrace.
> 
> I restarted emacs and added the above.  I was editing some C code, pressed
> enter and got:
> 
> 	Debugger entered--entering a function:
> 	* my-watcher(auto-fill-function nil set nil)
> 	  newline(nil 1)
> 	  funcall-interactively(newline nil 1)
> 	  command-execute(newline)

Hmm...

> auto-fill-mode didn't seem to turn on, though

Because the function newline only let-binds auto-fill-function
locally.

I guess tracking down this problem will be harder, then.  I hope I at
least gave you some ideas with which you will be able to construct a
suitable trap and find the culprit.  Good luck!




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 3 Jul 2023 18:14:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 14:14:20 2023
Received: from localhost ([127.0.0.1]:34464 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qGO43-0000nt-ON
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 14:14:19 -0400
Received: from mail-pj1-f42.google.com ([209.85.216.42]:47196)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <jporterbugs@HIDDEN>) id 1qGO40-0000na-Jr
 for 64439 <at> debbugs.gnu.org; Mon, 03 Jul 2023 14:14:18 -0400
Received: by mail-pj1-f42.google.com with SMTP id
 98e67ed59e1d1-2632a72f289so2302415a91.2
 for <64439 <at> debbugs.gnu.org>; Mon, 03 Jul 2023 11:14:16 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=gmail.com; s=20221208; t=1688408050; x=1691000050;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:mime-version:date:message-id:from:to:cc
 :subject:date:message-id:reply-to;
 bh=TVxGwThjAU9ndCfgtilwMsUvQ8k479UCERAfZ3GdzVs=;
 b=S405bU/AAGzyNWYvBitiTLCORUfwW3JDtG5lESHpsJXy04SwILsQOk5WAM9SPJncOt
 jkXYyONlOv5IBKxSAkXejduCy8JWL8BXwhwPmyb194wLV1x425Xynfo8CUzXx1hiBvM8
 9YsUpYkq1l7ws1SRnnlAUiAq0SkigLSuLjo+1620bZ5M9M8m1vmqXqsfhrTlK7IFuZVQ
 nX1TakrMs/D7WpnOC4/EBaD5gTdMZ8BBF3n1lRi/P1JEoR73kidF9nWWOfa40ELkhXRv
 /RWl88RTmezY+hrCJ6LGQ5achILeZfpGeREiDZpOzcZwe1tJxe/MbYW6YcbdPvfsuxIc
 zkzw==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
 d=1e100.net; s=20221208; t=1688408050; x=1691000050;
 h=content-transfer-encoding:in-reply-to:from:references:to
 :content-language:subject:mime-version:date:message-id
 :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to;
 bh=TVxGwThjAU9ndCfgtilwMsUvQ8k479UCERAfZ3GdzVs=;
 b=N19/MB3zxz3QvItVLuQehIU8PuhDZmPKBk6i5SWa76H8iS+lIriP6is7SME0gZFn1J
 dw55esTnSVn2y9g+iNfjGMMTUIQaGdmXiBSFWVNcWcKXLK0IpChulNdWn0P92iFDUgVB
 Fj2flMvQg59Q+DrMhl2ndzvNr9BhOtcOeYDQeqpodC9z109ofGdho67pAvuTl9yj4/RS
 m2cgQkn4gsp4c4TZ4ETGP1qw5i9baG0+QOp9pRnHGE0b6mpNnbhL/Jiqyp5yN7wcQAu1
 R5lQDiD0fDkBdM/roG5VxVsa1/Uj0TVECKvf3BQGuZ5P2tsJVg9vTSEqTjHzREk+liFP
 ecvg==
X-Gm-Message-State: ABy/qLY11yo031g8c5ObHnwrnw8OkcZi0C6aV7b8kwWFpQRrSrztyzxt
 VjLwBJ4JQGZEqnBgrAHpaIA=
X-Google-Smtp-Source: APBJJlEJYDjwTCYTf8ZaxmZACpcGFR3CODYcRlgzdqRvpBJ0YyKb/gs/9Fg6RRwpxEoZM+WHBYPo1A==
X-Received: by 2002:a17:90a:1308:b0:262:fab9:b12 with SMTP id
 h8-20020a17090a130800b00262fab90b12mr9243750pja.45.1688408050269; 
 Mon, 03 Jul 2023 11:14:10 -0700 (PDT)
Received: from [192.168.1.2] (cpe-76-168-148-233.socal.res.rr.com.
 [76.168.148.233]) by smtp.googlemail.com with ESMTPSA id
 10-20020a17090a19ca00b0026104629998sm18738771pjj.43.2023.07.03.11.14.09
 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128);
 Mon, 03 Jul 2023 11:14:09 -0700 (PDT)
Message-ID: <684d9020-84e2-a60c-18e4-b443ed7d16b5@HIDDEN>
Date: Mon, 3 Jul 2023 11:14:10 -0700
MIME-Version: 1.0
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
Content-Language: en-US
To: David Howells <dhowells@HIDDEN>, 64439 <at> debbugs.gnu.org
References: <1034974.1688399705@HIDDEN>
From: Jim Porter <jporterbugs@HIDDEN>
In-Reply-To: <1034974.1688399705@HIDDEN>
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

On 7/3/2023 8:55 AM, David Howells wrote:
> I'm seeing an issue in which auto-fill-mode gets turned on for all the buffers
> in a running emacs instance, including the command entry window (M-x, grep,
> compile, etc.).

I've seen this too actually, but have had a hard time narrowing it down. 
I did something similar to Eli's suggestion a bit ago and did get a 
couple of data points, however:

* First, I have 'turn-on-auto-fill-mode' set on 'text-mode-hook'.

* It only seems to happen for me when a text-mode file was changed 
outside of Emacs, and then I press "r" (refresh) at the Emacs 
supersession prompt. This results in the mode being restarted (I think), 
which in turn calls 'turn-on-auto-fill-mode'. Occasionally, something 
gets messed up, and that function ends up setting the *default* value 
for 'auto-fill-function'.

* I usually notice this on files I'm editing over Tramp, but that might 
not be relevant since I use Tramp very heavily, and maybe I'm just 
getting "lucky".

I'm not sure, but perhaps there's a bug in 'set_internal'? There's some 
code in the 'SYMBOL_LOCALIZED' block of the switch statement in there 
that seems like it could relate to this, but I haven't had time to dig 
much into this, so that could be a red herring...

> In both cases, the emacs instances are typically running for multiple weeks
> till I need to reboot - or the issue becomes sufficiently irritating that I
> restart emacs.

Something like "(setq-default auto-fill-function nil)" should fix your 
Emacs session.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 3 Jul 2023 17:48:48 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 13:48:48 2023
Received: from localhost ([127.0.0.1]:34434 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qGNfL-0000AK-T4
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 13:48:48 -0400
Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:46936)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dhowells@HIDDEN>) id 1qGNfI-0000A8-2B
 for 64439 <at> debbugs.gnu.org; Mon, 03 Jul 2023 13:48:46 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1688406523;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 in-reply-to:in-reply-to:references:references;
 bh=TmMz/s7NwJtN1sFfBP4btE7VUdnqAopDF7LC/FwjZk8=;
 b=X1S69Bdaj0oYQTij3C+gZbnCXL5Um0rdDwoHvMVgicg19wJNItO8kPR5Mm3TvWX/2oYLgp
 I44TVbL9TSPp6dFfYKHOiJI7M1eR5idCS8wSHDt/Xj2U5y6SECVZLBXuiaUqcH8Pz2Wi1B
 B/0rQ0jzIWR6TWvDnOB0f8lTiLIjGEA=
Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com
 [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-600-sfWdE0s1Nm2aXDZ3oGrJnQ-1; Mon, 03 Jul 2023 13:48:42 -0400
X-MC-Unique: sfWdE0s1Nm2aXDZ3oGrJnQ-1
Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com
 [10.11.54.9])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 0EDC685A58A;
 Mon,  3 Jul 2023 17:48:42 +0000 (UTC)
Received: from warthog.procyon.org.uk (unknown [10.42.28.195])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 9DF43492B01;
 Mon,  3 Jul 2023 17:48:41 +0000 (UTC)
Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley
 Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United
 Kingdom.
 Registered in England and Wales under Company Registration No. 3798903
From: David Howells <dhowells@HIDDEN>
In-Reply-To: <83h6qlm0oc.fsf@HIDDEN>
References: <83h6qlm0oc.fsf@HIDDEN>
 <1034974.1688399705@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
MIME-Version: 1.0
Date: Mon, 03 Jul 2023 18:48:41 +0100
Message-ID: <1211099.1688406521@HIDDEN>
X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1211098.1688406520.1@HIDDEN>
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 64439
Cc: dhowells@HIDDEN, 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -1.0 (-)

Eli Zaretskii <eliz@HIDDEN> wrote:

> Try evaluating this:
> 
>   (defun my-watcher (_symbol new-value operation where)
>     (error "auto-fill-mode: %s %s %s" new-value operation where))
>   (add-variable-watcher 'auto-fill-function 'my-watcher)
>   (debug-on-entry 'my-watcher)
> 
> and run your sessions with this.  Whenever auto-fill-mode is turned
> on, you will get a backtrace.

I restarted emacs and added the above.  I was editing some C code, pressed
enter and got:

	Debugger entered--entering a function:
	* my-watcher(auto-fill-function nil set nil)
	  newline(nil 1)
	  funcall-interactively(newline nil 1)
	  command-execute(newline)

auto-fill-mode didn't seem to turn on, though - I'm not sure if that's to be
expected.  It's also not the first time I pressed enter in that buffer.

David





Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at 64439 <at> debbugs.gnu.org:


Received: (at 64439) by debbugs.gnu.org; 3 Jul 2023 16:14:47 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 12:14:47 2023
Received: from localhost ([127.0.0.1]:34362 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qGMCN-0005xi-4k
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 12:14:47 -0400
Received: from eggs.gnu.org ([209.51.188.92]:53948)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <eliz@HIDDEN>) id 1qGMCL-0005xU-Te
 for 64439 <at> debbugs.gnu.org; Mon, 03 Jul 2023 12:14:46 -0400
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 <eliz@HIDDEN>)
 id 1qGMCG-0001VM-FJ; Mon, 03 Jul 2023 12:14:40 -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=yaTfC+EgvgtwnpEUzYnCL4KFCsW7t8nzstb0Z3R/Kw4=; b=RgD92UxAySNU
 GTPUwwJ9/U/qIfoZedvtvp+UD6ffpaR8XEpCtswiQDWVZj1YAWW7T7rN3MxXynHdXmEeqenx/xc61
 27s4l+tJ7M57BPvtYckXEufCI3KEaMxh8NjATblCOlUBnt0d4s7UjDvd7TZBrvNVIIhd7SQf1bWLI
 NmgLY4wbFbnI06NLnZhAM0Di30YgQduYLjDiR0jbYDllm5pMvxEqfXtRlcyAxewbs9f1XFe3psXvk
 qyLUDMzASYWSzKPB8FrleZi38PfgxMbqRphm9ihZdlW2XUOo+LxX+Er4t9TDPwjTfrD9kJ+03oTsR
 qR3fjLJRyuj/w4n3nPIrDQ==;
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 <eliz@HIDDEN>)
 id 1qGMCE-0004oN-OB; Mon, 03 Jul 2023 12:14:40 -0400
Date: Mon, 03 Jul 2023 19:15:15 +0300
Message-Id: <83h6qlm0oc.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: David Howells <dhowells@HIDDEN>
In-Reply-To: <1034974.1688399705@HIDDEN> (message from David
 Howells on Mon, 03 Jul 2023 16:55:05 +0100)
Subject: Re: bug#64439: 28.2; auto-fill-mode gets turned on all over the place
References: <1034974.1688399705@HIDDEN>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 64439
Cc: 64439 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -3.3 (---)

> Cc: dhowells@HIDDEN
> From: David Howells <dhowells@HIDDEN>
> Date: Mon, 03 Jul 2023 16:55:05 +0100
> 
> I'm seeing an issue in which auto-fill-mode gets turned on for all the buffers
> in a running emacs instance, including the command entry window (M-x, grep,
> compile, etc.).  This is a problem as it starts mangling the code I'm working
> on and making it harder to enter long commands (such as grep or compile
> commands).  I can turn it off manually on most buffers (though not the command
> window), but it immediately turns back on in a buffer if I have to reload it.
> 
> The problem has happened in several emacs instances now.  It shows up in the
> instances I've been using to edit C code and view patches.  It takes a little
> while for the problem to manifest when it does.  I'm not sure what triggers
> it.

Try evaluating this:

  (defun my-watcher (_symbol new-value operation where)
    (error "auto-fill-mode: %s %s %s" new-value operation where))
  (add-variable-watcher 'auto-fill-function 'my-watcher)
  (debug-on-entry 'my-watcher)

and run your sessions with this.  Whenever auto-fill-mode is turned
on, you will get a backtrace.  If you turn this mode yourself, and
don't want to be annoyed by entering the debugger each time, remove
the last line from the recipe: then you will just see a message when
auto-fill-mode is turned on, and will need to investigate which code
did that.




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 3 Jul 2023 15:56:26 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Mon Jul 03 11:56:26 2023
Received: from localhost ([127.0.0.1]:34323 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1qGLub-0005Px-9K
	for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 11:56:25 -0400
Received: from lists.gnu.org ([209.51.188.17]:45892)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <dhowells@HIDDEN>) id 1qGLuV-0005Pc-Jd
 for submit <at> debbugs.gnu.org; Mon, 03 Jul 2023 11:56:23 -0400
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 <dhowells@HIDDEN>)
 id 1qGLuV-0000mo-B8
 for bug-gnu-emacs@HIDDEN; Mon, 03 Jul 2023 11:56:19 -0400
Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <dhowells@HIDDEN>)
 id 1qGLuS-0004Df-VA
 for bug-gnu-emacs@HIDDEN; Mon, 03 Jul 2023 11:56:19 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com;
 s=mimecast20190719; t=1688399775;
 h=from:from:reply-to:subject:subject:date:date:message-id:message-id:
 to:to:cc:cc:mime-version:mime-version:content-type:content-type:
 content-transfer-encoding:content-transfer-encoding;
 bh=mZ20rnAU2qPrf+3qf4MW9STfw8KxUZg/3jMMrYA2zsA=;
 b=cuLjCwtR4Qhtw3Q/+tx/BLislui2ksgzMYvYz1j2J3aKLal2zbOyrd/E3P5deE1m7jcWSL
 ScwUHTd9snRfOS1xNu0EuqL5QVmsJ4U8MkMptkEZV9bIoSlPzeV2AJ3uTOG/4Ft43YMnsp
 4+Xe9XHLBBDfq8ZmWhuSzfADuhQuapI=
Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com
 [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS
 (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id
 us-mta-180-G_bq-PQ0O6aad46boxkgBA-1; Mon, 03 Jul 2023 11:55:06 -0400
X-MC-Unique: G_bq-PQ0O6aad46boxkgBA-1
Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.rdu2.redhat.com
 [10.11.54.1])
 (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
 (No client certificate requested)
 by mimecast-mx02.redhat.com (Postfix) with ESMTPS id A72C68910FA
 for <bug-gnu-emacs@HIDDEN>; Mon,  3 Jul 2023 15:55:06 +0000 (UTC)
Received: from warthog.procyon.org.uk (unknown [10.42.28.195])
 by smtp.corp.redhat.com (Postfix) with ESMTP id 4506240C2063;
 Mon,  3 Jul 2023 15:55:06 +0000 (UTC)
Organization: Red Hat UK Ltd. Registered Address: Red Hat UK Ltd, Amberley
 Place, 107-111 Peascod Street, Windsor, Berkshire, SI4 1TE, United
 Kingdom.
 Registered in England and Wales under Company Registration No. 3798903
From: David Howells <dhowells@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 28.2; auto-fill-mode gets turned on all over the place
MIME-Version: 1.0
Date: Mon, 03 Jul 2023 16:55:05 +0100
Message-ID: <1034974.1688399705@HIDDEN>
X-Scanned-By: MIMEDefang 3.1 on 10.11.54.1
X-Mimecast-Spam-Score: 0
X-Mimecast-Originator: redhat.com
Content-Type: text/plain; charset="us-ascii"
Content-ID: <1034973.1688399705.1@HIDDEN>
Content-Transfer-Encoding: quoted-printable
Received-SPF: pass client-ip=170.10.129.124; envelope-from=dhowells@HIDDEN;
 helo=us-smtp-delivery-124.mimecast.com
X-Spam_score_int: -20
X-Spam_score: -2.1
X-Spam_bar: --
X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.001,
 DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H4=0.001, RCVD_IN_MSPIKE_WL=0.001,
 SPF_HELO_NONE=0.001, SPF_PASS=-0.001,
 T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: -1.4 (-)
X-Debbugs-Envelope-To: submit
Cc: dhowells@HIDDEN
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: -2.4 (--)

Hi,

I'm seeing an issue in which auto-fill-mode gets turned on for all the buff=
ers
in a running emacs instance, including the command entry window (M-x, grep,
compile, etc.).  This is a problem as it starts mangling the code I'm worki=
ng
on and making it harder to enter long commands (such as grep or compile
commands).  I can turn it off manually on most buffers (though not the comm=
and
window), but it immediately turns back on in a buffer if I have to reload i=
t.

The problem has happened in several emacs instances now.  It shows up in th=
e
instances I've been using to edit C code and view patches.  It takes a litt=
le
while for the problem to manifest when it does.  I'm not sure what triggers
it.

It doesn't, however, happen in the emacs instances I've been using to read =
my
mail with MH and edit occasional text files on the same system.

In both cases, the emacs instances are typically running for multiple weeks
till I need to reboot - or the issue becomes sufficiently irritating that I
restart emacs.

Thanks,
David


In GNU Emacs 28.2 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.37, =
cairo version 1.17.8)
 of 2023-05-02 built on 0cdeb17096554a4c83d448c2d2754877
Windowing system distributor 'The X.Org Foundation', version 11.0.12014000
System Description: Fedora Linux 39 (Rawhide Prerelease)

Configured using:
 'configure --build=3Dx86_64-redhat-linux-gnu --host=3Dx86_64-redhat-linux-=
gnu
 --program-prefix=3D --disable-dependency-tracking --prefix=3D/usr
 --exec-prefix=3D/usr --bindir=3D/usr/bin --sbindir=3D/usr/sbin --sysconfdi=
r=3D/etc
 --datadir=3D/usr/share --includedir=3D/usr/include --libdir=3D/usr/lib64
 --libexecdir=3D/usr/libexec --localstatedir=3D/var --runstatedir=3D/run
 --sharedstatedir=3D/var/lib --mandir=3D/usr/share/man --infodir=3D/usr/sha=
re/info
 --with-dbus --with-gif --with-jpeg --with-png --with-rsvg --with-tiff
 --with-xpm --with-x-toolkit=3Dgtk3 --with-gpm=3Dno --with-xwidgets --with-=
modules
 --with-harfbuzz --with-cairo --with-json --with-native-compilation
 build_alias=3Dx86_64-redhat-linux-gnu host_alias=3Dx86_64-redhat-linux-gnu=
 CC=3Dgcc
 'CFLAGS=3D-DMAIL_USE_LOCKF -O2 -flto=3Dauto -ffat-lto-objects -fexceptions=
 -g
 -grecord-gcc-switches -pipe -Wall -Werror=3Dformat-security
 -Wp,-U_FORTIFY_SOURCE,-D_FORTIFY_SOURCE=3D3 -Wp,-D_GLIBCXX_ASSERTIONS
 -specs=3D/usr/lib/rpm/redhat/redhat-hardened-cc1 -fstack-protector-strong
 -specs=3D/usr/lib/rpm/redhat/redhat-annobin-cc1 -m64 -mtune=3Dgeneric
 -fasynchronous-unwind-tables -fstack-clash-protection -fcf-protection
 -fno-omit-frame-pointer -mno-omit-leaf-frame-pointer ' LDFLAGS=3D-Wl,-z,re=
lro
 PKG_CONFIG_PATH=3D:/usr/lib64/pkgconfig:/usr/share/pkgconfig'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GSETTINGS HARFBUZZ JPEG JSON
LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2 M17N_FLT MODULES NATIVE_COMP NOTIFY
INOTIFY PDUMPER PNG RSVG SECCOMP SOUND THREADS TIFF TOOLKIT_SCROLL_BARS X11
XDBE XIM XPM XWIDGETS GTK3 ZLIB

Important settings:
  value of $LANG: en_GB.UTF-8
  value of $XMODIFIERS: @im=3Dnone
  locale-coding-system: utf-8-unix

Major mode: Diff

Minor modes in effect:
  shell-dirtrack-mode: t
  display-time-mode: t
  tooltip-mode: t
  global-eldoc-mode: t
  show-paren-mode: t
  electric-indent-mode: t
  mouse-wheel-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  auto-fill-function: do-auto-fill
  indent-tabs-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message puny dired dired-loaddefs rfc822 mm=
l
mml-sec epa derived epg rfc6068 epg-config gnus-util rmail rmail-loaddefs
auth-source eieio eieio-core eieio-loaddefs password-cache json map mm-deco=
de
mm-bodies mm-encode mail-parse rfc2231 mailabbrev gmm-utils mailheader
sendmail rfc2047 rfc2045 ietf-drums mm-util mail-prsvr mail-utils face-rema=
p
make-mode help-fns radix-tree cl-print debug backtrace find-func conf-mode
vc-annotate vc-mtn vc-hg vc-bzr vc-src vc-sccs vc-svn vc-cvs vc-rcs add-log
log-view pcvs-util vc rect smerge-mode diff pulse color rmc etags fileloop
generator xref project hippie-exp misearch multi-isearch shell pcomplete
thingatpt files-x grep compile text-property-search comint ansi-color ring
time-date jka-compr vc-git vc-dispatcher cc-mode cc-fonts cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs comp comp-cstr warning=
s
subr-x rx cl-seq cl-macs cl-extra help-mode seq byte-opt gv cl-loaddefs cl-=
lib
bytecomp byte-compile cconv diff-mode easy-mmode time iso-transl tooltip el=
doc
paren electric uniquify ediff-hook vc-hooks lisp-float-type elisp-mode mwhe=
el
term/x-win x-win term/common-win x-dnd tool-bar dnd fontset image regexp-op=
t
fringe tabulated-list replace newcomment text-mode lisp-mode prog-mode
register page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors frame
minibuffer cl-generic cham georgian utf-8-lang misc-lang vietnamese tibetan
thai tai-viet lao korean japanese eucjp-ms cp51932 hebrew greek romanian
slovak czech european ethiopic indian cyrillic chinese composite emoji-zwj
charscript charprop case-table epa-hook jka-cmpr-hook help simple abbrev
obarray cl-preloaded nadvice button loaddefs faces cus-face macroexp files
window text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget hashtable-print-readable backquote threads xwidget-internal
dbusbind inotify dynamic-setting system-font-setting font-render-setting ca=
iro
move-toolbar gtk x-toolkit x multi-tty make-network-process native-compile
emacs)

Memory information:
((conses 16 858994 53275)
 (symbols 48 17882 0)
 (strings 32 99037 4596)
 (string-bytes 1 5475389)
 (vectors 16 30928)
 (vector-slots 8 670739 45813)
 (floats 8 146 348)
 (intervals 56 136420 2641)
 (buffers 992 115))





Acknowledgement sent to David Howells <dhowells@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#64439; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Tue, 11 Jul 2023 11:45:02 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.