From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#74361: [PATCH] New option xref-navigation-display-window-action Date: Fri, 15 Nov 2024 09:49:39 +0200 Organization: LINKOV.NET Message-ID: <87msi1ueb0.fsf@mail.linkov.net> References: Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28870"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/31.0.50 (x86_64-pc-linux-gnu) Cc: 74361@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Nov 15 08:52:26 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 1tBr7y-0007Ku-2G for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 15 Nov 2024 08:52:26 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tBr7i-00059Y-Tv; Fri, 15 Nov 2024 02:52: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 1tBr7b-00059J-Qb for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:52: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 1tBr7a-00035a-Aa for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:52:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=debbugs.gnu.org; s=debbugs-gnu-org; h=MIME-Version:Date:References:In-Reply-To:From:To:Subject; bh=S4/xZd401LcNCvGgma0IUUKBrPTPwWDq265evMduLzo=; b=UaL5EZ+TSs8G2IrV40dWxO3lGHfGNWEW71gzUeOsML/ObqlWPBUrJb58Y8MvBU5/yzRsAzMMLGMTA8qv/WXmADvc54d7lAqWf72PPBEhQ766rRsmkCgXulRgI3LlYHSlNBuiHhQ+BqLxBfStUQh59Kysa32bFpkm94ZeZPC2ssDoF4/vhm9YBY83ZWiQz/yMpz/SRMTEaIfCn5hdOe/GIg/wK1N2syAXJo6D9mP8F56hluzGaPD8CKdyAh8doKtogY9LdGKV+9ueH++bRHl+jNrJB6i1ChU+tc+/mf4Mjskr3CFwgu1KeR7Q2glOpykgHfmMWFtqyYqKYp7gOyGA9Q==; Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1tBr7Z-0007BN-VG for bug-gnu-emacs@gnu.org; Fri, 15 Nov 2024 02:52:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 15 Nov 2024 07:52: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.173165711427594 (code B ref 74361); Fri, 15 Nov 2024 07:52:01 +0000 Original-Received: (at 74361) by debbugs.gnu.org; 15 Nov 2024 07:51:54 +0000 Original-Received: from localhost ([127.0.0.1]:48415 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBr7R-0007B0-PL for submit@debbugs.gnu.org; Fri, 15 Nov 2024 02:51:54 -0500 Original-Received: from relay6-d.mail.gandi.net ([217.70.183.198]:58663) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1tBr7Q-0007Am-4B for 74361@debbugs.gnu.org; Fri, 15 Nov 2024 02:51:52 -0500 Original-Received: by mail.gandi.net (Postfix) with ESMTPSA id BDA1FC0004; Fri, 15 Nov 2024 07:51:23 +0000 (UTC) In-Reply-To: (Dmitry Gutov's message of "Fri, 15 Nov 2024 00:29:14 +0200") X-GND-Sasl: juri@linkov.net 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:295383 Archived-At: > This adds a capability to customize the destination window selection logic > for navigation (xref-find-definitions, xref-go-back, xref-go-forward) by > allowing a user-supplied display window function. > > Inspired by the Merlin package and its user option > merlin-locate-in-new-window > (https://github.com/ocaml/merlin/blob/a36f42a5b181d0c9cc84174e8eb241b11eeabc0f/emacs/merlin.el#L177C12-L177C39) > - where the value 'diff' uses a different window if the destination is in > an file different from the current one. > > With the attached patch the customization looks a bit noisier though: > > (setq xref-navigation-display-window-action > '(display-buffer-reuse-window)) > > ^ This makes it try to reuse an existing window and fall back to > pop-to-window, but the effect is similar to what's described above. > > Comments welcome. This option looks similar to 'display-comint-buffer-action' whose addition was deemed to be a mistake, so we needed to declare it obsolete and replace it with '(category . comint)'. So instead of adding 'xref-navigation-display-window-action', could you just add a category 'xref' to xref display function calls? Then users will be able to customize it with e.g.: (setq display-buffer-alist '(((category . xref) (display-buffer-reuse-window)))) Or maybe I misunderstand other requirements for this feature. Ok, meanwhile I'll play more with your patch to see if 'category' could really help here.