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: Wed, 11 Dec 2024 10:38:21 +0100 Message-ID: References: <06f264c8-b1a1-4a7f-8fe9-1ca58b2343ff@gmx.at> <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> 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="31576"; 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 Wed Dec 11 10:39:12 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 1tLJBX-00080K-6j for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 11 Dec 2024 10:39:11 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tLJBQ-0003H3-9H; Wed, 11 Dec 2024 04:39:04 -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 1tLJBO-0003Gm-CV for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 04:39:03 -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 1tLJBO-0003Nq-4H for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 04:39: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=iUlLdHjEENoy2RTXfb5U7yIwBu5uKuRIK8rmjMDLRX8=; b=PxphCPs6uCcFXWVDl4g+xGJB3hiVZ60tx0lCXbPMnYVH6ZLuOkY7YSsjtuHZjqn/S3cFcF4/7giuuTmL8e0fxGK6Spttay0QitR7SeQyr0ffEhrkWs685DxEI6FHUIsiIrLTtk32NAFm1B7IEfYFqxUpuXq7eWZmb891xDiANg6tgl9IluEi2omTh6FU33h4qdgEfUPa5A4N389gCWy0AUraliK/K92toFW5P8boqGVJXdtOS/0WEQcPbaelPG8i+adaLDzwk9S+DFHlXac4knEHTTO1/2CGqeCxy9fCnTp4e81Y2Mur9dpvGPJBRGqJf2xYKWz3bUc/HdBO2v10Iw==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tLJBN-00019i-MG for bug-gnu-emacs@gnu.org; Wed, 11 Dec 2024 04:39: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: Wed, 11 Dec 2024 09:39: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.17339099174372 (code B ref 74246); Wed, 11 Dec 2024 09:39:01 +0000 Original-Received: (at 74246) by debbugs.gnu.org; 11 Dec 2024 09:38:37 +0000 Original-Received: from localhost ([127.0.0.1]:32923 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLJAu-00018G-RA for submit@debbugs.gnu.org; Wed, 11 Dec 2024 04:38:37 -0500 Original-Received: from mout.gmx.net ([212.227.15.18]:60387) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tLJAs-00017k-GJ for 74246@debbugs.gnu.org; Wed, 11 Dec 2024 04:38:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1733909902; x=1734514702; i=rudalics@gmx.at; bh=iUlLdHjEENoy2RTXfb5U7yIwBu5uKuRIK8rmjMDLRX8=; 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=KVGbI8h0dm7XkzEZPU/OAAaK3BcpOa0AByjO0soVFaX2q7UVFt1s0Ve0wRwZN6k2 DlKQGXtr7/xyryjDxmLH9MZXd7E7k86sNXQdmsO2nIHEYHxu1unK4o3luVNP7L3ZA QSo1j6Ym8tEkqeKoVbFbPxpbktW+O4fl5pWzgY9oTFI7z+ubb5EYgCfsc68qdKqZP gM/ZQlcQssJB+XJQVIR1m8eXQk2kewuZAySm02h75ihFMKLNy5ntUl8P1SgcX/Gdv G9oA1TFWAe46E4gLJri9ZUwceup6Bgue63MPhSCdXvfv6fGQSt283cEKkTbebqM+p vmURcljWJFmvWls+Bg== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.97.12]) by mail.gmx.net (mrgmx005 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MacSe-1tszEF3Uk6-00oblS; Wed, 11 Dec 2024 10:38:21 +0100 Content-Language: en-US In-Reply-To: <877c87o52j.fsf@mail.linkov.net> X-Provags-ID: V03:K1:kbfIi6a/e0a6HVauw7mnD8IHMcTq4eXCrFoRdFAZOyE/xJReuWI 8J3Cfy0o3K7nh5U4lY+mJ9PGIem99vss1j1xGwNR9kU9CFaRRLtCq11fbvXo/mVqHuMrkEe nz6lGaS0PisIEXV3lRZxUnAOLFpQUb/Q+SjY4RzXB8LnWwOUmev1g7iCbxGH9lQArw3xNNj 9Zfhqt4MnQKsYKgc1LKhw== UI-OutboundReport: notjunk:1;M01:P0:97TJMIrLQcg=;icTbISuHfZodrV53DQvRhqKxWEx VYB9yA6NK6vDO2UQ322/SbHOsmoE/Wb2eTLzjy6u7WeNrsYt/2aUNYh+5Gk+Y38L8DCoSbDRx 6PGvKXt6BMQbjHcu6YVnI+STbvpMpy8ZGe9c0Dqk3cwVecjraGw1h2xXN2ARiLZr3LD7p1yjD Y2c0ilRUjWZ6kUPmYyYSULjoJZ8Ig0ETq153gGLZh3iJ0JDQLOfmLjqPDzaNFgmn/3S7Y+SHU 7uQn1ar1lBeJgDfkBsQAiVK7W7vNASCHO6k0h0+7dRGrJ7J+bK6UcmtZZStONsd2QrTT82FM4 ptCb1rhxVeuh3kjt40rR5I8w+5vLAbUlHZPf4OElXyE3B5edcSVtoZzpOOfkcpXq1Dya8kjJr WmNxH73LVFZoDN6/zQW0kD+zj7+lE9C8yyWaaf59DYZ7S3WtjZtvnaYrPDSBDs16/KlDGPP42 +uHmwkntPbdfQ2t6AMknQMoulD6S8BFMsucdCyCKlHIt++xdUHykNnk22hQonhhgYbhbQf/GR fSeujJpZy3D4I+y+V8tb4+4+Q5rtS6QY4OuYNJk+4Xz34dfCx77ooSIAYpy4zMoU0OjfSbqtA Cu0p6OjD9PktoqRE6qHcm41PKo67usDr6/asOXCv6iTw39R9b+pYIFudWTQf9Iol02x7b0jtb W3TZHEAReqsWh7GUYFyaNmCYtWsJdfxmqex6O1VJGVkOUvP3A27iB1ejWTfHWh5e08V89kvDJ sj10qXStdV3o0CPlBd8c/QJlvBN/nWBwCsTymp/fpiSyy/hblkeLVahzN5al/G9EdAmO0oh5 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:296810 Archived-At: > I still don't understand how a local variable in one target buffer could > help to display another buffer in the same window from grep/xref list. 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. It could do that if it wanted to communicate the window to use in a buffer local variable thus avoiding to pass an extra value via the alist. >> Would you like that? I think displaying *backtrace* in the same window >> is always a bad idea. > > Only when 'display-buffer-below-selected' fails that is extremely rare. I assumed that the user had customized it. >>>> pass the symbol of the function calling 'display-buffer' with some >>>> unique number identifying the nth call of 'display-buffer' within that >>>> function. Everything else is guesswork. >>> >>> There is already such a symbol: 'category'. 'category' is much broader. >> But this one is already handled by 'buffer-match-p'. We can't set it >> willy-nilly to some arbitrary value. Otherwise, that function might >> match it in an unexpected way. > > 'display-buffer-reuse-category-window' could reuse the 'category' symbol. > Or '(some-window . reuse-category)'. Let me turn the table and ask you: Both grep/xref know very well which window was used for displaying the last match. What speaks again to have them just remember that window after each call and propose it via a (some-window . ,window) alist entry in the next call together with 'display-buffer-use-some-window'? I think the main advantage of such an approach is that grep/xref would be in complete control of a good proposal for such a window, something most users could hardly resist. > Not either, but preferably the last used window. Not preferably, IMHO. >> 'image-dired' _is_ different because it always uses the same buffer for >> showing images stored in different files. I know of no other function >> doing that. Do you? > > I don't remember any other function doing such non-standard things. So IMHO we should exploit that fact in its 'display-buffer' call. martin