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: Eglot, project.el, and python virtual environments Date: Sun, 20 Nov 2022 01:40:42 +0200 Message-ID: <42d32bed-4122-67e4-11a4-ec9c97240ee8@yandex.ru> References: <87zgcq68zp.fsf@ericabrahamsen.net> <878rkale3l.fsf@dfreeman.email> <4c5f4b07-3df6-d700-83f8-9a9d1b684afc@yandex.ru> <84781346-5b88-2be5-38bb-02696fcf1364@yandex.ru> 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="37032"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 Cc: Danny Freeman , Eric Abrahamsen , emacs-devel To: =?UTF-8?B?Sm/Do28gVMOhdm9yYQ==?= Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Nov 20 00:41:11 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 1owXSQ-0009WC-Ux for ged-emacs-devel@m.gmane-mx.org; Sun, 20 Nov 2022 00:41:10 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1owXSE-0003Ng-Jz; Sat, 19 Nov 2022 18:40:58 -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 1owXSC-0003NF-9q for emacs-devel@gnu.org; Sat, 19 Nov 2022 18:40:56 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1owXSA-0005l5-Gw for emacs-devel@gnu.org; Sat, 19 Nov 2022 18:40:56 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id i64-20020a1c3b43000000b003d016c21100so668082wma.3 for ; Sat, 19 Nov 2022 15:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:from:to:cc:subject:date:message-id:reply-to; bh=zuWsZ4Vu1cc0/6qEv8UUzVfRKzLRInVNz2U2CQS1m6g=; b=qFZcTpmT5AeiafMrNk/exDw7KwlclnrqOz7IUyxAxTdiKVcxhYLgkk0BLmwm1Q8amB d5Tyx2hartQ+zyIYWUpLk3Gu/JeW7BKtM9cy6gkfeZcKhta7YydEGgHMYaV6NJSRmAcs aaNU/V9KzrXAG69Oa5nEIrTyLev8/o8MpC8u0QkJB33Oa4otr7A5AuBg9XCFBTRstsB2 Zu/w/RvXq6hcJdZTdYpJrz7VlDpLywGBFHJmkoiS9hT46jag+nkD3ykfuFb+kHtF9TQ2 ELTDi06REZFaexUrSge2Bz9nlTEsAy0m3bAOIoR11WOc0oKRxsIMRbJ3go1yp15fVCBE 0w3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :sender:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=zuWsZ4Vu1cc0/6qEv8UUzVfRKzLRInVNz2U2CQS1m6g=; b=jfZf7LpRZx2M87pZVIcMzqpQz+c/kmHgIe9gxFXvVHyIV/tB0kv6stej9DcIr0o0Gu a7MxiPVy/VKWt269DKF2vtjbk3uEGuzosznEx9/+miCNNnoA81MNfGKUmwhkVd8/27Ld VGVsbQfUWRt0jCFmUHw2Gnv/9dtzS7+GKKpx8KrKlp4aBMxakB94rYsM3SxqFwPQxStm agO2+/Ii0+ZUQhXBHLHZkw1Q/ylg01wELzAUWBS/asXV0u4nBnJeBVGmvixqEpQnRgM0 BhUPQY57TOYlaOxAi6fz4NWf5NuqETA3XYrJJKHjLtcpt4BLsBP2CRe5zSrvYNBx9kTM Q3TA== X-Gm-Message-State: ANoB5plngbShWA9KVPQoUlQlSm1jCfkfPfzpHuAb+YLl8rrQ0zZJgQIv pjMZIgFhqlsql4ZQ9HiEfe4= X-Google-Smtp-Source: AA0mqf73xEC2KxnmJrIGsRko1R1S3fRKak//nR/ABDABrvZEX8HLm6TgXdDEo58vyeZuzfRIsiQLIw== X-Received: by 2002:a7b:cc91:0:b0:3c6:c1d5:ab81 with SMTP id p17-20020a7bcc91000000b003c6c1d5ab81mr11974607wma.192.1668901244859; Sat, 19 Nov 2022 15:40:44 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id u15-20020a5d434f000000b0022e6178bd84sm7420221wrr.8.2022.11.19.15.40.43 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 19 Nov 2022 15:40:44 -0800 (PST) Content-Language: en-US In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -16 X-Spam_score: -1.7 X-Spam_bar: - X-Spam_report: (-1.7 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.001, FREEMAIL_FROM=0.001, HEADER_FROM_DIFFERENT_DOMAINS=0.25, NICE_REPLY_A=-0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=no 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:300217 Archived-At: On 20.11.2022 01:25, João Távora wrote: > > I had hoped to plug it in project.el but I couldn't find a way, so > > I rebound C-x p f to it. > > Should be easy enough: you create your own backend (rather than reusing > 'transient') and override the generic 'project-files'. Then add it to > project-find-functions. > > > iiuc project-files should return a list of files, or can it return a > completion table as well? If not the latter, then i think it won't work... Yes, sorry for the confusion. I'm not sure how feasible it will be to use a completion table instead, it's something to look into. E.g. it would need to perform the conversion in project--read-file-cpd-relative lazily. In my usage, though, project-find-file shows all available files right away, so it's a question whether the lazy computation will actually speed things up. Maybe if you require non-empty inputs only? And two chars or more? But what happens when you backspace and type again? The indexer rescans the directory? Unless such scans use a very fast index, just reading the whole list of files into memory can be faster. > Anyway, this is the problem with the popular recommendation: just add a > thing to 'project-find-functions'. It degrades performance and changes > how project commands work too. > > > I don't see the relation. If anything this reduces the amount of files > to search (but it's still a lot). It switches to a less efficient indexer ('find'), and it drops the handling of .gitignore. So, listing all files in a 100'000 file subproject might take longer than listing all files in the parent 400'000 file project using 'git ls-files'.