GNU bug report logs - #78180
31.0.50; Since ab71699e5f2, global value of post-command-hook is useless

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: Ihor Radchenko <yantar92@HIDDEN>; Done: Eli Zaretskii <eliz@HIDDEN>; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 78180-done <at> debbugs.gnu.org:


Received: (at 78180-done) by debbugs.gnu.org; 17 May 2025 08:04:29 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat May 17 04:04:28 2025
Received: from localhost ([127.0.0.1]:45118 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uGCWy-0003k2-H1
	for submit <at> debbugs.gnu.org; Sat, 17 May 2025 04:04:28 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:48428)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uGCWv-0003jf-At
 for 78180-done <at> debbugs.gnu.org; Sat, 17 May 2025 04:04:26 -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 1uGCWp-0006s1-R4; Sat, 17 May 2025 04:04:20 -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=g14OCLD1NCjYGof5Nls7IS3wc1NgH046mLdMCk0nzeI=; b=dUAVCDkr4JPQEDNi9Vdk
 GIdbLEiBdngpRg6vWHTdMurwNvXqapDMz0vHweuPvQdlKQYmb/BKUlRxEzGevtF3a4s6axSsjZYV4
 h0AttjqE49wUKhPILGrCNCj7jFN6N5LK50xx3jCCBJrHNz+ChJjqFG/lD8EcWQjFI18unMC31H6BS
 A5m5FyU7XHxMWsan04SL5fIJ9Ex0MDfu7QPDmWVfS+kW3Z39T+S4dTJp1RWrCWYlTlKr7pdxog68s
 /G/ztnfPrFRWa0y6QlImenuCQ/iAFSBXFN1+MJ9ledh/yvUu0WHd2BrzBHCfB7mcqjPtc/GuZJcI4
 Hh6I5Z4xjSI7ow==;
Date: Sat, 17 May 2025 11:04:15 +0300
Message-Id: <86r00nwtmo.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87cycr7ban.fsf@localhost> (message from Ihor Radchenko on Fri,
 02 May 2025 06:54:08 +0000)
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN>
 <87ikmk6vgq.fsf@localhost> <87y0vf21kq.fsf@HIDDEN> <87cycr7ban.fsf@localhost>
MIME-version: 1.0
Content-type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180-done
Cc: michael_heerdegen@HIDDEN, 78180-done <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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: Eli Zaretskii <eliz@HIDDEN>, 78180 <at> debbugs.gnu.org
> Date: Fri, 02 May 2025 06:54:08 +0000
> 
> Michael Heerdegen <michael_heerdegen@HIDDEN> writes:
> 
> > Just to be sure: you are aware that in the normal case the global hook
> > binding will always be executed (additionally), as long as the symbol t
> > is not removed from the local hook binding, as explained in
> > (info "(elisp) Setting Hooks")?
> 
> I was not aware! That's embarrassing.
> 
> Now, I see
> 
>      If the hook variable is buffer-local, the buffer-local variable
>      will be used instead of the global variable.  However, if the
>      buffer-local variable contains the element ‘t’, the global hook
>      variable will be run as well.
> 
> IMHO, that detail might look good in 24.1 Hooks section itself, as it
> appears to be important. But maybe it is just me who did not notice
> this.
> 
> In any case, there is no bug in what I reported. Just my
> misunderstanding. Feel free to close.

No further comments, so I'm now closing this bug.




Notification sent to Ihor Radchenko <yantar92@HIDDEN>:
bug acknowledged by developer. Full text available.
Reply sent to Eli Zaretskii <eliz@HIDDEN>:
You have taken responsibility. Full text available.

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


Received: (at 78180) by debbugs.gnu.org; 2 May 2025 15:33:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 02 11:33:22 2025
Received: from localhost ([127.0.0.1]:60557 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAsOA-00023P-26
	for submit <at> debbugs.gnu.org; Fri, 02 May 2025 11:33:22 -0400
Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:31139)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <monnier@HIDDEN>)
 id 1uAsO7-000239-6j
 for 78180 <at> debbugs.gnu.org; Fri, 02 May 2025 11:33:20 -0400
Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 981F6441816;
 Fri,  2 May 2025 11:33:12 -0400 (EDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca;
 s=mail; t=1746199991;
 bh=Ky6y90oRlfhpkWh/SylzIS8JPxmMlNIi24Tp6J//FvI=;
 h=From:To:Cc:Subject:In-Reply-To:References:Date:From;
 b=Mkyuw32Z+Fj6Q2eZ7WBLvJmN1lX2qiBuu+nl7WP2rebXkkcFTNNmfq7DNbkow001E
 RGQy7+HyGfNAfQ+o5T4CpYAAgp4Z4UHov8dmFtRLSr7VQClV7BnZabzxIpgqo4WC0n
 d+i1g/Eyj0t1e5QNMXeyCP5qJewTiveLhw8uD0uyhC0E6jSVEVatvEpF4RBMX9VLE0
 RNrq1amTSu1sGzodMQTCyFQ92zlnDCRxG2NwR9RaDSfiDaRwFLZfdqy8rYYAYWosri
 HSN7awQUg8plBNeR9lJ2i4u/m9eEZIqT4sruT4mKGAsWdRoekSTeeafu9EUARAY2pY
 2GZGQxpWNkHBg==
Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1])
 by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 18AD8441808;
 Fri,  2 May 2025 11:33:11 -0400 (EDT)
