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: [PATCH] Fix display-buffer-use-some-window to honor reusable-frames Date: Fri, 27 Jan 2023 00:17:52 -0500 Message-ID: Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="00000000000066576005f337fd33" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10771"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Lars Ingebrigtsen To: Emacs developers Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Fri Jan 27 06:19:00 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 1pLH8e-0002ex-95 for ged-emacs-devel@m.gmane-mx.org; Fri, 27 Jan 2023 06:19:00 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pLH7o-0005KM-MR; Fri, 27 Jan 2023 00:18:08 -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 1pLH7m-0005K5-TL for emacs-devel@gnu.org; Fri, 27 Jan 2023 00:18:06 -0500 Original-Received: from mail-yb1-xb29.google.com ([2607:f8b0:4864:20::b29]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pLH7l-0003Nr-18 for emacs-devel@gnu.org; Fri, 27 Jan 2023 00:18:06 -0500 Original-Received: by mail-yb1-xb29.google.com with SMTP id h5so4680910ybj.8 for ; Thu, 26 Jan 2023 21:18:04 -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:mime-version:from:to:cc:subject :date:message-id:reply-to; bh=M2rv+1h7FFYmJtiospSkghMLvWd25dD+TwvE7uDEs9g=; b=hyEjFti14lxDKiWCSN0v4Ivlsc83ovsFr848O2zI6vCzmweGxo2P9AamxuQXEEOYqD sSt4AvlsDtaW+nmzPOCO8DPsltZUnbiWTUc5fQoNSFg4KvB1wQhUnV+jfxy0GF56ngpi sVKDwJUFQ2II3z4xn+xvmB17W/zJOolFQ99P86bJNzK/AgT+5mHFHerwX+FIIvFTqrnA 4bPX13L7Bj8Pgh7iosVigQKmSJZOoF5ajLg3i1+wHlSha46SoDt9a5pZ6ZgATtwv9VUX 4zY6nCMz/YJo7Iw4eG7JyN8att/D70o4UPbUutI7QMlUn8n6bp+lXLH0ccq5w1kZbvpw Z5mQ== 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:mime-version:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=M2rv+1h7FFYmJtiospSkghMLvWd25dD+TwvE7uDEs9g=; b=A0pScsmfofWiV9y8vKat8k2JOR1aFfJ7oYoZRsWUf2C81JwwRKBu/ifWiigejCDkMY UVKiokotcDxKkndgwPeuqkBxPQ514/Y+maXtj+OGqJZiFo8F9MgfrMQmDlO2prkoY3X1 32Raj9pDE8QWrB3g4b9g2QQAOYVYtjA7EYflHOqNmN3+Av4/fHOKKJwZ4sS4M7UAd04L GIKIXNRv2g8fHdJhFsDrmMDHG0EnDfWPrCzjWAPLraC9gziMMN8xMvSu2L1oiBZmdkvR 9G5lisF4X93sRoGbAbXBF6EmzpUosZqQJ/A1Ar1w0gUCusvi4FM/U+/sCPrr9UJyVQU2 cn7A== X-Gm-Message-State: AFqh2kpOtiZ5wiovEK6th+1O43pHFkTE4S/JCRIzDpvnpeAYTw2YXejd w0+pcnQv7ZIRyQemedoDotgadpqwwY83aYIdd1OtdHLUu0g= X-Google-Smtp-Source: AMrXdXtrsbF8XmsWx9HLKkAI0gQf/c286/edBR4M/dT2BI5r4ZuZDPuecBbJc+jCfRsnyUITyG/bc6U5lDifh5fEdOk= X-Received: by 2002:a25:4807:0:b0:7ca:63c4:e5c1 with SMTP id v7-20020a254807000000b007ca63c4e5c1mr3804934yba.301.1674796683609; Thu, 26 Jan 2023 21:18:03 -0800 (PST) Received-SPF: pass client-ip=2607:f8b0:4864:20::b29; envelope-from=tgbugs@gmail.com; helo=mail-yb1-xb29.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:302677 Archived-At: --00000000000066576005f337fd33 Content-Type: text/plain; charset="UTF-8" Hi, Here is a patch to fix strange and disruptive behavior caused by a bug in display-buffer-use-least-recent-window and display-buffer-use-some-window. I have made the patch against the emacs-29 branch. A detailed explanation is in the commit message. Best! Tom --00000000000066576005f337fd33 Content-Type: text/x-patch; charset="US-ASCII"; name="0001-Fix-display-buffer-use-some-window-to-honor-reusable.patch" Content-Disposition: attachment; filename="0001-Fix-display-buffer-use-some-window-to-honor-reusable.patch" Content-Transfer-Encoding: base64 Content-ID: X-Attachment-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sIHwgMjIgKysrKysrKysrKysr KysrKysrKysrLQogMSBmaWxlIGNoYW5nZWQsIDIxIGluc2VydGlvbnMoKyksIDEgZGVsZXRpb24o LSkKCmRpZmYgLS1naXQgYS9saXNwL3dpbmRvdy5lbCBiL2xpc3Avd2luZG93LmVsCmluZGV4IDBj ZDMwODIyZmY2Li45YmRjZjdiOGIzNiAxMDA2NDQKLS0tIGEvbGlzcC93aW5kb3cuZWwKKysrIGIv bGlzcC93aW5kb3cuZWwKQEAgLTg1MDksNyArODUwOSwxMSBAQCBkaXNwbGF5LWJ1ZmZlci11c2Ut bGVhc3QtcmVjZW50LXdpbmRvdwogd2hlbiBkaXNwbGF5aW5nIGJ1ZmZlcnMgcmVwZWF0ZWRseSwg YW5kIGlmIHRoZXJlJ3Mgb25seSBhIHNpbmdsZQogd2luZG93LCBpdCB3aWxsIHNwbGl0IHRoZSB3 aW5kb3cuIgogICAod2hlbi1sZXQgKCh3aW5kb3cgKGRpc3BsYXktYnVmZmVyLXVzZS1zb21lLXdp bmRvdwotICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlciAoY29ucyAoY29ucyAnaW5oaWJpdC1z YW1lLXdpbmRvdyB0KSBhbGlzdCkpKSkKKyAgICAgICAgICAgICAgICAgICAgICBidWZmZXIKKyAg ICAgICAgICAgICAgICAgICAgICAobGV0ICgoYWxpc3QgKGNvbnMgKGNvbnMgJ2luaGliaXQtc2Ft ZS13aW5kb3cgdCkgYWxpc3QpKSkKKyAgICAgICAgICAgICAgICAgICAgICAgIChpZiAoYXNzcSAn cmV1c2FibGUtZnJhbWVzIGFsaXN0KQorICAgICAgICAgICAgICAgICAgICAgICAgICAgIGFsaXN0 CisgICAgICAgICAgICAgICAgICAgICAgICAgIChjb25zIChjb25zICdyZXVzYWJsZS1mcmFtZXMg bmlsKSBhbGlzdCkpKSkpKQogICAgICh3aW5kb3ctYnVtcC11c2UtdGltZSB3aW5kb3cpKSkKIAog KGRlZnVuIGRpc3BsYXktYnVmZmVy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dC10aGlzLXdp bmRvdworCQkJICAgICAgICAgICAgICAgIChlcSB3aW5kb3cgKHNlbGVjdGVkLXdpbmRvdykpKQor CQkgICAgICAgICB3aW5kb3cpKSkKKyAgICAgICAgICAgIChsZXQgKCh3aW5kb3cgKGdldC1idWZm ZXItd2luZG93IGJ1ZmZlciByZXVzYWJsZS1mcmFtZXMpKSkKKwkJICAgICAgKHVubGVzcyAoYW5k IG5vdC10aGlzLXdpbmRvdworCQkJICAgICAgICAgICAgICAgKGVxIHdpbmRvdyAoc2VsZWN0ZWQt d2luZG93KSkpCisJCSAgICAgICAgd2luZG93KSkKKyAgICAgICAgICAgIChkaXNwbGF5LWJ1ZmZl ci1uby13aW5kb3cgYnVmZmVyIGFsaXN0KSkpCiAJICAgICAgKGxldCAoKHdpbmRvdyAoZ2V0LWJ1 ZmZlci13aW5kb3cgYnVmZmVyICd2aXNpYmxlKSkpCiAJCSh1bmxlc3MgKGFuZCBub3QtdGhpcy13 aW5kb3cKIAkJCSAgICAgKGVxIHdpbmRvdyAoc2VsZWN0ZWQtd2luZG93KSkpCi0tIAoyLjM5LjEK Cg== --00000000000066576005f337fd33--