From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames Date: Tue, 31 Jan 2023 09:46:15 +0100 Message-ID: References: <834jsccepb.fsf@gnu.org> <30c3d810-ed96-a9bd-c622-1761a138515c@gmx.at> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="18694"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org, larsi@gnus.org To: Tom Gillespie Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Jan 31 09:47:16 2023 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pMmIO-0004j7-Hd for ged-emacs-devel@m.gmane-mx.org; Tue, 31 Jan 2023 09:47:16 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMmI9-00037N-A1; Tue, 31 Jan 2023 03:47:06 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMmHW-0002wP-Vy for emacs-devel@gnu.org; Tue, 31 Jan 2023 03:46:23 -0500 Original-Received: from mout.gmx.net ([212.227.17.21]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pMmHU-0003mq-AX; Tue, 31 Jan 2023 03:46:22 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.at; s=s31663417; t=1675154776; bh=HXS1kAJn/PBwfd6BrmZA1Bqdqw1DzfL3114PbbKeC8s=; h=X-UI-Sender-Class:Date:Subject:To:Cc:References:From:In-Reply-To; b=ff8HkLaHiQraXk9Wd95A7YhaHvw2Yrik5Hf0vGe0pg+ZhufedH2O5u7WnNn1rvvE1 n2hO7jnsdCxlaa41nPXPUs3bdZ7SKIHegwRhWu0CdGHH6SL4mOgvMVoKun7tUNYuw4 XY3TJsIqJtPesIyvnMJXnKmKsS1q1evJtnkx8oB/ybYEXQhqgznpM2/hM/GpVuxVo+ JPIwd+zbjZeqxTjcrf5rZATr/WxWr8AEaQU6MHo065tcJVEVBdV6+DaT/gikhNy7+b 2kdjb+M6p8gIbT+2z9LD0LIosJ0yYkHn/Ixb+y/lIATPp9iqOMILSxqyKDbli96h2p DIDPrYk/acgMQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.1.100] ([46.125.249.64]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1N0oBx-1oSjBF072z-00wmU6; Tue, 31 Jan 2023 09:46:16 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:vA9UwbGYRBG653qIgWvRAUbSceh+mmbW9SYSCU4TpVQ3HSCWHmR zohsEWkMOtI/NMTYQf4ktdykPkjuvvh6t/WaJKBKLnpq29Wqzid7yx4MeXGzZvGJd7iR6vm mbKSV1wAtubX4m2/UXzzHFWoEKxy3ejWgocuEAE1FF71g4cWFi8MrP1l1fuwUoISsZkuuC4 /b90YB1GDUm0Vxukn1gDw== UI-OutboundReport: notjunk:1;M01:P0:7y7wr/DgCLM=;vSwiKrrJDPD/DdkyA5xm/JsvT/+ 0z/NfCiL09/u5fmRAplxV/jZSWA/IeMhZjHP8icUvEEsx5T97AUSz226uJX4NUTde33oTI/2O ZOfFUF7aHNQXk7V4s7DbjYSkdY6z8sA0Pclsi3sQma/neFzjfxriUdifue5QHEYb+8C2iddjQ D6bYDibaxau0/6umzguBiWd40gyZoRi3WeBRWPxr32/XxwCE8v6QACDDLHDX9lhC458tCFVZs 6AR0hFujPZa1BtSCEMRveYxORqcxilDzzZWxeD6B4Yrt+bScAUVYa+UcxbFM9YQECtX6lkOpk pBoZzX1t3a4XgaFsD7JNdjGQ+SYfj1n25TSDU57OqIDFk4IrSxHEUj7D44f4f8uKhRl8948v3 WPBYNQ5TfXMkQ5mh3yNtoHwNnk2gEmC02SYOU+obKDZgyRisUPUEY9Uqw2XR2+csqR6li6DkJ DJ/f78ZFGGHCkk0co7DMsQb6F33gfWiVNFDs4Cs3dmSn0xnzcBIc845DGOwQ3NPwRQKqA/gRL o+gvmFIN7Fx9SZb4dUDZed0Z83kf7lv2kenqPOM6ZY/eNv3nvRxNxkplvUrmgeDK8cM++Q87i cFAnMBKyytXcjH3fQwBWlr7sO6qzzbXhFGw5O8NSu0GzcxaFrfs3rZfAB5PkKhfeBHD8jsrag iUyZ0p+bMBuwCGkByaL17aI3xXDUTrRj+7UKx3TX9k5DGiRl1kYslK1m+hYfZeqWb8Cq8Fe9B Gfw18hn34HDzCCN4msHcwBrOpOunb/q6L+paXtKTkRKeMc8FyLoLrpgL5cNUT8uvOPH5eS81 Received-SPF: pass client-ip=212.227.17.21; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: 5 X-Spam_score: 0.5 X-Spam_bar: / X-Spam_report: (0.5 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H2=-0.001, RCVD_IN_SBL_CSS=3.335, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:302819 Archived-At: >> Why? Any reusable frame would have been already honored by > 'display-buffer-reuse-window'. > > If 'display-buffer-reuse-window' fails to find a valid window then > the next function to run will be 'display-buffer-use-some-window'. > > In the current implementation of 'display-buffer-use-some-window' > get-lru-window only searches the existing frame and not-this-window > will be true, therefore whenever there is a single window in the > current frame 'display-buffer-use-some-window' will proceed on to > pick a window in another frame starting with visible then 0 for all-frames > when it calls > (get-largest-window 'visible nil not-this-window) and then > (get-largest-window 0 nil not-this-window) > > This is not the behavior that we want because a single window in the > current frame will never be able to reach display-buffer-pop-up-window > since 'display-buffer-use-some-window' will succeed on a random window > in a random frame which will almost certainly not be the least recently used. > >> Why would you want to change 'display-buffer-use-some-window'? > > I don't, but in your example where we call it in > display-buffer-use-least-recent-window then it would have to be > modified since as is it is impossible to get the behavior we need > due to the calls to get-largest-window. I think you are right. No more objections from my side but please leave a comment in the code summarizing what you said here. martin