From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Danny Freeman Newsgroups: gmane.emacs.devel Subject: Re: Eglot, project.el, and python virtual environments Date: Thu, 17 Nov 2022 08:41:37 -0500 Message-ID: <87o7t5k7sv.fsf@dfreeman.email> References: <87zgcq68zp.fsf@ericabrahamsen.net> <878rkale3l.fsf@dfreeman.email> <87v8nezf2k.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="2859"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel@gnu.org To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 17 14:52:59 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 1ovfK7-0000SS-AM for ged-emacs-devel@m.gmane-mx.org; Thu, 17 Nov 2022 14:52:59 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ovfJN-0000mC-SF; Thu, 17 Nov 2022 08:52:15 -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 1ovfJK-0000kl-S8 for emacs-devel@gnu.org; Thu, 17 Nov 2022 08:52:11 -0500 Original-Received: from out2.migadu.com ([2001:41d0:2:aacc::]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1ovfJI-0003pE-4y for emacs-devel@gnu.org; Thu, 17 Nov 2022 08:52:10 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=dfreeman.email; s=key1; t=1668693124; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=G2RuNdGW1HNkKNnZfqj7FHm5wZbtJSZs4SA0hfh/olM=; b=edKnkkJlp5EPhO8Pl0Nvyjf/b5YHJYG01z4PUwH55t+n98B2IndQcpeUYI752izQKxEVWk rBJ5F/nSBmG2GwqdvoEE6ZJ5TywLOEzXpR0kSGhHaFdCpP8g3evKCtKfwa2+P2lTHuMo7A L9LDUfM5anepzqy/n8F62nIvDxPbkKQ= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <87v8nezf2k.fsf@ericabrahamsen.net> X-Migadu-Flow: FLOW_OUT Received-SPF: pass client-ip=2001:41d0:2:aacc::; envelope-from=danny@dfreeman.email; helo=out2.migadu.com X-Spam_score_int: -27 X-Spam_score: -2.8 X-Spam_bar: -- X-Spam_report: (-2.8 / 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, 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:300046 Archived-At: Eric Abrahamsen writes: > > > project_root > > > =E2=94=9C=E2=94=80=E2=94=80 .git > > > =E2=94=9C=E2=94=80=E2=94=80 src > > > =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 python > > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 VeryImportantLambda > > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv > > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 MoreImportance > > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv > > > =E2=94=82 =E2=94=9C=E2=94=80=E2=94=80 RunInCaseOfEmergency > > > =E2=94=82 =E2=94=82 =E2=94=94=E2=94=80=E2=94=80 .venv I just realized you posted information about the .venv files in your original post and I completely overlooked that lol.=20 > Thank you very much, that does help indeed! I started off down this path > and had gotten as far as eglot-lsp-context. Then I realized I couldn't > just return a directory, it had to be a project object, and that's when > I decided someone else must have a better approach. But it's great to > see all this laid out, and knowing about `(cons 'transient root)' is > very helpful, as well. > > I'll play around with this a bit. It seems like a not-outlandish > situation, and I wonder if it might not be useful to provide some > standardized method of helping Eglot find an alternate project. > > Thanks again, > Eric Anyways yeah, I think I've heard about someone else running into this as well. Maybe it was on the reddit emacs forum. Either way, I do not think you are the first. What might an extension for Eglot look like? Maybe a built in `project-find-functions' implementation that does something similar looking for a `.eglot-lsp-root` (or probably something configurable) as a transient project root? I don't know if that would cause problems out of the box for some people, but it seems safe. --=20 Danny Freeman