From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#74361: [PATCH] New option xref-navigation-display-window-action Date: Wed, 27 Nov 2024 15:07:46 +0200 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> <871pyzp6br.fsf@mail.linkov.net> <25443bb1-788a-4f06-9350-5d2c666f6795@gmx.at> <32b8cc56-afa1-40f6-933f-6de0df2b9f63@gutov.dev> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11234"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla Thunderbird Cc: 74361@debbugs.gnu.org To: martin rudalics , Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Nov 27 14:08:34 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 1tGHmS-0002fU-7L for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 27 Nov 2024 14:08:33 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tGHm8-0007x2-57; Wed, 27 Nov 2024 08:08:12 -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 1tGHm4-0007wd-Pe for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 08:08:09 -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 1tGHlz-000522-VM for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 08:08:05 -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=NRjLsR5+39rfQrx/j3l3RrjVntwBMWbN4n9kipDKjhs=; b=ZPtgpNck9rkIwjGhFkfna9hDzgm51UOA7tIeKabyWZ58R5zIZvmXxKbuphVzEZxFlAXBRED3hzkJHl2abmUqYRdyVC2pJvtoIhBVx50dGAlLHcjurpE9McnHCVCPi2fuLw94+wgMvBav4xDu+7HAZCvqQkN18o8XXvPR7D9ZenI81RPIEpU7iTOccwcFIPbqufrjiBvV0ZrMo4F3lYeby0v1+/vU2j6RHzrUTDPFDXa75+sZ/jrag0dr8JO0kTACNF2uAkEeAEbXW05w6Lj6DH4Fhuh///lNzwzu/z+mjjagG4ztYbNx9cOxaou9Q3NJXOoyhN40aVTPlhCbDpniZA==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tGHly-00051m-Gm for bug-gnu-emacs@gnu.org; Wed, 27 Nov 2024 08:08:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 27 Nov 2024 13:08:02 +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.173271287919316 (code B ref 74361); Wed, 27 Nov 2024 13:08:02 +0000 Original-Received: (at 74361) by debbugs.gnu.org; 27 Nov 2024 13:07:59 +0000 Original-Received: from localhost ([127.0.0.1]:60939 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGHlu-00051U-Ju for submit@debbugs.gnu.org; Wed, 27 Nov 2024 08:07:59 -0500 Original-Received: from fout-b3-smtp.messagingengine.com ([202.12.124.146]:40753) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tGHlr-00051C-Tq for 74361@debbugs.gnu.org; Wed, 27 Nov 2024 08:07:56 -0500 Original-Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfout.stl.internal (Postfix) with ESMTP id 3EC5711400FC; Wed, 27 Nov 2024 08:07:50 -0500 (EST) Original-Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-08.internal (MEProxy); Wed, 27 Nov 2024 08:07:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=cc :cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm2; t=1732712870; x=1732799270; bh=NRjLsR5+39rfQrx/j3l3RrjVntwBMWbN4n9kipDKjhs=; b= knpWjhIwlOOL/YFL1J1gRpWRhoXNunbA7nyQSj7ZJIQsCKAw72eMU/Q4krjlNLne aOUt3cdBmMjVAFZcmvqRTUxjT8GLU526PWs+rtRcSg2UxwHpC2ovafp8q8gRDITO fvXXZP2uX01rXRhk/qGMt0Tjq73wpyuPS6NTPt1wSVmi4Dt/ZsTm9cZgasWYWNC+ ydt5IKOSe6CTj6Je8BCxri/20xK1WMJQfu/f4yHxxxObGnelYO6isMGYxHe9U76k 2wkVEXm79IU3AKHu9PfyVIyZ4pT3AkqYxpQhy4G5h5bwprAgPXYrmR5CoGYNOEu8 vqTlQKFUSDioAtrg6rh9TQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1732712870; x= 1732799270; bh=NRjLsR5+39rfQrx/j3l3RrjVntwBMWbN4n9kipDKjhs=; b=G kfo3tKpurbgULkgwomBSN5BQAWyMZTLoWpiOmJEnOBq5nt0MUhNRHAd8Wuc6VDn/ AiVC42Hqg6Vxw//5tR/8N6/gBvTiMjRKKNgB7FC47hKhxzvKhf/Q4bidGQLPvNTe pCjuu4XgG0rtNLT91Plc6m6NHFAR5hMIOTH8MDOa3SQ0NF2vVDxwEF4GNhaSILlp KN/dd4t3HwFEUU6m15CUOmr5YjcsPf+kPH/PcQU35Ry/ngnvLoPOtqlDwQPMpgsq wemBjT3QRDl/LvUhoaSEIbgTgtgkKIaAmPjx2xu6MwljpsVsTOAo8GrDu5SA6Bdu PGj2MiB3pZH9FcujCSlwg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrgeelgdeggecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthekredttddvjeen ucfhrhhomhepffhmihhtrhihucfiuhhtohhvuceoughmihhtrhihsehguhhtohhvrdguvg hvqeenucggtffrrghtthgvrhhnpeegleefteekgffhvdfhtdegveevveetteegteevgeet tdehhfdukeetheffueekkeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegumhhithhrhiesghhuthhovhdruggvvhdpnhgspghrtghpthhtohep fedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtoheprhhuuggrlhhitghssehgmhigrd grthdprhgtphhtthhopehjuhhriheslhhinhhkohhvrdhnvghtpdhrtghpthhtohepjeeg feeiudesuggvsggsuhhgshdrghhnuhdrohhrgh X-ME-Proxy: Feedback-ID: i07de48aa:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 27 Nov 2024 08:07:48 -0500 (EST) Content-Language: en-US In-Reply-To: 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:296031 Archived-At: On 27/11/2024 10:58, martin rudalics wrote: > > Just to note - in the patch that I've just pushed for Xref the > > category ('xref-jump') doesn't describe the destination buffer but > > only the command that is currently being executed. The destination > > buffers are regular file buffers, usually not distinct from the other > > file buffers belonging to the same project. > > As I understand it, both 'xref--switch-to-buffer' and > 'xref--display-buffer-in-window' prefer the selected window.  Only if > the selected window is not suitable, 'display-buffer-use-some-window' > could prefer a window with a 'xref-jump' 'category' parameter instead of > using the 'lru' window.  I don't think anyone would even notice the > difference. It does seem like it will switch to the "mru" kind of placement though: as soon as "some" other window is used for xref-jump once, all the following similar calls will follow it. Might be an improvement, but definitely an incompatible change. > If a user does > > +  (setq display-buffer-alist '(((category . xref) > +                                (display-buffer-reuse-window > +                                 display-buffer-use-some-window) > +                                (some-window . mru)))) > > the 'some-window' entry on the last line would override any automagic in > 'display-buffer-use-some-window' as I envision it anyway. Sure. > Is there any other 'display-buffer' call in xref.el that would set up a > category and prefer any other but the selected window? By default, you mean? > IIUC > 'xref--display-buffer-in-other-window' doesn't.  How would a user > customize its behavior?  Note that I'm completely ignorant of the > 'xref--with-dedicated-window' trick - is there any reason why > 'inhibit-same-window' is not sufficient here? We want to select the new window in relation the "original" window (with a file-visiting buffer), while avoiding touching the "results list" window as well. E.g. when the original command was xref-find-definitions-other-window. It's probably not an ideal solution, but one settled on over several tries. > Personally, I think that a window parameter based choice could be even > better than 'mru' but Juri who uses 'mru' on a regular basis seems to be > fine with it.  For some users 'mru' might not DTRT when they temporarily > pop up a third window they use for showing some other, unrelated buffer > in between jumping to a sequence of references. Either seems reasonable to me, just as long as the choices can be anticipated in advance by the user.