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#74361: [PATCH] New option xref-navigation-display-window-action Date: Mon, 25 Nov 2024 10:18:34 +0100 Message-ID: References: <87msi1ueb0.fsf@mail.linkov.net> <4256f446-e11b-450c-b455-131cb75acab0@gutov.dev> <871pzbj8mq.fsf@mail.linkov.net> <87sernhxoa.fsf@mail.linkov.net> <1d08c589-2d0e-4f10-8c2e-e21c206ac118@gmx.at> <78a96965-31c1-4688-b808-2de09d1832c4@gmx.at> <878qt9pz4w.fsf@mail.linkov.net> <05452bef-dd2e-4e93-abdd-6eb391027197@gmx.at> <87y118cyyk.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="2259"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: Dmitry Gutov , 74361@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Nov 25 10:19:22 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 1tFVFZ-0000Qc-Qn for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 25 Nov 2024 10:19:22 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tFVFJ-0008D4-VG; Mon, 25 Nov 2024 04:19:06 -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 1tFVFH-0008Cw-EE for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 04:19: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 1tFVFG-0001ZY-3m for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 04:19: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=3c0lYVWKAyuhBEo5J4l3iakt3JCkK9NIwFSJAjCvNRM=; b=MIZuN3O7SWCCiJoSlpmpaP7WD3S8mpbKJqJuC5wwyX/3YUl87LHXUdI5FLA1NyIUl1IUsSXtlMcWvjBN/HoYgQIn+BMyGbbLjB6ICudklaMAEd6uEx+bGEwxsJSN94/YKsaNUYNaxtuLhRqmsBM9Xduc8rJbq3c7+uPTj5A4nkfzl5eRbUGAEnLFlJ3NyWmtHJAFrSQP2+KEzvXFkUt+PWpZQ6kDtyTd5/f9MxnDrKOOXKnoQdNIYPWd2gO0cBV4N9YDxhTaK/OWLrxjUfYC+BePHal4DJ/2Z1gACkfyLO2RAfEckvnJ7e1Eq7XH6Liy+MF0zZ14u+8HoYR2lExN0A==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tFVFF-0004oD-Uq for bug-gnu-emacs@gnu.org; Mon, 25 Nov 2024 04:19: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: Mon, 25 Nov 2024 09:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 74361 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 74361-submit@debbugs.gnu.org id=B74361.173252633018463 (code B ref 74361); Mon, 25 Nov 2024 09:19:01 +0000 Original-Received: (at 74361) by debbugs.gnu.org; 25 Nov 2024 09:18:50 +0000 Original-Received: from localhost ([127.0.0.1]:37872 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFVF4-0004nj-4G for submit@debbugs.gnu.org; Mon, 25 Nov 2024 04:18:50 -0500 Original-Received: from mout.gmx.net ([212.227.15.19]:34185) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tFVF1-0004nW-Jj for 74361@debbugs.gnu.org; Mon, 25 Nov 2024 04:18:48 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmx.at; s=s31663417; t=1732526318; x=1733131118; i=rudalics@gmx.at; bh=3c0lYVWKAyuhBEo5J4l3iakt3JCkK9NIwFSJAjCvNRM=; 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=lckm1ub1+z1vMPizeoRnffLv+hyoMD3zxv8Z+2GSx5zwrJeLIMZhNfmw4XZ0Bmur Mfr7+xlWayCXKntUkuRtF0H8Gic/2qSmYBGokB4wi+bmIwC9tRgOR+MYfkJJyh1y9 hc5LnobFAuVhfUysTO+nmF+5dEF80PQl8pTBDQaAaIFM33yoSp/MHwDQkH16KLsZT ay5/VwYmFLg60/SvVGyimr63JVKkkzIN8GDHgkktVaPttS+ICP+yeP18AFX3rmpQ3 XCIQFBu6H5YDdGXBeQTDYCupugL9nGcm3woVEaxSnQcvOfo++5eKbeKzHODAuyErD Si3LVe3e7ADhPxIdBw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Original-Received: from [192.168.31.113] ([213.142.96.218]) by mail.gmx.net (mrgmx004 [212.227.17.190]) with ESMTPSA (Nemesis) id 1MpDNl-1u41rt2FEl-00gonZ; Mon, 25 Nov 2024 10:18:38 +0100 Content-Language: en-US In-Reply-To: <87y118cyyk.fsf@mail.linkov.net> X-Provags-ID: V03:K1:3pdOP6qkvfGw6BLq8seaoBabyhAoFk6SDXG78SYCxD1duuw9AfU 8ztMZtwGLOq7UPjv2VLa43cR4tF+aC1pbFe1Xe4JHeDYpkM93x/DzcDvrP6gcOlc9mQctu0 VIs+t5/PrmS/4p9UcKBOC61aAHaOAn3y1JkWBn2vsfqBUPqQcRbJSA7+XCV0wudkxDgo2nm FszxMfl+RRN8Lb/5BeUUQ== UI-OutboundReport: notjunk:1;M01:P0:n/PQhcVmhLg=;dhevydTwbWuM8gSmyLz7F+Ul+9W OLNHl5oHDr8AVX2CZNeoRjZchdtxaUl3MsogyjATP9A6qE+yqRBTspIaR5JPpV2D3+oZVeSfP 6K2K3TcXFkVnX9a8vNjLH2uQudbU5V+762SEnmiEDRXQEkHGyEGbF2Rd/8e/uyXJGfigFCbRE TsTk3w/GPCDDZgPsMqx/pyWzbnd8F2D2DnD6g0qsxEZSQtL4zTzprCXuX3Bp2v9aOjyFSJ/be hTDbwczhfK7XBn4YgPbZ/L+uclI0rmkx4JviJvYwjmwimszebMk1Wn0YkQP0dIr1ei935iDM+ LhwYbWdK1g0KsSTRttljREq/VAF6tnC1dhyS4DD4CpPgDEvUVKj2djlQIWPdyGE1zCvjLwrWZ MzdptWwXGpeiMH9t5Glb+AiiiclClyK4gbif4DnMFJ1qvR7A/u3oLFvRDNcjKL8Lj6q8QqElo cG6Ix5ADScInAKyp++QCZ6tq8DUBtgb6HUvVrrvqd5YOKppwA7luR/ArvW6DT3+8FNzKwSmlg Cc7ZbBkoIgUd0mqHDxD9ou7OQXim9CifUG6/3mVo4oAjFLn6vFhLxrezpVvGTQPUb+NznPEeb xvcOlnKQa982WF6MsERBxU7qWNGWLVLr/F5LWfDkZyZNV0PHdtAMfznoKqB56kRL5UOEMog9e LiVbHuojfXT/E1BMRsTTAbDvLVt+oXfBt+uP+P6RP1AhtklGr2zQ6xUiPUH/kecegb9g3cnFU vySnAtIMeOYvH7X1z2GaQ7Rf3TtvPDlzOmT1NzJhShwSi22i4vS3w1QNgaTA+9QNNzKKH5qN 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:295938 Archived-At: > The key word is "automagically". Only this is a problem. > Many users might not want such magic. [...] > But the category should be the same to match: > > (add-to-list 'display-buffer-alist > '((category . Info-mode) > (display-buffer-same-window))) > > (display-buffer (get-buffer-create "*info*") > '(nil (category . Info-mode))) > > So for a similar function like 'display-buffer-reuse-category-window' > we need another alist element, not 'category'. > Maybe 'display-buffer-reuse-group-window' with 'group' list element > for a group of buffers in the same window. We can't reasonably expect packages to set up yet another alist entry type like 'group'. package writers just would not understand it. So it simply _has_ to be 'category' (or something else but still only one thing). Hence any magic users might not want would have to be implemented within 'display-buffer'. If say 'run-scheme' wants the same window, then we already have a problem since a *scheme* window might already exist from a previous run and it should try 'display-buffer-reuse-window' first. But this is something for people setting up the default. Now if no 'inhibit-same-window' alist entry is found and the selected window is not dedicated to another buffer, 'display-buffer' would use the selected window as requested. No automagic here. Otherwise, it would look for a window with a 'category' window parameter equaling 'comint' which could, let's assume the worst, mean to use an existing *shell* window with a running process the user might be attentively following at that moment. But the same could happen with your proposal as well. So any automagic here should not harm either. The automagic would come into play when neither caller nor user specify a particular preference for a window or all other preferences have been exhausted and 'display-buffer' invokes 'display-buffer-use-some-window' (not 'display-buffer-reuse-window') in which case that function would look for a window with a matching 'category' parameter. Which problems do you see here? martin