From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.bugs Subject: bug#34765: 26.1; with-temp-buffer should not run buffer-list-update-hook Date: Wed, 06 Mar 2019 10:39:01 +0100 Message-ID: <5C7F9535.204@gmx.at> References: <1bbe1e09-57d3-d8f1-47a9-db62c1d2b0a9@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="211231"; mail-complaints-to="usenet@blaine.gmane.org" To: Alexander Miller , 34765@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Wed Mar 06 10:40:27 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1h1T2H-000snY-4Q for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 10:40:25 +0100 Original-Received: from localhost ([127.0.0.1]:57895 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1T2G-0008K1-3Z for geb-bug-gnu-emacs@m.gmane.org; Wed, 06 Mar 2019 04:40:24 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:43786) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1T22-0008GZ-Uv for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 04:40:11 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1T20-0001M9-Cy for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 04:40:09 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:48438) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1T1x-0001KI-1h for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 04:40:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1h1T1w-0005rI-K9 for bug-gnu-emacs@gnu.org; Wed, 06 Mar 2019 04:40:04 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 06 Mar 2019 09:40:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34765 X-GNU-PR-Package: emacs Original-Received: via spool by 34765-submit@debbugs.gnu.org id=B34765.155186515722460 (code B ref 34765); Wed, 06 Mar 2019 09:40:02 +0000 Original-Received: (at 34765) by debbugs.gnu.org; 6 Mar 2019 09:39:17 +0000 Original-Received: from localhost ([127.0.0.1]:33749 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1T1A-0005qC-O0 for submit@debbugs.gnu.org; Wed, 06 Mar 2019 04:39:16 -0500 Original-Received: from mout.gmx.net ([212.227.17.20]:39539) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1h1T18-0005py-Um for 34765@debbugs.gnu.org; Wed, 06 Mar 2019 04:39:15 -0500 Original-Received: from [192.168.1.101] ([212.95.5.147]) by mail.gmx.com (mrgmx103 [212.227.17.168]) with ESMTPSA (Nemesis) id 0MD9uq-1gkzOi17Xg-00Gb52; Wed, 06 Mar 2019 10:39:08 +0100 In-Reply-To: <1bbe1e09-57d3-d8f1-47a9-db62c1d2b0a9@web.de> X-Provags-ID: V03:K1:LysVBaCH1q+7Px38F8p4R5ddxGpDZCRroHUh8UAVfQloLVonQ05 Mblwc+tWWcX3Wesd+Ot/8YIkFIRj5xXI8DXhv6CrlrRV1kpdPdD6BaZUcNxHcClk9fpNsxM o9820AgQ+oOJVGBkNAc8HhMTF7y0G8ojAwdkmvsdXvrY0w2l363ttBcoHyduwuofn/xFPgW dqPTywVS706DqmIQWgl/Q== X-UI-Out-Filterresults: notjunk:1;V03:K0:S6kfbRIEJ8E=:2/X6/9OYUKJS591QTByqpv lG+oVE+ohnJNs6BvaiwNYcaIj0TTwQevVJdpkokeOy1xHGLma+5MMc1/F64+I+VFTWk+ui1Pj Oq0WNVYUya9fJanTeNcFelvQC1B6vsCvTonbeyGH4XTPyE19X21Lyz6dmZjz1A5SBk+ZR6cfz BWj+ylyAweVzgCYFvn/bNkW4M/Zuak9dldDQIj1rPZnQsTNpM3CbEQouIIuty/bkZAo5h3JY2 shQ9YYb1+6a0vyavHWBFnid1k4W9sf/BvV9m2wzS/QRUe+43H2Ohua53CwyA3hSmJcv+X859B Jd/atKIiZemyZ1FSUaGjGG59sw1l00qiKX60bpHCPdAh4gHKS432UXt8Gi4p6HQpbU1eOJoSe KcjbtDHncgJ2p7rlXhJzH1SALcrxPYvoMoualqwqCLiO3pekHu8emv0D7DGuW0xfscJln6GLQ fkKrXKqGyP3QJS7whdpx5AlXrIRQVm0T4wNegakuCtb8FIBj0nFiyHnTrVNg0FlQlLH2y1oqe S1H8crVX/prxDqzs6qzBnypQaLMOmE5awKWJ4j6dz6TIKo+BkCSdOdkCa3J48d5f5r0y3y7aH SyUV6kPiZeoFKRbQ86aXtCZYK2LU21KqqrdbhOOzF2Oe05iA175xrRLX63pRRRV+JMnKRmG1V TIlj3EUZY2cjf6rNNoY7/yWiW8YJVykxQPuXFuygzSqx3twmVbBHUnarm3GKIEzEoaC2Pz5oT fmi5/aslmPbOp+9BQCtjdq03Ktg9yQgFId8KLt9IrDeJX1IGPQ6vOcolKI3Fq+e5fvfCsK0n X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:156090 Archived-At: > To quote from the documentation of select-window: > > Selections that "really count" are those > causing a visible change in the next redisplay of WINDOW=E2=80=99s fra= me and > should be always recorded. So if you think of running a function each > time a window gets selected put it on =E2=80=98buffer-list-update-hook= =E2=80=99. > > A temporary buffer hardly fits these criteria. You're probably right but there's not much we can do in this regard. When you show a temporary buffer and temporarily show another buffer in the same window, there must be a way to show the temporary buffer again. That's why we have to run 'buffer-list-update-hook' for them. > The problem is not just > theoretical either. I have now run multiple times into situations wher= e > use of a temp buffer caused a feedback loop that makes > buffer-list-update-hook fire permanently. For example a function calle= d > by buffer-list-update-hook uses with-selected-window, this causes a > recalculation of the frame title, that calls format-spec, which uses a= > temp-buffer and we are back to step one. Granted this case is very > specific to spacemacs and I am unable to reproduce it from emacs -q > (with-selected-window does not recalculate the frame title here), but > this is already the second time I've run into this 'with-selected-window' calls 'select-window' with NORECORD non-nil, so this should not be the culprit. I'm afraid you have to dig further to find out how 'buffer-list-update-hook' precisely gets called here. > (first time it was > magit). What was the issue there? > So yeah, with-temp-buffer correction aside, if you have any advice how= > to avoid the issue on my end without going back to advising > select-window that'd be great. Emacs 27 now has 'window-selection-change-functions', strongly tied to redisplay and triggering only when the window selection has changed since last redisplay. Maybe you could try that. martin