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: Subprojects in project.el Date: Sat, 26 Nov 2022 15:34:25 +0200 Message-ID: References: <87zgcq68zp.fsf@ericabrahamsen.net> <87zgcml7g7.fsf@gmail.com> <2ba04533-097a-a1da-ff3f-2c9506fd488e@yandex.ru> <875yf9bbzb.fsf@gmail.com> <87wn7oa0aw.fsf@gmail.com> <7a5b76fd-fb15-8c1e-ea29-bf11f7e0d2ae@yandex.ru> <87bkoya815.fsf@gmail.com> <0024a67d-b8e5-b35c-1b22-82541a170eb3@yandex.ru> <871qptai4d.fsf_-_@gmail.com> <71addecc-373e-b1f0-f190-0ce3531626a8@yandex.ru> <50bf9e49-23f0-0966-f619-88bcf35479fa@yandex.ru> <871qpqvme6.fsf@gmail.com> <184362df-01c7-0771-28b4-a87ea52ca45e@yandex.ru> <874jumtwic.fsf@gmail.com> <87mt8errvz.fsf@gmail.com> 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="21389"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Cc: Stefan Monnier , 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 Sat Nov 26 14:35:16 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 1oyvKr-0005Mz-VL for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Nov 2022 14:35:14 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oyvKC-0004ty-VH; Sat, 26 Nov 2022 08:34:32 -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 1oyvKB-0004rA-8k for emacs-devel@gnu.org; Sat, 26 Nov 2022 08:34:31 -0500 Original-Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oyvK9-0006Vz-Gj for emacs-devel@gnu.org; Sat, 26 Nov 2022 08:34:31 -0500 Original-Received: by mail-wr1-x434.google.com with SMTP id i12so10446658wrb.0 for ; Sat, 26 Nov 2022 05:34:29 -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=AxMY2Wo45jqEecgibNvv8zk7xptmd7gyuHCtDlOU2MA=; b=JrkomIGjlf+XQmOM0Zff7bWfDkx25/khYRjb4YqMLyMDWmPsSEGfRduDxlaY3KNhsD 495RQwRNXw4P2BD4PrQjTO5bm11f90c9WCGaFkCPcfXIOrNxSWDfsRSn0InhmsKRlFHC TNjzGVqkdDIBaPjNg2oUKnj7YOdDrsI27WBHcvb6jP9vyRFtRX8rLAvbv5ecKJcwFdmA uATPiHQSM5FhgBewyxvzQ2vbPkdx3NFfr6EsCkID0u56O4K6tqULXfE9jC9LwqqRg/Qf R+VR+aEskbxNRvstiDYhhAiJh0C0Q5RfEg8Gum1c4AMaCkJbOPcAmXnzKmDyS9Ep8WpQ NbUg== 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=AxMY2Wo45jqEecgibNvv8zk7xptmd7gyuHCtDlOU2MA=; b=x2ILsPcgcSRNqElxNTyKXapJX2gwn4oAH791ag6VA0pljU3M/9dMizf99w8bhvcC5O OQT1Ts9hvkH73yXfhWhj9TuHl5bvGuaNeKYW+zZL5/LqldG/TqtjHa7wtRAlYgx3eCsq hBqU1hEkhvtSecGGHR9Xkvw9uthel8oMOAqlHXaJ+cr/HAHL6Kyt0PAW5qUQb/+9F+2J MVIkyUKJx7LZnGfwgC7hJsTF+5gKWhXsDl8fk5pOL2JVNAVF1e5cjjlQ9SYWsy4Ch3he X0yausQ7pWQV6zfzQ0bGBaWEP+cQK7hOKs41nnc5F+Pd+UxCnnfXkKKtEbqL0gIIOlrw 3P/A== X-Gm-Message-State: ANoB5plMQ4baEgjDhsBuUbdXOEivFIgGNR3jzQTF5yablLp8iVtZqXDt J9sApIYpwyzGEwdJwbZ4dks= X-Google-Smtp-Source: AA0mqf57ftQRn7S4L7SF+Zd4WN9WVAKDJR8PZ1nN7Dv6nPMOBJnA35VwKbYQxqvTDKSmb1DNrWWxAw== X-Received: by 2002:a05:6000:114b:b0:241:d199:1a04 with SMTP id d11-20020a056000114b00b00241d1991a04mr19239110wrx.227.1669469668084; Sat, 26 Nov 2022 05:34:28 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id a1-20020adfed01000000b00241da0e018dsm6044568wro.29.2022.11.26.05.34.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sat, 26 Nov 2022 05:34:27 -0800 (PST) Content-Language: en-US In-Reply-To: <87mt8errvz.fsf@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::434; envelope-from=raaahh@gmail.com; helo=mail-wr1-x434.google.com X-Spam_score_int: -15 X-Spam_score: -1.6 X-Spam_bar: - X-Spam_report: (-1.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.183, 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:300565 Archived-At: On 26/11/22 11:23, João Távora wrote: > Dmitry Gutov writes: > >> On 26/11/22 02:00, João Távora wrote: > >> We aren't even close to top efficiency WRT file operations now. And >> your idea is also based on hand-crafting project-find-functions to >> only contain the necessary items. > > project-find-functions is part of project.el's API. So it makes a lot > of sense to use, otherwise why would it be there? We can provide some > pre-baked functions to put there, or already put there for users. The > key point is that functions bail out early if they don't the adequate > context. One of them is the one I proposed earlier, which uses a local > project-subproject-prefixes variable. Another would search for marker > files and consult a tramp-specific user variable for opt-out. project-find-functions up until now has worked like many other hooks we have (e.g. completion-at-point-functions): the first element that returns non-nil is used, the others are not paid attention. That allows these hooks to be used by major and minor modes, rather than having the user curate the full list. As long as priorities are set correctly, the system works. E.g. projectile-mode can just add its own element at the beginning, and not worry about stuff that already exists there. >> As opposed to real-life scenario of Projectile just adding its >> function at the front. >> >>>> I don't entirely understand the algorithm you're proposing here, but >>>> it sounds vaguely like what I'm writing now, so you might like the >>>> result. >>> Where/when can I find this code? >> >> You and others can now find it here: https://debbugs.gnu.org/41572#186 > > That thread has a latest patch that allows marker files to designate > top-level projects: I'm not interested in using marker files > specifically, so I don't see the relevance. I can't deduce from the > patch what you're trying to solve or if it solves my use case. Previously you said: > Fwiw, Danny's tip is what I used at a recent day job gig for defining subprojects in a 400k files repo. where Danny's snippet looked like: (defun project-find-project.el (dir) "Returns a `manual-project' instance if the project of the current DIR has a .project.el file in its root directory." (let ((root (locate-dominating-file dir ".project.el"))) (when root (cons 'transient root)))) (add-hook 'project-find-functions #'project-find-project.el) ...but you didn't use marker files? Or you don't want to use them anymore? I'm really confused here.