Received: from alfajor (unknown [23.233.149.155])
 by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id DA0D3120211;
 Fri,  2 May 2025 11:33:10 -0400 (EDT)
From: Stefan Monnier <monnier@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
In-Reply-To: <86cycrmtuh.fsf@HIDDEN>
Message-ID: <jwvy0vfuixm.fsf-monnier+emacs@HIDDEN>
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN>
 <87ikmk6vgq.fsf@localhost> <86cycrmtuh.fsf@HIDDEN>
Date: Fri, 02 May 2025 11:33:10 -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.210 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
X-SPAM-LEVEL: 
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <at> debbugs.gnu.org, Ihor Radchenko <yantar92@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 (---)

>> The problem is rather simple - some of Org's tests make an assumption
>> that the value of `post-command-hook' is its global value in Org
>> buffers. It is no longer the case after ab71699e5f2.
> Isn't that a wrong assumption?  A global minor mode can legitimately
> invalidate it, right?

+1


        Stefan





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

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


Received: (at 78180) by debbugs.gnu.org; 2 May 2025 06:55:22 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 02 02:55:22 2025
Received: from localhost ([127.0.0.1]:55889 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAkIp-0003t2-7E
	for submit <at> debbugs.gnu.org; Fri, 02 May 2025 02:55:22 -0400
Received: from mout02.posteo.de ([185.67.36.66]:55179)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1uAkIj-0003ob-6e
 for 78180 <at> debbugs.gnu.org; Fri, 02 May 2025 02:55:16 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id F079D240101
 for <78180 <at> debbugs.gnu.org>; Fri,  2 May 2025 08:55:05 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1746168905; bh=4o+75th6Wtc3KyHJ/S+SBY8lNBm0fo58DlC6m/8jxfQ=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 Content-Transfer-Encoding:From;
 b=RJYgml5Dt+CebZLQ1XmUFUibkxVEp5CeXpYMe3OEyJOecC1RMnYIyRCqPlF1ZPxUh
 fYxHtXH0TtI+61pgRirB3TYjoS66Q2v+dtONR6vEyCAcgjBIIqNPabOYB4beNhLufh
 rm1Z+556CaPFfARIW5CJnbmn2XbEIZjfWdvKoN2VCtAvwAZ9J6woMk+ygOg1NeTCee
 HP6Y+MVlx+fMa6FHCEu9LcCcLQBUta7vshO8iUA+bzcE5xizGkTqOzqdpjnhOYkQId
 HkaVX++0HRtAXfb8Rfsdupc4qWqmHR7qXl6bwmLImJr+kcjkijmltbDSNRfEr+dP39
 g9caOeU+4lQiQ==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ZphWF2bT4z6twR;
 Fri,  2 May 2025 08:55:05 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Michael Heerdegen <michael_heerdegen@HIDDEN>
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
In-Reply-To: <87y0vf21kq.fsf@HIDDEN>
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN>
 <87ikmk6vgq.fsf@localhost> <87y0vf21kq.fsf@HIDDEN>
Date: Fri, 02 May 2025 06:54:08 +0000
Message-ID: <87cycr7ban.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <at> debbugs.gnu.org, Eli Zaretskii <eliz@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 (---)

Michael Heerdegen <michael_heerdegen@HIDDEN> writes:

> Just to be sure: you are aware that in the normal case the global hook
> binding will always be executed (additionally), as long as the symbol t
> is not removed from the local hook binding, as explained in
> (info "(elisp) Setting Hooks")?

I was not aware! That's embarrassing.

Now, I see

     If the hook variable is buffer-local, the buffer-local variable
     will be used instead of the global variable.  However, if the
     buffer-local variable contains the element =E2=80=98t=E2=80=99, the gl=
obal hook
     variable will be run as well.

IMHO, that detail might look good in 24.1 Hooks section itself, as it
appears to be important. But maybe it is just me who did not notice
this.

In any case, there is no bug in what I reported. Just my
misunderstanding. Feel free to close.

--=20
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 78180) by debbugs.gnu.org; 2 May 2025 06:05:09 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Fri May 02 02:05:09 2025
Received: from localhost ([127.0.0.1]:55701 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAjWG-00017L-HJ
	for submit <at> debbugs.gnu.org; Fri, 02 May 2025 02:05:08 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:36502)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uAjWC-00014u-PB
 for 78180 <at> debbugs.gnu.org; Fri, 02 May 2025 02:05:06 -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 1uAjW7-0003LB-8J; Fri, 02 May 2025 02:04:59 -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=JzKOqDujNDPcfVff2XScyOK2KnEW/n8zvhxnKIeSeoE=; b=WEDoZI3/0Gn2
 SIYV2nL6fBYeb+BdALqeBE2YqsO12wcul6kjo08sw8/buByK6dzuaOIq5WM5iWaaleBrij3RyjLjJ
 2OylDw6MH7R23l0A+UMfHjZ4n34hMM/cY5S09zfiShePUGIxWNs6NzCDt/dydQDxndmoknFptykiE
 uyYF4+F+CPe1WCPZP3wacGctZ27/1ZOdaiCNZ9RfTnmKTSdh8WDS79yGIv0gW0BDXmW/twMVLu8KU
 3i6hYNeOnKvR+foPTwcPo09JecKZzzh0LQRucsb1qsEI7brY4AeKhOW2NIDHuMsn6NvEKCDh8F4o7
 UHN4Mt92zBiGqZ9L5TpcuA==;
Date: Fri, 02 May 2025 09:04:22 +0300
Message-Id: <86cycrmtuh.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>,
 Stefan Monnier <monnier@HIDDEN>
In-Reply-To: <87ikmk6vgq.fsf@localhost> (message from Ihor Radchenko on Thu,
 01 May 2025 18:23:49 +0000)
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN> <87ikmk6vgq.fsf@localhost>
X-Spam-Score: -0.0 (/)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: 78180 <at> debbugs.gnu.org
> Date: Thu, 01 May 2025 18:23:49 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > May I suggest that you first describe the actual problem you bumped
> > into?
> 
> The problem is rather simple - some of Org's tests make an assumption
> that the value of `post-command-hook' is its global value in Org
> buffers. It is no longer the case after ab71699e5f2.

