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 18:24:39 +0100 Message-ID: <13844476-f2b0-4875-b77f-784013086044@gmx.at> References: <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> <2937c06c-631e-4fce-913d-f9a2fdc1df36@gmx.at> <87ldwl2bgf.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="23578"; 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 18:25:24 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 1tLmwE-0005uO-4r for geb-bug-gnu-emacs@m.gmane-mx.org; Thu, 12 Dec 2024 18:25:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLmw1-00025D-7Y; Thu, 12 Dec 2024 12:25:09 -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 1tLmvv-0001vV-3J for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 12:25: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 1tLmvu-0006yA-II for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 12: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=FH2DlbNr/AGEZf+VgKNLEy2F+TG358tr84y/FIzOc9A=; b=e39CL19xrxO4LJ8mje3e/k/v6ZslrzL5K2dgOqkHVRYltX+liYVStyHB7loge1uwLwsXSKn7zswk4UyPVlmySK7Fwmj2SWwQpd1g3pYTigEYAUW98JaiWbES/8GZ9oHmX0eeokN6GvVQfjevHh5BThIt6WDq8DQ+FSC1ZWFoOp9LewcKnpHa/03IabmhqOBVE78CN8W9hWfc/J4un6eGnEIb3Ohm9DUwp95iHXMMUdj9ipUkPSy0Ma7Ndx3jBkjJA4Y+gZRJkg+ZwM9S0vURW6Pj9N9yixjPL7TWpC/pl9W5f1nLP/2OswdA+ZsW01TzPB69/uAsHpryeefVA2vcWQ==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLmvu-0005y0-4z for bug-gnu-emacs@gnu.org; Thu, 12 Dec 2024 12:25: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, 12 Dec 2024 17:25: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.173402429722918 (code B ref 74246); Thu, 12 Dec 2024 17:25:02 +0000 Original-Received: (at 74246) by debbugs.gnu.org; 12 Dec 2024 17:24:57 +0000 Original-Received: from localhost ([127.0.0.1]:40142 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLmvo-0005x9-HG for submit@debbugs.gnu.org; Thu, 12 Dec 2024 12:24:56 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:55249) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLmvj-0005wj-As for 74246@debbugs.gnu.org; Thu, 12 Dec 2024 12:24:55 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1734024281; x=1734629081; i=rudalics@gmx.at; bh=FH2DlbNr/AGEZf+VgKNLEy2F+TG358tr84y/FIzOc9A=; 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=N5cGFTnW7kowzpXuJXGWbLA8ncd/9cDxBize5WjHVzc8YXFNSrMuh7cZVbjTUiBM qidaOxNKYfVq4RtwpQW1cdqXVXKPm+oTxLcN5/l3D0Izgl1RIBH43vrv3j4PG0H9c p2WVSLQMav5v6XNTSkNY8uI6QxUO2gbnmB1V4Km2yZIi1eU0AR8BbYXkvnuolU8F/ Xile3EM8Ndb9wK39M5wvDbP1ePV+wy2TyUV+jwPkxD/hst4EO2mp4kPPFJghtUuS0 rWD7aySA6AYtmLYv2vQ+zIP06q+HuHG+5t08h821++x+UMYDUmfLwhtfSHofaKgrc fHb+k4Y5D+MtnKzICw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.30]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MGyxN-1tPNpi14br-000TDM; Thu, 12 Dec 2024 18:24:41 +0100 Content-Language: en-US In-Reply-To: <87ldwl2bgf.fsf@mail.linkov.net> X-Provags-ID: V03:K1:06z2v6IePNN99mVYn4YextRqyaqQIY6EOc17HMFDO2CIQhcPIHo WjQf+BDocePhoB+1kMDjJhIX9lH2hfgQ5Utiuz3lw1wtfIdJrwkFx2nbAPD5FidbFwBy1Pj 4KqbvoyPx6n9PZ8Jjxwb7yeiC2rSfVSUv5CILssbhyxkl6zOQ+fU7wNTLF+LlKTJZ+uazTt FaHWozUgTlv0CdeaXwaSw== UI-OutboundReport: notjunk:1;M01:P0:dkkJAfKjYpo=;undpRhWzVYouOZoQGX3xZcRFq6S ccZzKNLhg97kya4m2sGw7rXvW4r91vKqMHxMZVGLAdg7J8ySKtaZHdzTJw5uhRP5C8kkB+dw2 KUp8su2ujhLB7AGrHy0zE7Z2EjkuoteIwuFfOhTPYhLtJ33RKXuvKr3/pa+9C+xPYdFgDumEq Yp5L0VE/NPJ7mhVi3yBzqN50vq4DERiCwTEtcixmWeFSLD0EFk5vyLfcdAUq3mr0pqD4kxRCi vsG3n80umfRHzasE05Ws0maPFHrPWVPPNpNGaicVJY7TR5bqQqXkpk66+TJapTZaQs5qLqvSG xmQp2ncp1GZGC4wB0gS6/7qQk/c3Y2s1JM1RMyhCPxzimu9FhvT7xZ7jk1e3jt9cx+DLNtLAi KPfTbCl5NaTsOmwcBuoj+ETEaUW4TUeDxIZLMOSfJE18FTdK2WPWDdGaKhnpF8Dn92qIj169H SmHkmrCajO4tvoeE2CCUb3i5ngdBVhXVd+CrqoqNaZSCL72pfQobujoJ4seBeQD31ovzt9G+0 rw9RnyrEtdqLBCLNRFv9dZKMyZKRm2YqWcGRp3/ZI9MNNF33cAREW0hYWiKxkHWcVJJBidvRE m3UrIZi5BzdiPKd8+/Fa+2Kv0TfiAPDqFcGSYWb9nUX0TxxdYueDUbTw74DI6W5xAl6HsjWEM FVgC28Qy7mx7njW7XBiTKYloV0B0u5wBO/Tjp/avzpEpd7BoTLMsoegIcoN2AKt67AMalC4HO ZDImbmjbeBuWJ13GSOWfieRGflrjIWYWJLOm0TqdV1AZ8NyVuaWH1i35qQaA8h5ZpKbdPBqZ 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:296930 Archived-At: > Please not a global variable. I often use many pairs of > source/target windows at the same time for different grep/xref > results. I do that too. Just that my "source window" is a sidebar of the target window. > Still too limited solution when the users can't store the last window > for other commands. Better would be to add a new alist entry that > will force 'display-buffer' to remember the last window from any call: > > (display-buffer buffer `((nil (category . compilation) > (remember-last-window . t)))) > > or by user customization of display-buffer-alist: > > ((category . compilation) > (nil (remember-last-window . t))) In that case the 'last-window' parameter maintained by 'display-buffer' would have to become a list of categories. Then what about two grep operations running in parallel as you mention above: Would they share the same target window? > And a function that stores/restores the last window could be customizable as well. > So the users could decide whether to save it in a buffer-local variable, ... buffer-local where - in the source or the target buffer? > or in the window parameter. This option could be like 'xref-history-storage' > that provides the choice of 'xref-global-history' or 'xref-window-local-history': > > ((category . compilation) > (nil (remember-last-window . global))) > > or > > ((category . compilation) > (nil (remember-last-window . window-local))) > > or > > ((category . compilation) > (nil (remember-last-window . buffer-local))) Just think of describing this in the manual. But I already see: We'll have to maintain a buffer-local variable, say 'xref-last-window' in the source buffer, have xref consult that variable and pass it as (last-window . ,xref-last-window) to 'display-buffer'. The value returned by 'display-buffer' would then become the new value of 'xref-last-window' in the source buffer. Would that be OK with you? martin