From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Tom Gillespie Newsgroups: gmane.emacs.devel Subject: Re: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames Date: Mon, 30 Jan 2023 14:40:31 -0500 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" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="21804"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Eli Zaretskii , emacs-devel@gnu.org, larsi@gnus.org To: martin rudalics Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Jan 30 20:41:44 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 1pMa2C-0005ZO-26 for ged-emacs-devel@m.gmane-mx.org; Mon, 30 Jan 2023 20:41:44 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pMa1H-0006zl-OT; Mon, 30 Jan 2023 14:40:47 -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 1pMa1G-0006z5-8k for emacs-devel@gnu.org; Mon, 30 Jan 2023 14:40:46 -0500 Original-Received: from mail-yb1-xb30.google.com ([2607:f8b0:4864:20::b30]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pMa1E-0000Tf-RV; Mon, 30 Jan 2023 14:40:45 -0500 Original-Received: by mail-yb1-xb30.google.com with SMTP id h5so15417268ybj.8; Mon, 30 Jan 2023 11:40:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=+SAC+VGB62IjP0Cdc0j8Bnxsx89SGTeQpiKNp7o8FtA=; b=VY8yUzpK4YzMvzlXyCj4SuYtsdBjuk2UAvudO1oC5E9hEZJ8ajqbeMWm9ciVhp53gr Fk9Z+Pr1NgPjmsyUWWENNR8PI79YrX5Mz2CXDx8C0mZya1ZacbyvOw3I/nVYr58X5CYw +h62DtdxdzAMk2oZN9Rg+RP6V92Aub3+bBomYlWBcle5THyvSJm1/7B6bLHgUEwUANAK uWWD8Jl/d7I+cFO5Hq6ioPC7zTP1izsDVXesVRm9U7doZvBhIpUIUi6niGIUkasv1ZKD lt4vRuoU0WxUdwCdPORxJwf1sh2QIYmt6KvZ8IJzsc4vjnZFzDzBSRObMVtDai9h86Ba mOcQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=+SAC+VGB62IjP0Cdc0j8Bnxsx89SGTeQpiKNp7o8FtA=; b=dmUxHLamnhJKb3hD2irOSZ7w/LBrPplc3tnsDckqKHDEsVoDR70FL48bBVt0DtXlRA G36q7k0sl9vPlL0MaRDA2jAgsyZzzh92+pKH4nd7yK6kIVF7y/Omvy/HXUv+2yHVkXFC 35cA/sImkpfgHk2hlmC5eT0TzC8j//uiVEPv54QbiW/5t9rB2FfXLySXVAMzTNOT1r5z Yk1qw8MozZdVuUMZOdRRG6T00iawQhY8JcpnEAAsjih+ZbeEKqyzbadd87uaytEhDgCN /Z6XLVH2jp6C97jup6SzBEsDXDm3CKGwKhiybU2nd0EO2JkPsVo/eL1sA2ISEAac/Ssu b+VA== X-Gm-Message-State: AO0yUKWZkPwSDky1vqJ2Qwn8ErIFYQMk44Gf5JdSGoTh0vlyxU8dPsGW LS64Z+5c6kMxTWSu/BKRCFO/H1xpry792qSXa7DogDZaByo= X-Google-Smtp-Source: AK7set8Cee0YO5qAqfy5uVQ8qEZuSZPp99LeeAUiFOkWbydVf6z5V7k/a3piIXvvpJD+kqRXPGsIEMmJJ2mHdQysj6o= X-Received: by 2002:a25:89:0:b0:80b:b287:2c44 with SMTP id 131-20020a250089000000b0080bb2872c44mr2414860yba.637.1675107643055; Mon, 30 Jan 2023 11:40:43 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::b30; envelope-from=tgbugs@gmail.com; helo=mail-yb1-xb30.google.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, 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_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:302810 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.