From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Nikolay Kudryavtsev Newsgroups: gmane.emacs.bugs Subject: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project Date: Tue, 5 Oct 2021 21:19:21 +0300 Message-ID: <0895f33c-dfff-135e-657a-fbcf4730b799@gmail.com> References: <5f584d83-ef45-9912-bfbc-d2f00b24b9fd@yandex.ru> <87pnahjgdr.fsf@linkov.net> <87ftb92u8q.fsf@thornhill.no> <0ab90cf2-eab2-6fea-6698-4164d7753cd7@yandex.ru> <87d06ck2b0.fsf@thornhill.no> <2fbe5d5d-03a1-212b-9dd7-4723e168ad06@yandex.ru> <5EpzudgjedeKADsX4_Tq-2WtNm3XKXmZjnEI7Y1lmw-Pcn_KrzKPD1o31Ele0JOIrZ1ITDdeQrOsJTHfGVPJlzyLhmqjxP3rmVVzou8KEBo=@thornhill.no> <2a70c748-e250-2f96-5d74-712b6d71e8be@yandex.ru> <871riitzch.fsf@gnus.org> <11e8e147-092d-d840-4d55-005654ff603c@gmail.com> <290a72b8-1e00-2e61-5665-a9bc2ca4289b@yandex.ru> <54c4b3c5-6142-2d2e-b531-a5e3d5a25e3a@gmail.com> <6f237243-8cd6-a22c-a5f5-d241d76ddd53@yandex.ru> 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="1051"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 Cc: Zhu Zihao , Theodor Thornhill , 41572@debbugs.gnu.org, Juri Linkov To: Dmitry Gutov , Lars Ingebrigtsen Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Oct 05 20:57:50 2021 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 1mXpdN-0000Ac-Bj for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 20:57:49 +0200 Original-Received: from localhost ([::1]:47848 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mXpdM-00033Y-3v for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 05 Oct 2021 14:57:48 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:48386) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mXp2o-00070o-8F for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:20:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58574) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mXp2n-00075W-W6 for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:20:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mXp2n-0006gr-Oe for bug-gnu-emacs@gnu.org; Tue, 05 Oct 2021 14:20:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Nikolay Kudryavtsev Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 05 Oct 2021 18:20:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41572 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 41572-submit@debbugs.gnu.org id=B41572.163345797225672 (code B ref 41572); Tue, 05 Oct 2021 18:20:01 +0000 Original-Received: (at 41572) by debbugs.gnu.org; 5 Oct 2021 18:19:32 +0000 Original-Received: from localhost ([127.0.0.1]:41887 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXp2K-0006fz-1v for submit@debbugs.gnu.org; Tue, 05 Oct 2021 14:19:32 -0400 Original-Received: from mail-lf1-f53.google.com ([209.85.167.53]:36447) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mXp2H-0006fl-Bj for 41572@debbugs.gnu.org; Tue, 05 Oct 2021 14:19:30 -0400 Original-Received: by mail-lf1-f53.google.com with SMTP id b20so90660793lfv.3 for <41572@debbugs.gnu.org>; Tue, 05 Oct 2021 11:19:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:subject:to:cc:references:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding:content-language; bh=AdSNcuZXc3mSJBbUCiHgHfUsAYovhfF3TRWFljLJbzs=; b=HMWh0+Fmh5IhpYyTgEMNXzeHxa5bkozwj5RhuqkUNChq+J/EMUoPJ18IB1omz1UuIo 7Sj7LJ6XG/nuq9cRKpfkmXIFi7vE3o1lR6zHF7kesinTEdL/pUNw0t/rDPH5ECyy4RW+ IlWWLWX4iC8lTxYCNvwTSzu2i61/W16Da/YtW28EWpBKvNieKMazm511r/DheMI975/g bDA+brKe3/oORgUUnrLaqPMzwTMTfk0Gv5FDXmQN35Ix06DvSMdmytVdkWIFF5ahRBLV E4U/ba59O59oMZRb0dEYIOaF3MOVBMveNbrJdJtLWDXQ65KAcdQ/o3oxCarqyz+rlzDk g55w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=AdSNcuZXc3mSJBbUCiHgHfUsAYovhfF3TRWFljLJbzs=; b=hsyxg0dNWnWTfp5YcoAgbCL6jA1JNU6CWTdky19Ezg+l9t0T6VB5wn0ozymA8T72vE 81wsqXSEiyjHmdZq3e5Qle0VjMeNnSLY4y2RWaqmsEo8L9nOvkwOHVVnZwed99AlKTpw MOiDF1go5LYu5TPEKuZjoQe0ZlKgGGX5Q7H16rilkkCQc5J1+7spnSzd/aNCBujf4/p8 Jk21xhtVpEOMWMbQI4r9HhtxwwuEBtc7/H3RFzAKhy2fyQ3lKASPMSplPElzzcAIDFNu ol4T5ik3EPw+g/1IZ/E0ES0PVB72wye/wuDndjILbRjvutk+kFsxeimQ2H3F2Cjh9Mz5 xgvQ== X-Gm-Message-State: AOAM532vzPLu2wY3AKiqtdJM2DvSKVd/907OtjERWZ1G7xs0FGlu2zva f9BYagvFmfnF+farM6KOWro= X-Google-Smtp-Source: ABdhPJzxb1Z94hdoU18s5vB7sFM1db2uQKsqnJ3hnbDyH/oM+S5atgb1V1sqDv5a7rAfeWRWylGPjA== X-Received: by 2002:a19:c10d:: with SMTP id r13mr5327393lff.339.1633457963328; Tue, 05 Oct 2021 11:19:23 -0700 (PDT) Original-Received: from [192.168.199.3] (broadband-46-242-10-137.ip.moscow.rt.ru. [46.242.10.137]) by smtp.gmail.com with ESMTPSA id o5sm2034455lft.278.2021.10.05.11.19.22 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 05 Oct 2021 11:19:22 -0700 (PDT) X-Google-Original-From: Nikolay Kudryavtsev In-Reply-To: <6f237243-8cd6-a22c-a5f5-d241d76ddd53@yandex.ru> Content-Language: en-US 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:216491 Archived-At: I currently have a very basic real use case on my hands. There's a particular programming language that has it's own project file type. Since it's a project type, it makes sense to plug it in as project backend. And then on top of this I can implement project target actions like build, compile and debug(this is actually another matter that probably needs to be implemented in(or over) project.el at some point, I'll probably open a discussion about it later). So it all makes sense so far, at least conceptually. But here you're saying "you should not add a new file-based backend until you really think about the project file list optimization first". This violates the classic rule of doing the right thing first, then optimizing second. So while I feel this a real issue, it IMHO should be filed and discussed separately and is a nonblocker for this particular task. Now to contradict myself, lets continue discussing this issue. I think this is a local version of a more global multiple backends problem. Lets say we have the same project(more precisely, a set of files) that is served by multiple backends. Roughly we order project-find-functions in this order: major-mode backends, tool backends(eg. GNU Global), generic backends(VC). The preference for the major mode backends over others is due to that "VC has different root" use case. Tool backends are preferred to VC due to that you can start a new Global project as sort of a custom project hack. And here we run into the problem: our major mode while it provides a backend, does not optimize file listing, but there's a backend that does. I think TRT is project.el choosing a different secondary backend in this case as long as it has the same project root. For this it needs to have some rules, to know which backend better fits a particular situation, which does not. This would require a change of backend registration, since you can't just have one function, so in the end the api would look something like this: (register-project #'my-project-find-function :optimizes-file-listing nil)