Isn't that a wrong assumption?  A global minor mode can legitimately
invalidate it, right?

Stefan, am I missing something here?

> What else _might_ be a problem (but I am a bit lost in how things work
> here) is direct invocations of (run-hooks 'post-command-hook) from
> Elisp: in ert-x.el, gnus-msg.el, org-mouse.el. AFAIU, such calls will
> only execute buffer-local post-comman-hook, not global. Maybe I miss
> something.

See Michael's response, I think he answered this.




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

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


Received: (at 78180) by debbugs.gnu.org; 2 May 2025 02:21:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 22:21:43 2025
Received: from localhost ([127.0.0.1]:54818 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAg23-0005gn-HU
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 22:21:43 -0400
Received: from mout.web.de ([212.227.17.12]:44493)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <michael_heerdegen@HIDDEN>)
 id 1uAg1z-0005gW-HB
 for 78180 <at> debbugs.gnu.org; Thu, 01 May 2025 22:21:41 -0400
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de;
 s=s29768273; t=1746152483; x=1746757283;
 i=michael_heerdegen@HIDDEN;
 bh=CkmY0pfrC5T9QagQ8ttTAueswT5egMhwj2yp7KHYVrA=;
 h=X-UI-Sender-Class:From:To:Cc:Subject:In-Reply-To:References:Date:
 Message-ID:MIME-Version:Content-Type:cc:content-transfer-encoding:
 content-type:date:from:message-id:mime-version:reply-to:subject:
 to;
 b=aoz7HQIH9DFxCPgG1BZ5UoLFvY8n2IBmQtHy//C6q+B5bpTvnnYO1z+oJOG05O6n
 tyyToQpwUap6OsdRq/PtaAcNcFMt/UR/U1LE/UgyhULqg0/5EOcon42ZEdKjttrDx
 4Pky9P8biOnxjD2MVwTxrc70tcYg4tPBTeVhzzJvInthGNiHJu2rA2e1eoCXoph9d
 qDTAYIVurXS3bfwb2v8A9BUlO4i60WCVzCaasvjPehXg+3GhuAGieogzxKHHVw90m
 fxt3KxBT8cQt0PL/jXPAiuMoZ2cs7vEQ3Jg1eW46t0bghWy0/LgaMQ2ZD8ax39E9D
 iyiOCj2UJtWXf65Yog==
X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6
Received: from drachen.dragon ([88.66.201.164]) by smtp.web.de (mrweb105
 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Mfc4g-1uhozb0ZbM-00a147; Fri, 02
 May 2025 04:21:23 +0200
From: Michael Heerdegen <michael_heerdegen@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
In-Reply-To: <87ikmk6vgq.fsf@localhost>
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN>
 <87ikmk6vgq.fsf@localhost>
Date: Fri, 02 May 2025 04:23:01 +0200
Message-ID: <87y0vf21kq.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13)
MIME-Version: 1.0
Content-Type: text/plain
X-Provags-ID: V03:K1:bJxFBmd03hDvnZPHF2d6ordZt41KxBrmXrfEZ1BNuVHk8D9GcfT
 KTdddRKypYRbM5Qj2By0kv0HEnr0GET8uzXzBnYyds96Wknk86N461bjDk8HN98p4+Hgau2
 zLlu5GjJXJ+8TX0YuHIsFZlQYhXrXUQTDhZ+B1tBIl5xvMS1woTRjRLmh92UE0h4XJ6vuAz
 jY6i+k7IQvY7gA+SNGuJw==
X-Spam-Flag: NO
UI-OutboundReport: notjunk:1;M01:P0:d8h7N1mKiVU=;jZux725AxbmQ1hjKJDYwE3AScTB
 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
X-Spam-Score: -0.7 (/)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <at> debbugs.gnu.org, Eli Zaretskii <eliz@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.7 (-)

Ihor Radchenko <yantar92@HIDDEN> writes:

> What else _might_ be a problem (but I am a bit lost in how things work
> here) is direct invocations of (run-hooks 'post-command-hook) from
> Elisp: in ert-x.el, gnus-msg.el, org-mouse.el. AFAIU, such calls will
> only execute buffer-local post-comman-hook, not global. Maybe I miss
> something.

Just to be sure: you are aware that in the normal case the global hook
binding will always be executed (additionally), as long as the symbol t
is not removed from the local hook binding, as explained in
(info "(elisp) Setting Hooks")?


Michael.




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

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


Received: (at 78180) by debbugs.gnu.org; 1 May 2025 18:24:56 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 14:24:56 2025
Received: from localhost ([127.0.0.1]:53123 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAYad-00036B-VC
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 14:24:56 -0400
Received: from mout01.posteo.de ([185.67.36.65]:52323)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1uAYaa-00035u-Ez
 for 78180 <at> debbugs.gnu.org; Thu, 01 May 2025 14:24:53 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 3D7F7240027
 for <78180 <at> debbugs.gnu.org>; Thu,  1 May 2025 20:24:46 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1746123886; bh=quSv2kXO54qjDmGyAv2lzuohFyiGR9zFDKb9SLRxJXg=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=RqWx0sLjepMEPuC4zgDiODBfo0gaIJKWCfcinAADtPL4/EmIH7GqKFTKu9YE55wdq
 CV4Vm+x0G3F2wtACpQ4iJqSLgWXjrvjxZXv3eKu35kbBknPmxY9ncsiD+CHdHSzrqS
 MJpeexqM7E5ItvY7GBy0laD49ptaZxf41HGpHA8CUIJOdMBGWsAIbVGKfxOiILlD3f
 LKJvkvPq5RHxQx+DFadeZLfO4vWthWuZJJjo/zbDwciUcYqU6r86mfsws9t6sQKdYa
 m6P/ioTa/J56EX+dpBH5q9iEkf48d2/F/XrLc6z+pewHtrtJvn9+Lx9aXAK+feQMHD
 w3IHJBSEw+Qfw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ZpMsT3sJqz6v0w;
 Thu,  1 May 2025 20:24:45 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
In-Reply-To: <86ecx8mccx.fsf@HIDDEN>
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost> <86ecx8mccx.fsf@HIDDEN>
Date: Thu, 01 May 2025 18:23:49 +0000
Message-ID: <87ikmk6vgq.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

>> rather that pretty much every single buffer will have a buffer-local
>> value that is shadowing the global value set by add-hook without LOCAL
>> arg.
>
> But only for the eldoc hook, right?  Because if not, I still don't
> understand what you are saying.

Sorry, but I do not understand your question.

>> Although, I now tested things more rigorously, and post-command-hook
>> does get evaluated, despite the above. So, I clearly miss something
>> about how and in which context post-command-hook is evaluated.
>
> May I suggest that you first describe the actual problem you bumped
> into?

The problem is rather simple - some of Org's tests make an assumption
that the value of `post-command-hook' is its global value in Org
buffers. It is no longer the case after ab71699e5f2.

When I was investigating the test failures, I thought that the problem
might be much more far-reaching than a simple test breaking. That's why
this bug report, and not the trivial fix of the tests.

>> 4. Create a new buffer C-x b new RET
>> 5. M-: post-command-hook RET
>>    
>>    (eldoc-schedule-timer t)   
>
> So the problem is that buffer-local hooks now have
> eldoc-schedule-timer added?  Is that the only problem?  And if so, why
> is it a problem?  Surely, there are gazillion of use cases in Emacs
> where many buffers have buffer-local post-command-hook different from
> the global value; why is it a problem in this case (or in all those
> cases)?

Well. First, I thought that it is a problem because presence of
buffer-local value preventing globally added hooks to be executed. It is
not a problem (for some reason I don't fully understand).

What else _might_ be a problem (but I am a bit lost in how things work
here) is direct invocations of (run-hooks 'post-command-hook) from
Elisp: in ert-x.el, gnus-msg.el, org-mouse.el. AFAIU, such calls will
only execute buffer-local post-comman-hook, not global. Maybe I miss
something.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 78180) by debbugs.gnu.org; 1 May 2025 18:10:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 14:10:07 2025
Received: from localhost ([127.0.0.1]:53074 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAYMJ-0002Mm-1V
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 14:10:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:40182)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uAYMF-0002KE-Oy
 for 78180 <at> debbugs.gnu.org; Thu, 01 May 2025 14:10:05 -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 1uAYM4-0002y3-EN; Thu, 01 May 2025 14:09:57 -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=TDOqCF8fucG/svEYWLaR9wud5cCOc/VNgJpg1IyVVPE=; b=AyF8WOqHh0Sl
 3NrzU8zvwxp6IFV2RzOi1j54YWR0tP56W4ixobM1/XRtjROiv0XMKZkbIRKGtREcQTBwdJ48N/UIT
 2MujKHas4ZMkMuFYh4nPj5cZyoFkJIyTAH9bkKPUH1OCqLPIKSUHnxyjXtkqomuSOPhc7sfQUamZa
 tGDcoWxF4cx4zerXWn0hRhWbjiXke2uZbj33fps3f/PTVfM2vNx3UlEHICOn4F7TS9qR67dJ16ZF0
 XygE+xYu1jkRgWSnLdl31MLC1GoO4S2ENBXEA+x8IZLz2sva/uwUp26e1xn6u2S6jjFjkJWp2t4vo
 1flaGDmW+GKeI5zoNuT8fg==;
Date: Thu, 01 May 2025 21:09:50 +0300
Message-Id: <86ecx8mccx.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87o6wc6wye.fsf@localhost> (message from Ihor Radchenko on Thu,
 01 May 2025 17:51:37 +0000)
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
 <87o6wc6wye.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <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: Ihor Radchenko <yantar92@HIDDEN>
> Cc: 78180 <at> debbugs.gnu.org
> Date: Thu, 01 May 2025 17:51:37 +0000
> 
> Eli Zaretskii <eliz@HIDDEN> writes:
> 
> > Please explain why "it is no longer possible to setup
> > post-command-hook globally", or what do you mean by "impossible".
> > Your claim that the global value of post-command-hook is now useless
> > sounds grave, but you never explain why you make such a claim.
> 
> By "impossible", I did not mean that you cannot set global value, but
> rather that pretty much every single buffer will have a buffer-local
> value that is shadowing the global value set by add-hook without LOCAL
> arg.

But only for the eldoc hook, right?  Because if not, I still don't
understand what you are saying.

> Although, I now tested things more rigorously, and post-command-hook
> does get evaluated, despite the above. So, I clearly miss something
> about how and in which context post-command-hook is evaluated.

May I suggest that you first describe the actual problem you bumped
into?

> > The post-command-hook is modified by calling add-hook and remove-hook,
> > which still work.  The global value of post-command-hook was non-nil
> > by default before the above change, and it is still not nil after it.
> 
> You are right that the global value does get set and it is non-nil.
> The problem is with buffer-local value - with eldoc-mode, which is,
> after ab71699e5f2, enabled by default in all buffers, every single new
> buffer will have non-nil buffer-local value of post-command-hook.

And that is bad because..?

> >> It is also not possible to setup transient hooks (self-removed upon
> >> first execution) as long as current command ends up in different buffer.
> >
> > Why not?  Again, please tell the details.
> 
> >> (It was technically not exactly possible in the past as well, for
> >> buffers holding their buffer-local post-command-hook value, but the
> >> problem was less obvious as most buffers had post-command-hook set to
> >> its default value)
> >
> > AFAIU, it is still the case that most buffers have post-command-hook
> > set to its default value.  If not, please explain why not.
> 
> This is not true - most buffers, after ab71699e5f2, do _not_ have
> post-command-hook set to its default value. Let me provide an illustration:
> 
> 1. emacs -Q
> 2. M-: (add-hook 'post-command-hook #'always)
> 2. M-: (dolist (buf (buffer-list))
>      (with-current-buffer buf
>        (message "%S -> %S" buf post-command-hook)))
> 3. Observe the following in *Messages*
> 
> #<buffer *scratch*> -> (jit-lock--antiblink-post-command eldoc-schedule-timer t)
> #<buffer  *Minibuf-1*> -> (eldoc-schedule-timer t)
> #<buffer  *Minibuf-0*> -> (eldoc-schedule-timer t)
> #<buffer *Messages*> -> (eldoc-schedule-timer t)
> #<buffer  *Echo Area 0*> -> (always)
> #<buffer  *Echo Area 1*> -> (always)
> 
> 4. Create a new buffer C-x b new RET
> 5. M-: post-command-hook RET
>    
>    (eldoc-schedule-timer t)   

So the problem is that buffer-local hooks now have
eldoc-schedule-timer added?  Is that the only problem?  And if so, why
is it a problem?  Surely, there are gazillion of use cases in Emacs
where many buffers have buffer-local post-command-hook different from
the global value; why is it a problem in this case (or in all those
cases)?




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

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


Received: (at 78180) by debbugs.gnu.org; 1 May 2025 17:52:44 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 13:52:44 2025
Received: from localhost ([127.0.0.1]:52980 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAY5U-0001QJ-40
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 13:52:44 -0400
Received: from mout01.posteo.de ([185.67.36.65]:51711)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1uAY5R-0001Pz-B3
 for 78180 <at> debbugs.gnu.org; Thu, 01 May 2025 13:52:42 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 0C500240027
 for <78180 <at> debbugs.gnu.org>; Thu,  1 May 2025 19:52:34 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1746121955; bh=teFqk9VgnpOf3uOS5GhgvyHnhvonF7NT0Xd8QbTll6Y=;
 h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type:
 From;
 b=BZUqZ4rBwNGBtaInT1Kl3bPGPq/pn75lLjxNSqGSLfyMV+oC8oC+zNbFd3luqX3Cc
 AO0c0EbBork3GUCRAFWOdmAcCtJpg1Wnb1d0XJWaqy+dKS4o/ckcp7M1a+LKlkWGoO
 aZlINQGhsCDzOYkSM0RTl4enwpEkobKWlBcM5S+CN4aTHT+wUcauaEvbuS62RKmGIE
 zsZMSa+4maPDg+eFPZPtB5L5cX2lf0b2syRmLPAAXKKAw6fppdWRwzEDPUb+ctkSI7
 WFt/Jk8R0zG/LLE5oYV7gzKOuLNVNUKiVOldlvEf2PMFyQzWA1wm3XkOP39jysHz+v
 3I8J3p2KMmqfw==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4ZpM8L3Y2qz9rxD;
 Thu,  1 May 2025 19:52:34 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: Eli Zaretskii <eliz@HIDDEN>
Subject: Re: bug#78180: 31.0.50; Since ab71699e5f2, global value of
 post-command-hook is useless
In-Reply-To: <86o6wcmf82.fsf@HIDDEN>
References: <87ldrg90vi.fsf@localhost> <86o6wcmf82.fsf@HIDDEN>
Date: Thu, 01 May 2025 17:51:37 +0000
Message-ID: <87o6wc6wye.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <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 (---)

Eli Zaretskii <eliz@HIDDEN> writes:

> Please explain why "it is no longer possible to setup
> post-command-hook globally", or what do you mean by "impossible".
> Your claim that the global value of post-command-hook is now useless
> sounds grave, but you never explain why you make such a claim.

By "impossible", I did not mean that you cannot set global value, but
rather that pretty much every single buffer will have a buffer-local
value that is shadowing the global value set by add-hook without LOCAL
arg.

Although, I now tested things more rigorously, and post-command-hook
does get evaluated, despite the above. So, I clearly miss something
about how and in which context post-command-hook is evaluated.

> The post-command-hook is modified by calling add-hook and remove-hook,
> which still work.  The global value of post-command-hook was non-nil
> by default before the above change, and it is still not nil after it.

You are right that the global value does get set and it is non-nil.
The problem is with buffer-local value - with eldoc-mode, which is,
after ab71699e5f2, enabled by default in all buffers, every single new
buffer will have non-nil buffer-local value of post-command-hook.

>> It is also not possible to setup transient hooks (self-removed upon
>> first execution) as long as current command ends up in different buffer.
>
> Why not?  Again, please tell the details.

>> (It was technically not exactly possible in the past as well, for
>> buffers holding their buffer-local post-command-hook value, but the
>> problem was less obvious as most buffers had post-command-hook set to
>> its default value)
>
> AFAIU, it is still the case that most buffers have post-command-hook
> set to its default value.  If not, please explain why not.

This is not true - most buffers, after ab71699e5f2, do _not_ have
post-command-hook set to its default value. Let me provide an illustration:

1. emacs -Q
2. M-: (add-hook 'post-command-hook #'always)
2. M-: (dolist (buf (buffer-list))
     (with-current-buffer buf
       (message "%S -> %S" buf post-command-hook)))
3. Observe the following in *Messages*

#<buffer *scratch*> -> (jit-lock--antiblink-post-command eldoc-schedule-timer t)
#<buffer  *Minibuf-1*> -> (eldoc-schedule-timer t)
#<buffer  *Minibuf-0*> -> (eldoc-schedule-timer t)
#<buffer *Messages*> -> (eldoc-schedule-timer t)
#<buffer  *Echo Area 0*> -> (always)
#<buffer  *Echo Area 1*> -> (always)

4. Create a new buffer C-x b new RET
5. M-: post-command-hook RET
   
   (eldoc-schedule-timer t)   

   The new buffers gets buffer-local value, not global (always) value.

I note that Echo Area still gets the global hook value. Maybe it can
explain why global value of post-command-hook still gets executed in my
interactive testing.

I did the following test, I left wondering what is going on:

1. emacs -Q
2. (trace-function #'always)
3. (trace-function #'eldoc-schedule-timer)
4. (add-hook 'post-command-hook #'always)
5. C-n C-p C-n C-p
6. Observe _both_ buffer-local and global values of post-command-hook
   executed. Why is that?

>> The problem may affect:
>> 1. Org mode (that's how I found the problem)
>> 2. vcursor.el, vc.el, type-break.el, transient.el, xterm.el,
>>    scroll-all.el, global-reveal-mode, repeat-mode, gud.el, flymake,
>>    elisp-mode.el, and basically any other part of Emacs setting global
>>    default value of post-command-hook.
>
> Affect how?  Please explain that, not just claim it.

That claim was based on my incomplete understanding. You can ignore this
part.

-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




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

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


Received: (at 78180) by debbugs.gnu.org; 1 May 2025 17:08:07 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 13:08:07 2025
Received: from localhost ([127.0.0.1]:52783 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAXOJ-0007Ru-28
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 13:08:07 -0400
Received: from eggs.gnu.org ([2001:470:142:3::10]:41414)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <eliz@HIDDEN>) id 1uAXOG-0007RF-BF
 for 78180 <at> debbugs.gnu.org; Thu, 01 May 2025 13:08:05 -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 1uAXOA-0001BC-Tt; Thu, 01 May 2025 13:07:58 -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=7QJBbzGTN26cOvRrSteGcLhlLTh1hBYdHGhirP88MrU=; b=ofz3xa0k9JzE
 zXpp+AZ8VXk1kEMDmbotbhG7CqoOK94PIv68drMo8Xyg23poGOp/gHtf3yO88io84xYQj8l6AJxK3
 e2zWq1NXnWWqV3M/xF6QTrGa1yNRioFLsCZmYWpnMVqlhLwUtVi1Lckm+Hs2b9czLxWvosoZTEwSf
 9ORgb8PtZ203YpJeZxktD2nJxrO4sqS2fgEmiv2V5kyLgPuuVlAHssxOxLa1QdBWX4SfBMleCjYlZ
 Q6T2DioE3lDaMEGWWb2rdGLt5XRtjqHmneu22ed4I712RVcUaxwfC6gsdpftMhsNSXyoqqWkpKSYN
 PW0olqheYQ8AmAAlsq27UA==;
Date: Thu, 01 May 2025 20:07:57 +0300
Message-Id: <86o6wcmf82.fsf@HIDDEN>
From: Eli Zaretskii <eliz@HIDDEN>
To: Ihor Radchenko <yantar92@HIDDEN>
In-Reply-To: <87ldrg90vi.fsf@localhost> (message from Ihor Radchenko on Thu,
 01 May 2025 08:44:01 +0000)
Subject: Re: bug#78180: 31.0.50;
 Since ab71699e5f2, global value of post-command-hook is useless
References: <87ldrg90vi.fsf@localhost>
X-Spam-Score: -2.3 (--)
X-Debbugs-Envelope-To: 78180
Cc: 78180 <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: Ihor Radchenko <yantar92@HIDDEN>
> Date: Thu, 01 May 2025 08:44:01 +0000
> 
> Before commit ab71699e5f2, global-eldoc-mode (enabled by default) did
> nothing in most buffers and only activated when a given major mode
> defined `eldoc-documentation-functions' (so that `eldoc--supported-p'
> returns non-nil).
> 
> One can easily see this via
> 1. emacs -Q
> 2. C-x b *Messages* RET
> 3. M-: post-command-hook (nil)
> 
> After ab71699e5f2, `eldoc-documentation-functions' is no longer nil by
> default, with immediate effect of *every single buffer* having
> eldoc-mode enabled.
> 
> Enabling eldoc-mode itself is not a big deal. What is a big deal is the
> fact that it is no longer possible to setup post-command-hook globally,
> not just in current buffer, but also in all the future new buffers.

Please explain why "it is no longer possible to setup
post-command-hook globally", or what do you mean by "impossible".
Your claim that the global value of post-command-hook is now useless
sounds grave, but you never explain why you make such a claim.

The post-command-hook is modified by calling add-hook and remove-hook,
which still work.  The global value of post-command-hook was non-nil
by default before the above change, and it is still not nil after it.
Please explain why you consider that change to have such a grave
effect.  Yes, it does mean most buffers will see a non-nil value of
post-command-hook; no, it is completely unclear why is that a bad
thing, nor even why you think it's a significant change, since there's
another hook in the default value besides eldoc-mode's one, which was
there before the change.

> It is also not possible to setup transient hooks (self-removed upon
> first execution) as long as current command ends up in different buffer.

Why not?  Again, please tell the details.

> (It was technically not exactly possible in the past as well, for
> buffers holding their buffer-local post-command-hook value, but the
> problem was less obvious as most buffers had post-command-hook set to
> its default value)

AFAIU, it is still the case that most buffers have post-command-hook
set to its default value.  If not, please explain why not.

> The problem may affect:
> 1. Org mode (that's how I found the problem)
> 2. vcursor.el, vc.el, type-break.el, transient.el, xterm.el,
>    scroll-all.el, global-reveal-mode, repeat-mode, gud.el, flymake,
>    elisp-mode.el, and basically any other part of Emacs setting global
>    default value of post-command-hook.

Affect how?  Please explain that, not just claim it.

> I do no think that ab71699e5f2 itself is doing anything wrong, but
> rather that the design of post-command-hook is not ideal for its
> purpose. The fact that we were able to get along with the current design
> is by pure chance and the fact that most buffers did not set
> buffer-local value of post-command-hook.

This again lacks critical details.  Please fill in the blanks.

Thanks.




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

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


Received: (at submit) by debbugs.gnu.org; 1 May 2025 08:45:15 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Thu May 01 04:45:15 2025
Received: from localhost ([127.0.0.1]:48463 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84_2)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1uAPXf-0001KR-0c
	for submit <at> debbugs.gnu.org; Thu, 01 May 2025 04:45:15 -0400
Received: from lists.gnu.org ([2001:470:142::17]:40750)
 by debbugs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.84_2) (envelope-from <yantar92@HIDDEN>)
 id 1uAPXa-0001HN-FU
 for submit <at> debbugs.gnu.org; Thu, 01 May 2025 04:45:13 -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 <yantar92@HIDDEN>)
 id 1uAPXT-0001zX-RX
 for bug-gnu-emacs@HIDDEN; Thu, 01 May 2025 04:45:04 -0400
Received: from mout02.posteo.de ([185.67.36.66])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)
 (Exim 4.90_1) (envelope-from <yantar92@HIDDEN>)
 id 1uAPXR-000122-9l
 for bug-gnu-emacs@HIDDEN; Thu, 01 May 2025 04:45:03 -0400
Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 4B807240101
 for <bug-gnu-emacs@HIDDEN>; Thu,  1 May 2025 10:44:58 +0200 (CEST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1746089098; bh=AVFLtWJMmJowDftrjpuOHnIcIi5HyFdg2bmu7Y31p2s=;
 h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type:From;
 b=NNmBRSVcD4YH+mjXvZulRz21sJkqh6+9ck3zVQZ5+GBO5vhQGTAO3yH1vUemo6kvh
 dYj6VIzTFyqXSSr12kT8L7UMQSmowRxYdY8jdgP/KXQAPpDudi4y1sfUO11klJCmkn
 iH7Ah9CSFw8MU94Eo3eeYeWGzA+i3JFcUuqoBE1+graX0+mcxCCsrKTNHQMbMc5mWV
 Y3HHHk/LvRuLuW1B22sQfFyX9vvHNIMcufPWtQmRuOOHUq9ir0bD8S9azcDcM4XX8n
 zFyet4padKJiiZbWF2TbMyL/h+Lz0vrdSBqKBv1McrHzYEGoQIbVfW4ExSuJbzQWzN
 l21Ck0SyzErYA==
Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4Zp70T6W3bz9rxL
 for <bug-gnu-emacs@HIDDEN>; Thu,  1 May 2025 10:44:57 +0200 (CEST)
From: Ihor Radchenko <yantar92@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Subject: 31.0.50; Since ab71699e5f2, global value of post-command-hook is
 useless
X-Debbugs-Cc: 
Date: Thu, 01 May 2025 08:44:01 +0000
Message-ID: <87ldrg90vi.fsf@localhost>
MIME-Version: 1.0
Content-Type: text/plain
Received-SPF: pass client-ip=185.67.36.66; envelope-from=yantar92@HIDDEN;
 helo=mout02.posteo.de
X-Spam_score_int: -43
X-Spam_score: -4.4
X-Spam_bar: ----
X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,
 DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
 RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001,
 RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, SPF_HELO_NONE=0.001,
 SPF_PASS=-0.001 autolearn=ham autolearn_force=no
X-Spam_action: no action
X-Spam-Score: 1.0 (+)
X-Debbugs-Envelope-To: submit
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: -0.0 (/)

Hi,

Before commit ab71699e5f2, global-eldoc-mode (enabled by default) did
nothing in most buffers and only activated when a given major mode
defined `eldoc-documentation-functions' (so that `eldoc--supported-p'
returns non-nil).

One can easily see this via
1. emacs -Q
2. C-x b *Messages* RET
3. M-: post-command-hook (nil)

After ab71699e5f2, `eldoc-documentation-functions' is no longer nil by
default, with immediate effect of *every single buffer* having
eldoc-mode enabled.

Enabling eldoc-mode itself is not a big deal. What is a big deal is the
fact that it is no longer possible to setup post-command-hook globally,
not just in current buffer, but also in all the future new buffers.
It is also not possible to setup transient hooks (self-removed upon
first execution) as long as current command ends up in different buffer.

(It was technically not exactly possible in the past as well, for
buffers holding their buffer-local post-command-hook value, but the
problem was less obvious as most buffers had post-command-hook set to
its default value)

The problem may affect:
1. Org mode (that's how I found the problem)
2. vcursor.el, vc.el, type-break.el, transient.el, xterm.el,
   scroll-all.el, global-reveal-mode, repeat-mode, gud.el, flymake,
   elisp-mode.el, and basically any other part of Emacs setting global
   default value of post-command-hook.

I do no think that ab71699e5f2 itself is doing anything wrong, but
rather that the design of post-command-hook is not ideal for its
purpose. The fact that we were able to get along with the current design
is by pure chance and the fact that most buffers did not set
buffer-local value of post-command-hook.

Maybe we should introduce post-command-global-hook that will be
evaluated in every single buffer and leave post-command-hook to be used
locally (maybe even rename it to post-command-local-hook for
clarity). Maybe similar for pre-command-hook.

In GNU Emacs 31.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
 3.24.49, cairo version 1.18.4) of 2025-04-29 built on localhost
Repository revision: 3a514005d153df429b0ed58ac64300296b9d5aac
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12101016
System Description: Gentoo Linux
-- 
Ihor Radchenko // yantar92,
Org mode maintainer,
Learn more about Org mode at <https://orgmode.org/>.
Support Org development at <https://liberapay.com/org-mode>,
or support my work at <https://liberapay.com/yantar92>




Acknowledgement sent to Ihor Radchenko <yantar92@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#78180; 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: Sat, 17 May 2025 08:15:01 UTC

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