From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Newsgroups: gmane.emacs.bugs Subject: bug#41572: 28.0.50; [PATCH] Support plain project marked with file .emacs-project Date: Tue, 29 Nov 2022 09:46:22 +0000 Message-ID: <8735a2rt3l.fsf@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> <9781acc2-e4c0-b53c-6422-ef2e0a96f400@yandex.ru> <877czirqj6.fsf@gmail.com> <8a588083-3a00-a9e9-2d80-6885b64efbab@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10873"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: "Philip K." , Rudi Schlatte , Augusto Stoffel , Zhu Zihao , Theodor Thornhill , Daniel =?UTF-8?Q?Mart=C3=ADn?= , Eric Abrahamsen , Manuel Uberti , Juri Linkov , Rudolf =?UTF-8?Q?Adamkovi=C4=8D?= , 41572@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Nov 29 10:46:42 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 1ozxCJ-0002SI-3L for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 29 Nov 2022 10:46:39 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1ozxBs-0001Eh-R0; Tue, 29 Nov 2022 04:46:12 -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 1ozxBo-0001CG-Lg for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 04:46:08 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1ozxBl-00068Y-Kl for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 04:46:06 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1ozxBl-0006NM-Gu for bug-gnu-emacs@gnu.org; Tue, 29 Nov 2022 04:46:05 -0500 X-Loop: help-debbugs@gnu.org Resent-From: =?UTF-8?Q?Jo=C3=A3o_?= =?UTF-8?Q?T=C3=A1vora?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 29 Nov 2022 09:46:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 41572 X-GNU-PR-Package: emacs Original-Received: via spool by 41572-submit@debbugs.gnu.org id=B41572.166971511524397 (code B ref 41572); Tue, 29 Nov 2022 09:46:05 +0000 Original-Received: (at 41572) by debbugs.gnu.org; 29 Nov 2022 09:45:15 +0000 Original-Received: from localhost ([127.0.0.1]:54186 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozxAx-0006LR-2s for submit@debbugs.gnu.org; Tue, 29 Nov 2022 04:45:15 -0500 Original-Received: from mail-wr1-f48.google.com ([209.85.221.48]:46983) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ozxAv-0006LH-25 for 41572@debbugs.gnu.org; Tue, 29 Nov 2022 04:45:13 -0500 Original-Received: by mail-wr1-f48.google.com with SMTP id h11so13849700wrw.13 for <41572@debbugs.gnu.org>; Tue, 29 Nov 2022 01:45:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=DUALrQv5nruDKKtTs8GRSB8dMCzLUO719zzBQUBGcI4=; b=o2hj2wQzOlzsPyLgfV4p4CpwfKXZ50i/YVP0Q6evLzyXqTHtdVt+Ibg49Ra59Y9JW7 NoQgaJDjGU+rEwy/VTDzstdgAHRQLj8Upwh43RK61+7yF/XzFtNcRZVE7f1O6tdMdLMf LGAiRZXPFb4XycEpqFjWNqPQfjpjXyPKNkrmU0DqxyUf/3gRQPZ/kB2qQj+qF10WqIOX xUbVfkOavHqWxc+/3Lw0D0orYYrjt0lBP1mwaUC1TLYkaa/IZV4KB/EZxoGXyhWwstdw plFsBSjWl0/o8uwN7gKQs0TsaVZDiFvLf9cztihdY2HNTF6kVD1CHTpAWWAL2eY3ufcG X9gQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:user-agent:message-id:date :references:in-reply-to:subject:cc:to:from:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=DUALrQv5nruDKKtTs8GRSB8dMCzLUO719zzBQUBGcI4=; b=WkVgbkmSXFwsFR+RwVF+ehUb7jMV3dcD1S1HTk+AVdx9wht2sR+geDZiqNzHvnqnYb sDwT+g9GRC2Bw4yvPOS20kAvUFOJQvQhSJhiOAKhhd2ZGzGG6keLhuBZ4waEaEcZ+DOF uueq+zP1ufqqxnY5oWolXuAMSwl+62ue/ZrDQcf7kJpAZNVJ5YoYZtciLxdPXMFYXMhn ouEUgN7OPBdxs73E3noLzwWneTS3xMNwrSmJ8+DV+Z5KZvR4VxsiGNa+YVCz1tfqtiUs rkEbXbYbRbpkCJyKVHpI727CberCF7CSfFYmX1nuJIr0R//lKrx3nPCMo7+hJv0Q2ui+ yS1w== X-Gm-Message-State: ANoB5pnGrX65kMk7OD3p6hBbgajvvrXYN9lbBxIOI0utn/yC2SRqjyfP hR4nnA6iwTkBWsW/+zM6WGo= X-Google-Smtp-Source: AA0mqf5zKSm2BAOycHCshkZyoGMMkEFTbXEPTt+cFVPPVCaZRi96FELH6o2E83aT1cdYj/RPL1lYKg== X-Received: by 2002:a5d:4e43:0:b0:241:d029:e98b with SMTP id r3-20020a5d4e43000000b00241d029e98bmr26560611wrt.551.1669715107080; Tue, 29 Nov 2022 01:45:07 -0800 (PST) Original-Received: from krug ([87.196.72.71]) by smtp.gmail.com with ESMTPSA id f18-20020a05600c4e9200b003c6c182bef9sm1884271wmq.36.2022.11.29.01.45.05 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 29 Nov 2022 01:45:06 -0800 (PST) In-Reply-To: (Dmitry Gutov's message of "Sun, 27 Nov 2022 18:09:32 +0200") 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-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:249376 Archived-At: Dmitry Gutov writes: > On 26/11/22 21:23, Jo=C3=A3o T=C3=A1vora wrote: >> On Sat, Nov 26, 2022, 12:30 Dmitry Gutov > > wrote: >> > My use case is the following: I'm interested in being able to >> designate >> > projects (through various means, not only marker files) that may = only >> > exist inside other projects. >> You previously described your super-project and how you handled >> it >> using >> project-find-functions hook with a new element that looked for file >> markers. Does this patch make that easier to do? Without writing cus= tom >> functions? >> The example i gave did _not_ use file markers. Personally, I can't >> use them. I need some elisp way. > > Please elaborate. I've already elaborated, with actual code. https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01505.html https://lists.gnu.org/archive/html/emacs-devel/2022-11/msg01530.html > Does it mean that those subprojects are chosen manually and don't have > "packages.jon" or etc exactly (or that too many subprojects in that > same project would, undesirably, contain the same files)? OK, one last time: packages.json and i.e. monorepos that have a developing collection of similarly structured NPM packages that move around is good case for marker files, undoubtedly. I'm not putting that into question. But many times that's not the case and you have a big project in which a mostly fixed heterogenous collection of sub-hierarchies exist and you would like to designate as those as subprojects. In the latter case, marker files are useless, uselessly slow and perhaps even impossible. In _both_ cases, it's very useful to have project operations let the user choose the target: super-project or sub-project (or "parent project", "outer project", "nested project", "inner project": I don't care too much about the nomenclature). > Would being able to set to absolute file names (directories) help? Or > would that be too awkward? That's more or less the idea, but they don't need to be absolute file names which is indeed awkward See project-sub-project-prefixes in the code I posted. project-sub-project-prefixes can even be a regex pattern applied on the super-project's root. This describes the heterogenous collection economically and robustly. It is then typically set dir-locally, with either a .dir-locals.el file or with dir-locals-set-class-variables. Of course, the member of project-find-functions that consults project-sub-project-prefixes needs to be aware of containing super-projects found by some other means (marker files included). See the code I posted to emacs-devel for a possible implementation. Jo=C3=A3o