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.devel Subject: Re: Xref/Eglot feature requests and a question Date: Thu, 24 Aug 2023 18:13:12 +0300 Message-ID: References: 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="14495"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 To: =?UTF-8?Q?Gerd_M=c3=b6llmann?= , emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Aug 24 17:14:15 2023 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 1qZC2H-0003WM-GW for ged-emacs-devel@m.gmane-mx.org; Thu, 24 Aug 2023 17:14:14 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qZC1Q-0003HN-Jo; Thu, 24 Aug 2023 11:13:20 -0400 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 1qZC1P-0003DU-Hr for emacs-devel@gnu.org; Thu, 24 Aug 2023 11:13:19 -0400 Original-Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qZC1M-0008VZ-VO for emacs-devel@gnu.org; Thu, 24 Aug 2023 11:13:19 -0400 Original-Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id E02B55C01CE; Thu, 24 Aug 2023 11:13:15 -0400 (EDT) Original-Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 24 Aug 2023 11:13:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gutov.dev; h=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:sender:subject:subject:to:to; s=fm3; t= 1692889995; x=1692976395; bh=LUdYo/twQ+H/OtL58ExAK/rSZBibKkPEYw+ I5QNUTq4=; b=RUCh7xkAICxTsU+HKo5JCKVeMi7TH3TfxfhSmkvELXWlR7cJWIh so0qZA4dvBkV2K4JM43tYrwg0w056uTrPIZiY5xbU6pGmVbVEuvJlowTzjCKRv99 VryzbnXxVPQzTMgZRGnIRtC8snOAvbS0dGjxPV7k4eTQwfOIPVInylgSLnG5F7cE n1fLEpBYGTfrPWUCgc1PUf9CIsreyZLN3Fh5MKfU9Wd9aBpuPiCRyI79TGCApJYQ THi+6OgLk01oakkrtqKMsFf8T9lqtuii6GCr/qMnn3UT+0AhMUVmqRiGIX51KX1u 4uPVGbDIK+n8bdZtp5vS6Jhuueidq0gHOOA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1692889995; x= 1692976395; bh=LUdYo/twQ+H/OtL58ExAK/rSZBibKkPEYw+I5QNUTq4=; b=U G4BPVMloZDdz7DMV1hzvH8+8nga/5F4Rkl/+DyQ+uo/KBDqpLClK059d51lwP/Yh OE2mRK8fkq0HrxmYLcSxVyoSbbL6xNVinucKK4WN2Ckuj1yDU3CfaanC5cbOx7Rp AnRsN9O6EFzzNkPF4lRrT2TgCizidWnf4MNxCZ4Snx68um+S3eBaUBeT6SbrjXTn qHnntQzcvRlfFzb7iZ3vi43q2Etv8eNYI/HTLwpyVUfrR/XmzggRB7lnxxtfZeQ4 inuDFRUV8enFXQ+3TaEWXWScdfjIx+MGiRg1x37X6mUTFP27b4cV1bQ3YnFVBMcJ PmF6i6ba6SkM4QIQuvcyQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedruddviedgkeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefkffggfgfuvfhfhfgjtgfgsehtke ertddtfeejnecuhfhrohhmpeffmhhithhrhicuifhuthhovhcuoegumhhithhrhiesghhu thhovhdruggvvheqnecuggftrfgrthhtvghrnhepfeejkeevvdefleefudefveegtedvve ekledvtdeuteetfedufefgudeikeffieelnecuvehluhhsthgvrhfuihiivgeptdenucfr rghrrghmpehmrghilhhfrhhomhepughmihhtrhihsehguhhtohhvrdguvghv X-ME-Proxy: Feedback-ID: i0e71465a:Fastmail Original-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 24 Aug 2023 11:13:14 -0400 (EDT) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=66.111.4.27; envelope-from=dmitry@gutov.dev; helo=out3-smtp.messagingengine.com X-Spam_score_int: -56 X-Spam_score: -5.7 X-Spam_bar: ----- X-Spam_report: (-5.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, NICE_REPLY_A=-2.919, RCVD_IN_DNSWL_LOW=-0.7, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action 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-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.devel:309175 Archived-At: On 24/08/2023 16:33, Gerd Möllmann wrote: > I have a couple of feature requests regarding Xref and/or Eglot, after > switching from Lsp-mode to Eglot yesterday, which BTW went really > well. Thanks to João! > > 1. > > I'm in a C buffer with Eglot running, and I want to go to the definition > of something whose name I know, but point is not on an identifier naming > that thing. For instance, I want to go the definition of Lisp_Package > (in an obsure branch having a struct Lisp_Package), while point is > somewhere. > > C-u M-. offers some completions, but Lisp_Package is not among them. > Not using a completion and entering Lisp_Package works. > > Feature request: Could the completions be made to contain all workspace > symbols? Lsp-mode has something doing that, and I found it quite useful > with Helm. > > C-M-. Lisp_Package RET works fine, but entering a word list as > advertised in the prompt, say "Li Pa", does not. > > Question: Bug or limitation? Both of these are up to Eglot, I think. Or the underlying language server. > 3. > > In C mode, Xref works using Eglot, in ELisp mode it uses something else > (I have no tags tables). Both work really well, but I apparently have > to be in an ELisp buffer to use one and in a C buffer to use the other. > > Feature request: Is it possible to use more than one backend at the same > time? So that I could C-M-. to find an ELisp function while being in a > C file? I couldn't find something like that mentioned in the docs, so I > guess it's not yet possible. No such capability at the moment, but we indeed have an ELPA package xref-union which implements the "merging" feature that has been requested in the past. You are asking for something a little different, though: to be able to switch to a different language/project that's also present in the current Emacs session. Its backend function cannot be found in the xref-backend-functions in the current buffer (local or global), unlike the examples with mixing in etags or imenu results, like mentioned by Visuwesh. A naive approach, or for the new code to search across different open buffers and look for different available xref-backend-functions elements. And then prompt the user, and then call (?) the said function in one of the buffers it was found in, because in all likelihood it would fail in unrelated ones. Perhaps the solution is to add a new facility to Xref, where different "projects" would be able to register globally in. A feature request indeed.