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, 12 Dec 2024 10:23:59 +0100 Message-ID: <2937c06c-631e-4fce-913d-f9a2fdc1df36@gmx.at> References: <87jzcn1af7.fsf@mail.linkov.net> <08f46ed1-e489-4859-8a25-ba7dc4262b95@gmx.at> <87y1108u9k.fsf@mail.linkov.net> <87ldwyil8q.fsf@mail.linkov.net> <3a5afa37-0ea1-4183-a563-ecc3067818c2@gmx.at> <871pypb43g.fsf@mail.linkov.net> <8cd0088f-1beb-4871-a06c-17f8cfb23e29@gmx.at> <87plm8addt.fsf@mail.linkov.net> <90c5f5d6-37f3-41a6-be7c-903e6d0359ac@gmx.at> <87ikrzjrj1.fsf@mail.linkov.net> <87cyi6f2gb.fsf@mail.linkov.net> <6689d418-d028-40b8-b3d2-4ff12fe4283a@gmx.at> <87ed2jwhm5.fsf@mail.linkov.net> <7a548d2f-144b-45e3-9558-8908a2a4a86b@gmx.at> <875xnsll9k.fsf@mail.linkov.net> <24d8f9ec-788b-4bff-a67f-ccfbca1da725@gmx.at> <877c87o52j.fsf@mail.linkov.net> <87a5d19w42.fsf@mail.linkov.net> 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="32027"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Morgan Smith , Eli Zaretskii , 74246@debbugs.gnu.org, stefankangas@gmail.com To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Thu Dec 12 10:25:33 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 1tLfRr-00089D-OO for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 10:25:31 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLfRh-0007r1-6E; Thu, 12 Dec 2024 04:25:24 -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 1tLfRO-0007gM-RA for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 04:25:05 -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 1tLfRO-00040f-GP for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 04:25: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=PYoB46WVPkQdZ/7pSMc5/+hhk2pfH4xw2aBw/IHIskM=; b=BFsRAh2ELKiWUAjApLwtqbYBHIZFerGtONRB2iGqEfeXR/WEPfRLotTVJW1xtFBfGz+7Au3H21Ml5ehMF+fwei653O9UpxBJVc9MJ0GEp2ca8XVKrXYGih4aK2A/CCszemIgpJXzcmwNg/WucP628HF7lURTRVTktxuBEllqMIRITvr4IdYQ9L5qxdlEdqSim0b9PMQePqRD5pLTWH0uqH3CebAIlBoJjgaMEIDfsQX0VUS3fmk7xYlAng7PGkkZ2R3sQEGdSlji7jhKtwiv1dDdBbAHtErcIVK1wAxjAAO1YhHT4ylpVjZD+C/cmsF+k7za/w4YHCL9/rNqE8XNdg==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLfRN-0003T2-Tl for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 04:25:01 -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, 12 Dec 2024 09:25:01 +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.173399545213200 (code B ref 74246); Thu, 12 Dec 2024 09:25:01 +0000 Original-Received: (at 74246) by debbugs.gnu.org; 12 Dec 2024 09:24:12 +0000 Original-Received: from localhost ([127.0.0.1]:37661 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLfQZ-0003Qq-JO for submit@debbugs.gnu.org; Thu, 12 Dec 2024 04:24:11 -0500 Original-Received: from mout.gmx.net ([212.227.15.15]:41819) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLfQW-0003QO-Sx for 74246@debbugs.gnu.org; Thu, 12 Dec 2024 04:24:09 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1733995440; x=1734600240; i=rudalics@gmx.at; bh=PYoB46WVPkQdZ/7pSMc5/+hhk2pfH4xw2aBw/IHIskM=; 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=MgRYvMNhgzifiQVRHRTHnESTxIqdB0ZXfVHnS0Y8X8o2hgl3aNgHm8UVotKf5+Mq US3ooyOJj+UmKi0rnLbWoMhq8xX1dcSEvcQtUS40akEWZMBVTVeTpnfdsHLLLchqg YgQC4J15hO2QQioje2o6zni+KjgKhHk+ha/Ss0QUyo9nK4PdSs9tepo9jPSvJi7Kc DYVzcHjoGsEB9Zd/SUJJZAbXjAkDp/vZg/TA+W+NMdARHOWbZqTDDS5yAyd3qqdG8 W9Sq8V9Gq77lDLG5/Np1wljgwkitu2YmO8SmM3XiGFFP3p+nE9BxdCMFA3PxUO7ly ZQXAJ9+ASUccKqRdPQ== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([212.95.5.75]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MQvCv-1t0a4F0Yz9-00Vi15; Thu, 12 Dec 2024 10:24:00 +0100 Content-Language: en-US In-Reply-To: <87a5d19w42.fsf@mail.linkov.net> X-Provags-ID: V03:K1:QcTKunTaxqyxXSugqmEW8qXF4YdcFAyS+XgvXGkXJsfzc1lHz+j 8Bf8aHqoX+DSB+UVDmO9sAZpJkWm2qtWWJP9qWIOy/4Vcpe/CoGZ5eid/c52wwAQJgYmK7g L+qCLJHU4/2mUrc9e5X4TIN4UaEkULwpL+EkFgA7BffFisMe0HFR+b3HFTi0sD+W6rtft7C 57zSxcmzDUsIr08cJQOJA== UI-OutboundReport: notjunk:1;M01:P0:c61dSFNQCiM=;pA96Amszs6Zm+Dpso/3dJU2v7CP kD7hf3qQBF0KylCwQ3KJB1nqk2vTs1NQ2/zGqwQcCs+SXMcXXPppD+cs1AqpWm8SRInxxLYvC vHSaXxaBY94EMMUB2xV7+OwyS3rR0HM8ee9VzKLgo/4rYujnK5c7dExGyD3vYjOLFsmUci3/x E2eCBshQWG4WaGqLNttMf9SePp2xfLc8xOqzQP/CnrmxVAGD510Dk19KO5uDk7hO9IR6DX9Ce wuqD0pBUwuUCuQ1pZpII5+C0UdZgILm5KN/bxTY6GvJXM0Z9EFvdveo4AjEuZLqGqGH9F44cB 1BVtAkKl4SZCtrikhTpS5Xj3G2KHlT9gMToRBGAcD2Mv5Da5lwQNhQfqSG/yHcF6N29rkDuMB Hv+9NucyBJ4dT4Fnq2l44824NyS4yj8jhA4LlBXRuDqfdAxvQSh1f0fvbOI+XcvLaVfV20mUY /sR6XbiYnrzLsiapklgE5c56ryuk2LYeA3mQUKz7BZqt3ppFJehkFWh4WmHtCIFKBiFv6hQjv bgFmftJ+F8qC1sSdPSYWQmOmBFgTAZg+uD5AUcgsFkuR70Hv8rc3yTFlOZSHxGhdRW0q7vHgk YPKNflrUzwPGNQiYL3+gnmGg9MjMLFvVOoOV0z+SI3LvrgxKE1gPL3zHAtm4OJG6GgBviKe4a Gsltmllr+XXWpNUm+Bstn8n5iPkmZZhxy+DC7jD/FF9IHFLuRXs/RCWkmJz9embp5Zjs+jxEF Xg7WylLbmUjl6G3gmgXH9jThUrBtjOkUSQbCfu06vAluoDKKTyc1YjYViqDf1elCKpmH0dnK 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:296898 Archived-At: >> By having grep do the following: >> >> - Issue a first request to display a buffer from that list, >> >> - remember the window used, >> >> - set the local variable in the target buffer to the remembered value >> before calling 'display-buffer' again. > > What if the user switches buffers in that window, but still wants > to continue visiting next buffers from grep in the same window? It would have been the buffer-local value in the last target buffer displayed. But it's inconvenient and obviously fails if that target buffer has been deleted in the meantime. So it's not a good solution either. It's only advantage would have been that such a local variable could have been shared between applications - grep and xref say - to make sure one and the same buffer would always go to the same window. > grep/xref should remember that window in a buffer-local variable? As I'd envision it, xref would use a conceptually global variable called 'xref-target-window' or 'xref-last-window-used' and grep would do something similar. >> and propose it via a (some-window . ,window) alist entry in the next >> call together with 'display-buffer-use-some-window'? > > Such providing that window in the display-buffer call would be very nice > to do, e.g. with a more descriptive name like (previous-window . ,window). > This will make easier for users to customize by using different actions > that handle such alist entry: 'display-buffer-in-previous-window' or > 'display-buffer-use-some-window'. No objections; just that the semantics of "previous-window" was so far a "window that was showing that buffer" while here we would mean a "window that was showing a buffer from the same caller". > Then a category will be continued to be used only for matching, > e.g. the call > > (display-buffer buffer `((nil (category . grep) (previous-window . ,window)))) > > could be customized to match a category and to use the previous window: > > ((category . grep) > (display-buffer-in-previous-window)) Wouldn't that be overkill? The user's customization would have no effect IIUC. I'd say (display-buffer buffer `((nil (category . grep) (some-window . ,window)))) would be grep's proposal and a user's ((category . grep) (display-buffer-in-previous-window)) would try to find a window that previously displayed the buffer first. martin