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#41821: 28.0.50; read-directory-name in vc commands should provide defaults from projects Date: Tue, 30 Jun 2020 15:36:26 +0300 Message-ID: <3f9e85ba-66a9-abd0-61bf-800ea8bb4ee3@yandex.ru> References: <87r1ulxk48.fsf@mail.linkov.net> <7164426e-8c37-8839-64da-563cfa829b53@yandex.ru> <87mu50j5cu.fsf@mail.linkov.net> <87y2oh8fdv.fsf@mail.linkov.net> <87366ohw5z.fsf@mail.linkov.net> <878sge7jls.fsf@mail.linkov.net> <7e136435-7123-fa42-e4a8-66b82e6595da@yandex.ru> <87pn9pxris.fsf@mail.linkov.net> <83d05ottnw.fsf@gnu.org> <0b42f540-f779-446b-4411-8dae3a50d09d@yandex.ru> <837dvwtrv1.fsf@gnu.org> <835zbgtqps.fsf@gnu.org> <625de669-0715-1467-0bd1-84328b4bee5f@yandex.ru> <83wo3ws4g8.fsf@gnu.org> <83tuyzs2np.fsf@gnu.org> <87h7uuj1v3.fsf@mail.linkov.net> <87h7utjx75.fsf@mail.linkov.net> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="6065"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 Cc: 41821@debbugs.gnu.org To: Juri Linkov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Jun 30 18:35:09 2020 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 1jqIxH-0008jZ-Nj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 18:17:55 +0200 Original-Received: from localhost ([::1]:43390 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jqFXV-0008DI-Gg for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 30 Jun 2020 08:39:05 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:44032) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1jqFVW-0005WJ-56 for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 08:37:02 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:38855) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jqFVV-0004in-PV for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 08:37:01 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1jqFVV-0008U8-M9 for bug-gnu-emacs@gnu.org; Tue, 30 Jun 2020 08:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 30 Jun 2020 12:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41821 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 41821-submit@debbugs.gnu.org id=B41821.159352059932576 (code B ref 41821); Tue, 30 Jun 2020 12:37:01 +0000 Original-Received: (at 41821) by debbugs.gnu.org; 30 Jun 2020 12:36:39 +0000 Original-Received: from localhost ([127.0.0.1]:50401 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqFV9-0008TM-H9 for submit@debbugs.gnu.org; Tue, 30 Jun 2020 08:36:39 -0400 Original-Received: from mail-wr1-f52.google.com ([209.85.221.52]:45634) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1jqFV6-0008T3-Sr for 41821@debbugs.gnu.org; Tue, 30 Jun 2020 08:36:38 -0400 Original-Received: by mail-wr1-f52.google.com with SMTP id s10so19913599wrw.12 for <41821@debbugs.gnu.org>; Tue, 30 Jun 2020 05:36:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=nLEui2QYr9j+vdzFI4b34ADn7fR9fCJuPt5UjFNJIhk=; b=mk33fZ+VYdf9bjhJzXPJj3wNBcQeVjyJnkqtEp5FmS2N3LGc5z2l3n98+IndUab3hg SQVVplBMkl0qjUE8VG9J6OXFZ003ug1ODVm4o5awDoCkWPxXNYWCm13ONB70lTTSa4Fz Ljs4/otGsRzs4I30iUSypde9ojV8aVtu5tB+OVBDWnQtLFsaqbjyE98eCqXBHZHsDuAK 0z5SmH7iuVAofMHgbLQg0ZUxeh0NTIcHqmJgUtUnow8s54Bs62nWJnWysLD21r37BHS7 bqe3pSnbGuXxIvLXOTk0juO18/7q1tI5k/0nNApcQZdLIzOfMXGXiK02V6g5ZO1QRFky mGcA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:cc:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=nLEui2QYr9j+vdzFI4b34ADn7fR9fCJuPt5UjFNJIhk=; b=dcvLLq15lwXk2f44PyEf+52rBii77kjEiSdG7SS5YuUG5Nv1QkA+jvBJ+S8cGfmfmi RE7w4skm5wONnFcrrNg/qXs0Jd+MHUnKlSbjig5Jc7hKRa7z7T0x5xDJkVjeBwjJe6ci JFyGylt6lD3gmSdA+z9KFVXps4wiuIUT1PgaN8IQJIuo+QEnnP1ly4k+xApPT7LH1Eso rjXKIDSumozEXpRMjs0mq6V/7AWD0DVa8yD7ygSwFLgOpVcCk0ZIE10b3Hck7cq9whyW ziNa55fwf8pkNNbFJynXn4pH7R9yNOLpURTSVjEzmXhhO/wGD9OsCb84zeeO4zM59N88 8aCQ== X-Gm-Message-State: AOAM5337svqWjHgo6PsZ45m+qszoJVuDI6V3yEt3B1fYnxAuDseQbFHk LB4qES55oxruY7M4FGctpv+asuUt X-Google-Smtp-Source: ABdhPJxzKxohx9y/Wt260bZsppqWjAcvm/pK9lE1XttXf7bZODGMbP90PGy6/YCvEvDZEVxuNaaJWg== X-Received: by 2002:adf:e7c2:: with SMTP id e2mr23112842wrn.179.1593520590571; Tue, 30 Jun 2020 05:36:30 -0700 (PDT) Original-Received: from [192.168.0.134] ([109.110.245.170]) by smtp.googlemail.com with ESMTPSA id 1sm3344331wmf.21.2020.06.30.05.36.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 30 Jun 2020 05:36:29 -0700 (PDT) In-Reply-To: <87h7utjx75.fsf@mail.linkov.net> Content-Language: en-US X-Spam-Score: 0.0 (/) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-Spam-Score: -1.0 (-) 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:182556 Archived-At: On 30.06.2020 01:58, Juri Linkov wrote: > Note the same prefix 'project-vc' for vc backend of project.el. > Then 'project-vc-known-roots' in project.el be like this: > > (defun project-vc-known-roots () > "Return a list of known vc roots." > (seq-filter #'project-try-vc (project-known-project-roots))) You suggested this before. Special-casing a particular backend in a general purpose public function is not a good idea. > Also every command that visits a directory in vc could register their dir > in the project list when project.el is loaded, for example: > > (defun vc-dir (dir &optional backend) > ... > (when (featurep 'project) > ;; Add current vc project dir to project list > (let ((default-directory dir)) > (project-current t))) Having considered it more, I now have more doubt on whether this approach is a good idea in general. See, even when the project backend is VC, there is no guarantee that its root will be the repository's root. First, there are submodules (and whether a submodule root is a project root is customizable). Second, there is an existing feature request to use also some other project root markers, even inside VC repos (the "monorepo" case). These might end up in the 'vc' backend as well. So things as they are, I'd rather VC has a separate roots history, or we at least put this feature request on hold (and, for now, revert the installed patches).