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.bugs Subject: bug#57418: 28.1; Projects not saved when vc-handled-backends is nil Date: Fri, 26 Aug 2022 17:21:13 +0300 Message-ID: References: <87edx3o3b5.fsf@posteo.net> 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="29243"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.1 Cc: 57418@debbugs.gnu.org To: Philip Kaludercic , Louis-Guillaume Gagnon Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Fri Aug 26 16:47:08 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1oRac0-0007Nc-4S for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 16:47:08 +0200 Original-Received: from localhost ([::1]:38448 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oRabz-0004kP-2g for geb-bug-gnu-emacs@m.gmane-mx.org; Fri, 26 Aug 2022 10:47:07 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:40862) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oRaDi-0004Gt-JP for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 10:22:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:36241) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oRaDi-0005jT-9f for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 10:22:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oRaDi-000548-56 for bug-gnu-emacs@gnu.org; Fri, 26 Aug 2022 10:22:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Fri, 26 Aug 2022 14:22:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57418 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57418-submit@debbugs.gnu.org id=B57418.166152368619413 (code B ref 57418); Fri, 26 Aug 2022 14:22:02 +0000 Original-Received: (at 57418) by debbugs.gnu.org; 26 Aug 2022 14:21:26 +0000 Original-Received: from localhost ([127.0.0.1]:54222 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRaD8-000533-0i for submit@debbugs.gnu.org; Fri, 26 Aug 2022 10:21:26 -0400 Original-Received: from mail-wr1-f51.google.com ([209.85.221.51]:40563) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oRaD6-00052p-Aj for 57418@debbugs.gnu.org; Fri, 26 Aug 2022 10:21:24 -0400 Original-Received: by mail-wr1-f51.google.com with SMTP id h5so1988548wru.7 for <57418@debbugs.gnu.org>; Fri, 26 Aug 2022 07:21:24 -0700 (PDT) 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; bh=9Mas1JjQu7t8T4mpm7Nd5ROjTGi2sjQp+B37xRVO6J0=; b=bDuNM3ywav82YWUMc+MlHjMZ/7d0Mvwa96wfrK8OnzwHt14LCCMq4sj+v9xSxSQc9m /yi4u7BBTjSOT5HMFfkySUWOn3QpJV7YkxvfU+WyLFXNlxJcMtxNz4aQl1Hr27EYYaL0 7hKNMxQMWRjW+2QWtYHOU9u2B+O3S2YoXYVB+z2L+/NZRzvR4SlhCMKk7Prs8O3sPyag gtbfvRxAbxFltPvmR9Nz6g0xYJU+JnjU+w/7SGe/Vlfnq6AKxGn+prTyZNv3Rb4rQXp4 KoY6KgoCX768xLHI6PeKYwWezc0ZXqrfhj5YUBwC8faXfWE3kWsH+sFesE1N+XB+AScm 8ucA== 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; bh=9Mas1JjQu7t8T4mpm7Nd5ROjTGi2sjQp+B37xRVO6J0=; b=Cm2Y0yb/RTwi3YBHR3NPSeBW5T/kUaXrGiwBW+gtuuh6ScGBi4XpURLIyDqZmvBI8Z ZzUi/OM8UH40CJtfzXvISJUr+mrKQyfZc6AUn7LWEE2QHw9LlmCbaOX0p8oQLT/doVIe q3tCtblTuQmleuhC+NYujbqM4bmZ9QSzdmzWHJ6JT0hLdHqo8sZAhV2kXAV+1l4cfZx7 mbydxQB847KH6gtmioLwqD8nQhUATmSZ3yZBP91bjJyiPTcNgl6HH30o55MG+ae5Nslt zZn0TM3GSOdz9GTSSodIwQQrFtQibdgQWOulFHbnNP6X+QOfdT4caQ8EAB4iK9B8PMqW 41rg== X-Gm-Message-State: ACgBeo2AS9QUcnIUwyCESENdadZGGdlJMdFjL/x64o4X2EjpbyW63TZ8 1eV0jKXmGnw4c5Ss4zWuDPU= X-Google-Smtp-Source: AA6agR4zdrZOFmtAVi1KVeY8BZzwF8vpBLkJT6avqaDffM0lf6uL7r9XhWAG6s73PC8W17leO2frOQ== X-Received: by 2002:a05:6000:1f15:b0:225:3cb4:7b7 with SMTP id bv21-20020a0560001f1500b002253cb407b7mr5049877wrb.282.1661523678339; Fri, 26 Aug 2022 07:21:18 -0700 (PDT) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id y15-20020adfdf0f000000b0022589d133f0sm1957121wrl.96.2022.08.26.07.21.14 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 26 Aug 2022 07:21:17 -0700 (PDT) Content-Language: en-US In-Reply-To: <87edx3o3b5.fsf@posteo.net> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:240842 Archived-At: On 26.08.2022 10:46, Philip Kaludercic wrote: > Louis-Guillaume Gagnon writes: > >> Good day, >> >> I've recently been migrating from projectile to the built-in >> project.el. Since then, one major annoyance is that the projects are >> never saved into project-list-file, so I have to re-enter the projects' >> paths everytime I make a query. >> >> I have narrowed it down to vc-handled-backends being set to nil in my >> init-file. If it's left at its default, it works as expected. I could >> just leave the variable at its default but (iirc) it's part of a bunch >> of optimizations I made to speedup my TRAMP setup, so I'm reluctant to >> do that.  And just to be perfectly clear, the rest of project mode seemingly >> works as expected if that variable is nil, it's just the projects are >> not saved. >> >> Steps to reproduce from emacs -Q: >> >> + (setq 'vc-handled-backends nil) >> >> + Use project.el to find a file in any project not in your >> project-list-file, e.g. with C-x p p >> >> + Open your project-list-file, "/.emacs.d/projects" in my case >> >> Expected result: The recently opened project is listed >> Actual result: The recently opened project is*not* listed > This is to be expected, as by default `project-find-functions' only > includes one function that uses and relies on VC. If it were just this, > I would therefore not consider this to be a bug. Does anything else > work? `project-find-file', `project-shell', `project-compile', ...? I'm honestly surprised that things work with vc-handled-backends disabled. Louis-Guillaume, does (project-current) ever evaluate to non-nil on your system? I'm guessing you end up picking the project directory manually every time. > What might be worth doing is issuing a warning if `project-try-vc' (the > default project-finding-function) is invoked while VC is effectively > disabled. Probably not: after all, the user can have some next backend configured. And we allow setting vc-handled-backends to nil. > You could try solving this by either adding your own alternative to > `project-try-vc' (e.g. if you just use Git, then this > > --8<---------------cut here---------------start------------->8--- > (defun project-try-git (dir) > "Find a super-directory of DIR containing a root file." > (let ((repo (locate-dominating-file dir ".git"))) > (and repo (list 'git dir)))) > > (cl-defmethod project-root ((project (head git))) > "Return the root of a explicit PROJECT." > (cadr project )) > > (with-eval-after-load 'project > (add-hook 'project-find-functions #'project-try-git)) > --8<---------------cut here---------------end--------------->8--- > > might be enough, but still be optimised a bit more). This should work, yes. We could also add a variable which would substitute vc-handled-backends for the purposes of project.el (we'd temporarily use its value). Not sure it's worth the added complexity, though. > Another idea might be to just disable VC for Tramp, or rather just some > Tramp connections? (setq-local vc-handled-backends) inside find-file-hook behind a file-remote-p check could do the trick.