From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: martin rudalics via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#74246: [PATCH] Reuse display windows in image-dired Date: Thu, 28 Nov 2024 10:28:23 +0100 Message-ID: <06f264c8-b1a1-4a7f-8fe9-1ca58b2343ff@gmx.at> References: <868qtsmydz.fsf@gnu.org> <86a5dqm9gl.fsf@gnu.org> Reply-To: martin rudalics 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="32052"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 74246@debbugs.gnu.org, stefankangas@gmail.com, Juri Linkov To: Morgan Smith , Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Nov 28 10:29:18 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1tGapp-0008AU-So for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 28 Nov 2024 10:29:18 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGapg-000235-1c; Thu, 28 Nov 2024 04:29: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 1tGapb-000203-0s for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 04:29:04 -0500 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tGapa-0004jc-Ks for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 04:29:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=In-Reply-To:From:References:MIME-Version:Date:To:Subject; bh=SVrjjGXIVTkbZfxajKfFAPLkFnKqXwg04ACjYW5flMo=; b=syI+bBCPB8sfNtpHQbTVny+uEvlZTbMILQq6GIn2uKIEfhv7t0uh/twYHSo/gX7Em5v3eXDncfchMvlZRNbB94iVYXi79e0/83U12GSouZCryUSPR3zFJIJLvhD8EwgVGSvaHWj3aRRMaICX4PZxqaRxnNG5CFwn4gJKgN3Rf9p/f7bi9eymOP9q1kDJJWRPOPn8nlbje0aAxJNyCxMSC2Y3DYovk7gEpP4GkXDAiYbvmIuumMhHu+1ZlQppvClKOld82ZRRqOGv4a/w2zSNpvEj64pZ8LcZDVcqxoBkiks7wfO+DSGLQCTIPh9/ImU4Vf0Ttxqub4RrgFOKTRIIqg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGapa-00066x-2K for bug-gnu-emacs@gnu.org; Thu, 28 Nov 2024 04:29:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: martin rudalics Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 28 Nov 2024 09:29:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74246 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74246-submit@debbugs.gnu.org id=B74246.173278611723444 (code B ref 74246); Thu, 28 Nov 2024 09:29:02 +0000 Original-Received: (at 74246) by debbugs.gnu.org; 28 Nov 2024 09:28:37 +0000 Original-Received: from localhost ([127.0.0.1]:36665 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGapB-000663-AL for submit@debbugs.gnu.org; Thu, 28 Nov 2024 04:28:37 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:40509) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGap8-00065o-Fi for 74246@debbugs.gnu.org; Thu, 28 Nov 2024 04:28:35 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1732786104; x=1733390904; i=rudalics@gmx.at; bh=SVrjjGXIVTkbZfxajKfFAPLkFnKqXwg04ACjYW5flMo=; h=X-UI-Sender-Class:Message-ID:Date:MIME-Version:Subject:To:Cc: References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding:cc:content-transfer-encoding: content-type:date:from:message-id:mime-version:reply-to:subject: to; b=Z7AHOflZPPIlZIi4Xa9voEkwApNrSB1r72vwOMfHjPUGxJB/V4ak+N/nlxpKBYcf qzbRmtrYQxP+tVJV115LrgvBVxhZw4BJxGemTppz6bA6aPd8DCMyJK3iwKQRAnQ+N FHZF5pXVYay+EjjuOgGQJDdigAsLZdBW3BA7OcCQ40uUUq+myjOw0wp76G0e0IZJm MFI9AO1EPMigQStS8L4dZBlDtlinS1Y+6u9jpqCzo/0CC98VYsZ/XS4cN2xVEOnwp /p5TTaMT9GWGqOmb4gnSQkWziRUnDm2Y9IOsP0oA0pGX5faqS/vwFpyMM/HzFsbF2 beR5QJbgmaAo0mdkXw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([212.95.5.21]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MSbxD-1t5uW91wZF-00PHFl; Thu, 28 Nov 2024 10:28:24 +0100 Content-Language: en-US In-Reply-To: X-Provags-ID: V03:K1:AXp/lFK6JWzs9z/3ApNgARvPw/SVbZldwgBtekqBQ3j5f0JmlDE o6WkJvManT4iAsFGUA5GXx/vyUy50DdRLeu8Sb/xhzMEx88id3sqX9EUGGvx2aRogP1CJme l6oPRyHpBqCBKXISXs2pDkOz24WeVZbftp2vVs6/XZz0qYE0lajL9CyzUmwT22eKgI034jj FZKckEbKPwY7tEpXK1Jkg== UI-OutboundReport: notjunk:1;M01:P0:RgZ4GRpl9zA=;kasUT31zYaC/dyKG13hSVCBU2+z ZG8/961NcfC7mcFBN3ZLhXldrHOOEoEdcXYcclJ3SpfBRERYYOHsPh1/Egu66/ZVpVVo6MSku cdMvbhjO3cLCgvX9Sa8LVDOO1HvgMeOR+SPo2C9VcowBwp/45la3PyGac8aNVTAwG24+D7Q4u 4lQmKFVIRQ0+Jyb8n45PCTLCbotzcEzjWKcYge2IrM9SH8Bilme8SRvEdk4FSwRs/MjrG3gEg pz6Rh3yCSpa6ATqblX2ujK6B8kCN/xMMfR9UVYSH5DEFhxXfnlOPp924RxE+81wl2L4O8z1FV rKXD/ljDOvUanikoRmeS3ab0Y8f/hlXnmIatyeruiTnJyMMiwwAEyhnTgus339puxaZMUqMKv SAccrkCZJLb2jOlpZGRZYdPNwDB52feFetCxGGfsbX2GO7RYcpWaD4EFaNMYldWrgit1ZD+Go 6ZeUkMO/wajkglgQljjc1Bb77ZlDCQSwiBRggC7CXhxYsPyKXymrmsjsQzHTA3CpoYi9NrmlC Lmwr+FW63q8wNbUQ6wMeBN3CqJJDfoPB1JW7LzUQzXv4phkD2encdKB1S2+mWsRcn3Mb6MDWG K+x0CvObCRgh5xs90tT7sT6DrBj6OUR/64PNuEyiFuGstufX6S2H2voCuDdylGHw3rnR8kbbY Xu0xbQYgXFWp/qj7G1FMbXDNw+GqVXekRK2bWFLnpPTbDsRVB+0LXAqOd5DGdKfXNvzm2mymP idFNPw7SrQJOPLk7lX6pzYPidbSL1KL+1z0ShPxDlwY5giP2KaLmlxqaLfnhIFfZfvbkT4Bn X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:296048 Archived-At: > I initially explored this option but was weary to use > 'find-file-noselect-1` as it looks like it should be an internal > function and is used only in the file it's defined in. You're right. Which means that we should try to "promote" and document that function. Let's see whether people see any problems with it. > However, I do like this solution the most. Attached is a patch almost > identical to the proposed function. The proposed function would be > perfect if it contained the line '(display-buffer buffer t)'. I'm currently investigating (in the context of Bug#74361) the possibility to provide an option for reusing a window that already has shown a related buffer. 'image-dired-display-next' would indirectly pass that "option" to 'display-buffer' and the latter would try to find an appropriate window with the help of a window parameter reserved for that purpose. Below are ways to implement that "option". Common to all of them is that 'display-buffer' sets up a window parameter for the first window used to display such a buffer and 'display-buffer' would search for a window with the corresponding value ('image-dired' in this case) for that parameter. And the parameter would stay with the window until it is explicitly reset or the window gets collected. - Use the existing 'category' alist entry like (pop-to-buffer buf '(nil (category . image-dired))) This was my original idea. The downside of this approach is that if "category" were used for its already existing purpose (whatever that is), the new purpose we'd gave it here would side-effect the behavior for the existing purpose. - Allow for the value of the existing 'some-window' alist entry to be specified as a string like (pop-to-buffer buf '(nil (some-window . "image-dired"))) Slightly unnatural, but I see no harm with it. - Use a new alist entry, say "parameter" like (pop-to-buffer buf '(nil (parameter . image-dired))) More intuitive maybe. People would have to learn about it. - Write a new action function 'display-buffer-use-window-with-parameter' and use it in conjunction with the previous as (pop-to-buffer buf '(display-buffer-use-window-with-parameter (parameter . image-dired))) Probably the most universal approach but people have to learn about a new action function + alist entry. Adding Juri to the discussion. martin