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,gmane.emacs.orgmode Subject: Re: May we have a variant of display-buffer-reuse-window that considers indirect buffers? Date: Wed, 18 Dec 2024 10:08:39 +0100 Message-ID: <9d81cb95-8d46-4c51-8daa-d7c8fb44413a@gmx.at> References: <878qtycdmi.fsf@k-7.ch> <87msgx7yo5.fsf@localhost> <87ttb42i1b.fsf@mail.linkov.net> <87r067cxi6.fsf@localhost> <87y10e6uyf.fsf@localhost> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------ARY3HHP5I18o6srk0Nl0PbmF" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="34503"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Juri Linkov , =?UTF-8?Q?S=C3=A9bastien_Gendre?= , Org Mode List , emacs-devel@gnu.org To: Ihor Radchenko Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 18 10:09:58 2024 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 1tNq45-0008ki-SR for ged-emacs-devel@m.gmane-mx.org; Wed, 18 Dec 2024 10:09:58 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tNq35-00050q-Aj; Wed, 18 Dec 2024 04:08:56 -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 1tNq30-00050W-DG; Wed, 18 Dec 2024 04:08:51 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1tNq2y-0000CG-6o; Wed, 18 Dec 2024 04:08:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1734512921; x=1735117721; i=rudalics@gmx.at; bh=ResRoOWsOEaNDB4MNNMrUF+fVEmG52B0h5G9vPqge4Q=; h=X-UI-Sender-Class:Content-Type:Message-ID:Date:MIME-Version: Subject:To:Cc:References:From:In-Reply-To:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=E/m53gdtCI36jSQF2lXZoBIVaxX/KvGXDKVrKKJTmxQPaH/kQS41Nl6oMonQBc+X jXRwM7rFseBMAQNk+mODTFzTI5LEVGDuorFMrERlMmyalVwSCLpPAiMZt5/wLTjqC Jq8FshCsCfCembG8R1rIoK9nsBDZ0iZ2ZbYuhgIR6p/5oIXNSADX45G333lC30EXk dXBKd795NpnpkxEhGK40hzpXBgsMjnUu0cXZpRNIf8EmPk1E+Yi7u4/gRFw855YTY jSyjUafZl2QDwVP4Y81DmFlUswdxfzgi4Fb2qZaHDmqY2SChjZBLG5s2p1FG3xAQa CNkBuOwGvLlWZquEcQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.162]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MUXpK-1sxXlh261Q-00IoOu; Wed, 18 Dec 2024 10:08:41 +0100 Content-Language: en-US In-Reply-To: <87y10e6uyf.fsf@localhost> X-Provags-ID: V03:K1:bOjOpo53wXGPQZd/rJKQXkqDjUIIfY0FRNuZhjqCusj5J/m8Jxw tw6lfrvmhjGpiU6BSkBpgoVtUnLRyyFUie8n4gAJZgD7wv7tUDnBIorEtrR4xFZc/0nvxfP zAOfP0k9mVJMIQI0gWbjszBUgHbueIV9nINaRkpSUnMCeYaa7Nj8x2feiYZLH226pEPisYv hSROF/JxW0OLCtH2W04Dg== UI-OutboundReport: notjunk:1;M01:P0:YqrE1MaWPOI=;sK/BxUbP3YxUckKNmyeGJIKB2Vr cb31uzix9UbC7gi9rHoGjZ0yWJQTnyy1dS9zsnmZEoxWBhR/ZcCqsAIO8PpHYA9fKiHlEnwAQ TzyrQ2rpcu2LYp4WFPwVtyIikOsBFvMnA341CR8rAAGZuVvts3bYTs9Z9p+5qod2c67KP4JZ1 Qq3i+DeJq1zJJCc9IT/+oOqm9OJvyZfQ5HsvhryQgqJvl52NNcu940kr8P/+TU21Q4CLPrQaV ++LvXl7bS0CCGCmtndyvf80xKqXKWm9OdGmWb0KEc1gQiMeGTE/RAAk+MErdLg7OaDULfdgZ6 NA4XqHWbVp4ij4j3/HNVEnt01uDLGYy2LJWpknLSrwb+rEWWacJR1VlQ+bGeX+o0jHIPIhhJE tKeC8Et88ERRGwfHXrGpG8l9bsMNEd9sXgBMA3ekQtgqfBciUf9eR5JkJlSQsiSU5kDDxMh49 AtZfGsalmRxu0Y7vCGsr0PHBODAhpJaFDxAi+T+W5jd5D76p2kCuZerkGEigc+jlwI7ks/ssV E3951TwJWJ75KM5iZf2uERZ9jJOpAPZlE+WN5c3kmNx6ZTgrSLrTvacHAqE8wkgjHEiruQ7gR pURbMdvUNJc5D/DcR/Nc8QSSSyXbrMZYH7j1FDwiqq+xAenxjxberYoE4y9sf4Ijw/iywrUKa a916sSnF/h5Jdq8TZbB5jjHj9cMrciw7lP+zOgcaMVYdkUM8VcR6YKiQ7JKaZT3Thb3a/vI88 Pfzl91Q5QCi19os3M2MQf6IOvHjHIESbCGbuXx7m43ErQNMZWM5YJ7XMK2rgrddGTS/WKqJM Received-SPF: pass client-ip=212.227.15.15; envelope-from=rudalics@gmx.at; helo=mout.gmx.net X-Spam_score_int: -38 X-Spam_score: -3.9 X-Spam_bar: --- X-Spam_report: (-3.9 / 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=-1.116, 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-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:326635 gmane.emacs.orgmode:164224 Archived-At: This is a multi-part message in MIME format. --------------ARY3HHP5I18o6srk0Nl0PbmF Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit > To be 100% clear, let me try to restate exactly what I have in mind. > > I want to call something like > > (pop-to-buffer BUFFER > '((display-buffer-reuse-window display-buffer-pop-up-window) > (reuse-indirect . t))) > > 1. If there is a window displaying BUFFER, switch to that window > 2. If there is a window that is an indirect buffer of BUFFER or that > shares the same base buffer with BUFFER, switch to that window I included the facility that if there is a window whose buffer is the base buffer of BUFFER use that window. See the attached diff which I did not test very thoroughly. martin --------------ARY3HHP5I18o6srk0Nl0PbmF Content-Type: text/x-patch; charset=UTF-8; name="display-indirect-buffer.diff" Content-Disposition: attachment; filename="display-indirect-buffer.diff" Content-Transfer-Encoding: base64 ZGlmZiAtLWdpdCBhL2xpc3Avd2luZG93LmVsIGIvbGlzcC93aW5kb3cuZWwKaW5kZXggZTlk NTc2NTJlYzYuLjMxYzJhZTUwNzkyIDEwMDY0NAotLS0gYS9saXNwL3dpbmRvdy5lbAorKysg Yi9saXNwL3dpbmRvdy5lbApAQ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VxIGJ1ZmZlciAod2luZG93LWJ1ZmZlcikp CisJCQkgICAgICAoYW5kIHJldXNlLWluZGlyZWN0CisJCQkJICAgKHdpbmRvdy1pbmRpcmVj dC1idWZmZXItcCBuaWwgYnVmZmVyKSkpCiAJCQkgIChub3QgKGNkciAoYXNzcSAnaW5oaWJp dC1zYW1lLXdpbmRvdyBhbGlzdCkpKSkKIAkJICAgICAoc2VsZWN0ZWQtd2luZG93KQogICAg ICAgICAgICAgICAgICAgIDs7IFByZWZlcmFibHkgdXNlIGEgd2luZG93IG9uIHRoZSBzZWxl Y3RlZCBmcmFtZSwKICAgICAgICAgICAgICAgICAgICA7OyBpZiBzdWNoIGEgd2luZG93IGV4 aXN0cyAoQnVnIzM2NjgwKS4KLSAgICAgICAgICAgICAgICAgICAobGV0KiAoKHdpbmRvd3Mg KGRlbHEgKHNlbGVjdGVkLXdpbmRvdykKLSAgICAgICAgICAgICAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgKGdldC1idWZmZXItd2luZG93LWxpc3QKLSAgICAgICAgICAgICAgICAg ICAgICAgICAgICAgICAgICAgICAgICAgIGJ1ZmZlciAnbm9taW5pIGZyYW1lcykpKQorICAg ICAgICAgICAgICAgICAgIChsZXQqICgod2luZG93cworCQkJICAgKGRlbHEgKHNlbGVjdGVk LXdpbmRvdykKKyAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgIChnZXQtYnVmZmVy LXdpbmRvdy1saXN0CisgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgYnVmZmVy ICdub21pbmkgZnJhbWVzIHJldXNlLWluZGlyZWN0KSkpCiAgICAgICAgICAgICAgICAgICAg ICAgICAgIChmaXJzdCAoY2FyIHdpbmRvd3MpKQogICAgICAgICAgICAgICAgICAgICAgICAg ICAodGhpcy1mcmFtZSAoc2VsZWN0ZWQtZnJhbWUpKSkKICAgICAgICAgICAgICAgICAgICAg IChjb25kCg== --------------ARY3HHP5I18o6srk0Nl0PbmF--