From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.devel Subject: Re: xref-query-replace-in-results error message after xref-find-definitions, was: Re: bug#58158: 29.0.50; [overlay] Interval tree iteration considered harmful Date: Tue, 11 Oct 2022 19:50:44 +0300 Message-ID: <83h70ae23f.fsf@gnu.org> References: <83h70qhez0.fsf@gnu.org> <83edvuhaby.fsf@gnu.org> <831qruh67o.fsf@gnu.org> <83y1u2foli.fsf@gnu.org> <83zgehe6iq.fsf@gnu.org> <95113379-99d8-eba4-f980-a7fca11430d5@yandex.ru> <834jwfmn5a.fsf@gnu.org> <838rlohzeo.fsf@gnu.org> <83mta2g91p.fsf@gnu.org> <237a3e26-03b8-a2a9-90bd-d50c3670a131@yandex.ru> <83wn96efyn.fsf@gnu.org> <5bb803bf-f51b-c175-f908-c60066d6967d@yandex.ru> <83v8oqeeqf.fsf@gnu.org> <7c0849be-145e-e073-49b5-63749e8d8282@yandex.ru> <83sfjuecyw.fsf@gnu.org> <83k056e4dz.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8748"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Dmitry Gutov Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Tue Oct 11 18:58:05 2022 Return-path: Envelope-to: ged-emacs-devel@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 1oiIZw-00024n-Ro for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 18:58:05 +0200 Original-Received: from localhost ([::1]:56356 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oiIZv-0003EU-7e for ged-emacs-devel@m.gmane-mx.org; Tue, 11 Oct 2022 12:58:03 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:34394) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiISh-0007yH-Tr for emacs-devel@gnu.org; Tue, 11 Oct 2022 12:50:36 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]:50902) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiISh-0006xP-Le; Tue, 11 Oct 2022 12:50:35 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=NBEXbCU3M/OnSYH+zShFZjfTpdE69fwws8++Bw5Zxgo=; b=cls3u5zxeYHP PR+xzt4sDZdEYQPG8Z87Tt2OIX+9SdPBmRwRHE5tMT5aHfvN3UI9YJlR9YtJZyoOX1smABkwnHATc BkOzdanVMf6ACUnQqZLtAaF2E0aXHuU6xzHPVBR7IRplFlYhVoEFhgL6KxAWxAJm0pt818vU8WSYj eOnNukdIHNZGcM79I5QiPJHyFsHvaX/QLv6FrYo6WTXSE6o1613jlvgrIKHW3swFCDqQjCpUBUYCu eGzSvCxC8OJtHGYJdrtZHrPCUns1KK67RRhLGFUZj/RlBb36SSET9v1tLHMw/ydIVyH9tO9gyLpGq PbX07qBp89dW1RDdi44sTA==; Original-Received: from [87.69.77.57] (port=3684 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oiISh-0003GT-1R; Tue, 11 Oct 2022 12:50:35 -0400 In-Reply-To: (message from Dmitry Gutov on Tue, 11 Oct 2022 19:41:35 +0300) X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:297503 Archived-At: > Date: Tue, 11 Oct 2022 19:41:35 +0300 > Cc: emacs-devel@gnu.org > From: Dmitry Gutov > > >> This would do nothing for custom values of > >> xref-show-definitions-function, but should remove most of the confusion > >> with default configuration. And some non-default ones as well (lsp-mode > >> doesn't change the value of xref-show-definitions-function). > >> > >> If the docstring of xref-show-definitions-function looks okay to you, we > >> can use its vocabulary. > >> > >> Cannot replace in definition search results > >> > >> should cover xref-find-definitions, lsp-find-definition and > >> lsp-find-declaration. Wouldn't help with lsp-find-implementation, though > >> (its results are also questionable WRT renaming because they don't > >> include all references either), but it won't make it worse. > > > > Hmm... maybe > > > > Cannot perform global replacement in find-definition results > > > > Another idea would be for the error message to be constructed > > dynamically, and include the precise command that produced the Xref > > buffer, if xref.el could record that in some buffer-local variable. > > I suppose it could. But then some backend (such as lsp or possibly > eglot) might return 'definitions' results in format suitable for > replacements, and that will mean that one can replace in > xref-find-definitions's results, just with some backends but not others. > > And with that, the error message > > Cannot do global replacement using results of \\[xref-find-definitions] > > shown to the same user at a different time (perhaps when they're editing > Elisp) will become a lie. > > And then, okay, we could try to add the name of the backend symbol to > the error message as well, but it's much harder to capture that one, > especially given that not every command using Xref output will go > through xref-backend-functions (project-find-regexp is a counter-example). So is this: Cannot perform global replacement in find-definition results the best that can be done? It sounds like no alternative is significantly better.