From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Augusto Stoffel Newsgroups: gmane.emacs.devel Subject: Re: Eglot, project.el, and python virtual environments Date: Mon, 21 Nov 2022 15:54:43 -0500 Message-ID: <87mt8k58q4.fsf@gmail.com> References: <87zgcq68zp.fsf@ericabrahamsen.net> <878rkale3l.fsf@dfreeman.email> <4c5f4b07-3df6-d700-83f8-9a9d1b684afc@yandex.ru> <84781346-5b88-2be5-38bb-02696fcf1364@yandex.ru> <87o7t2vj19.fsf@dfreeman.email> <877czqtyfy.fsf@dfreeman.email> <87zgcml7g7.fsf@gmail.com> <87bkp0vj2q.fsf@ericabrahamsen.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="8265"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: =?utf-8?B?Sm/Do28gVMOhdm9yYQ==?= , Danny Freeman , Dmitry Gutov , emacs-devel To: Eric Abrahamsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Nov 21 21:55:44 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 1oxDpP-0001zn-S4 for ged-emacs-devel@m.gmane-mx.org; Mon, 21 Nov 2022 21:55:43 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oxDoY-0004su-5F; Mon, 21 Nov 2022 15:54:50 -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 1oxDoW-0004qs-P2 for emacs-devel@gnu.org; Mon, 21 Nov 2022 15:54:48 -0500 Original-Received: from mail-qk1-x731.google.com ([2607:f8b0:4864:20::731]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oxDoV-0001CN-5s for emacs-devel@gnu.org; Mon, 21 Nov 2022 15:54:48 -0500 Original-Received: by mail-qk1-x731.google.com with SMTP id d7so8921488qkk.3 for ; Mon, 21 Nov 2022 12:54:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:from:to:cc:subject:date:message-id:reply-to; bh=mKZTUBg7MbNfVnb0m27KF75OkpQe1O6fwMTdkTv0W0s=; b=YbSWs1uoazCmuA/VwxHJJqLNsZeqdTuVEhSCdal3f5VbAGqd86O0+i8kr5ya4vuRvE 9SNfB4hZRa2TvpKpCoVaLUKd6fUwefIgR0yybF6uqH/iMdx5wPy4lMMuhhYyxYPTJ+R4 7H8y/r+5TDyybCwj/StxrHW+bjPTp5oTOSvnS5ps/Wgb+xe9JViUmXvgvN0N1Gx48Zvx dTFpOgvCl2UBmN6OGSIH86/HP0S/N0jshT1zBW3vsP3Yh1ksmV8aYrKC5HKPJvKBXnCt sv0ycQWqlzFXj9DUOtWdtxrBpD2aQTZnQK9YeXdzlVzDuiYCK9ITkP9suYj7NKX6TujQ n2Zg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:user-agent:message-id:date:references:in-reply-to :subject:cc:to:from:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=mKZTUBg7MbNfVnb0m27KF75OkpQe1O6fwMTdkTv0W0s=; b=1TOX+b3vWVotPoytTSahQCZipiPGEoE4ns86mqgN7yM6CB+wTL4mGGI0YJYdSasZph 3fOlOBBastHVo10rSCFAsHk4QJqVPbwEM/BXAHeaq5bfp6auDLVLh1owlsKxwRiSMm95 gJ/DZksGi3dwa5+A+jdXiWD0ejuXiMLDicSrJLlcBG3qh3DIrD2lVjuSmKxYVWO7yWjB rhNNC4lWnZJRqHGSsYX1XAx9qTOrd8ZN1B1pSzGNIYqw4s1DdYVH2sX4cFvnAkKwByAq LfVir+xhhWiXHk2qhms2U3dm0/eibE0MAAJ+MtNi9smMooVcnEdgKkqqByf1uHqcTP5q OsNA== X-Gm-Message-State: ANoB5pmS4pocMzml/riduFLRseuveHdMF/KV9sJ+gSryCGPTK1qfD7Fx XIFmeDo9m/ear0RgnUm6kNxRgWVekbBYmg== X-Google-Smtp-Source: AA0mqf5BL+QQx9xN12RdLLJZPBMiEsAKveQ0b+PwROIwbPuNVx75vFzbUFaJyx6lvnsbf42FbULB9Q== X-Received: by 2002:a05:620a:1098:b0:6d2:c5d6:7055 with SMTP id g24-20020a05620a109800b006d2c5d67055mr17907636qkk.84.1669064085642; Mon, 21 Nov 2022 12:54:45 -0800 (PST) Original-Received: from ars3 ([2601:193:8201:6b70:ce48:802c:b8ef:d777]) by smtp.gmail.com with ESMTPSA id x13-20020a05620a448d00b006fa4ac86bfbsm8801369qkp.55.2022.11.21.12.54.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Nov 2022 12:54:44 -0800 (PST) In-Reply-To: <87bkp0vj2q.fsf@ericabrahamsen.net> (Eric Abrahamsen's message of "Sun, 20 Nov 2022 23:54:21 -0800") Received-SPF: pass client-ip=2607:f8b0:4864:20::731; envelope-from=arstoffel@gmail.com; helo=mail-qk1-x731.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=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:300307 Archived-At: On Sun, 20 Nov 2022 at 23:54, Eric Abrahamsen wrote: > The only remaining question is finding the right LSP executable. In my > Python venv case, that's done by using one of the aforementioned > packages -- there's no guarantee that the virtual environment will be > under "./.venv", it could be somewhere else entirely. The packages > generally work by hacking exec-path, so that Eglot's `executable-find' > call finds the right Python LSP executable. > > A little care needs to be taken that the environment is "activated" > before the call to `eglot', but it's not that tricky. Using my buffer-env package, I never have to worry about activating a venv. It happens automatically. > I don't think anything more should be done to help with this > particular Python case (besides some documentation). > > But maybe something could be done for finding LSP executables in the > more general case. I disagree that there should be some special scheme to find a LSP executable. Note for instance that python.el has some ad-hoc stuff to choose the right interpreter for the REPL, and here we are discussing the same kind of issue again. What's really needed instead is a scheme to set up the environment of a project. There are quite a few package besides buffer-env for that, but AFAIK nothing built-in. > I can imagine that for saner languages, simply customizing a different > executable path (perhaps passing it different command-line arguments) > would be sufficient. Python is sane in this regard, right?