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 04:05:43 +0200 Message-ID: <79a17a5c-d1c1-ce69-d29a-9127150fb1d7@yandex.ru> References: <87zgcq68zp.fsf@ericabrahamsen.net> <87o7t2vj19.fsf@dfreeman.email> <877czqtyfy.fsf@dfreeman.email> <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> <33292672-2a59-ba63-05ab-a7995118a822@yandex.ru> <87pmdau6wo.fsf@gmail.com> <87zgcesg8l.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="15284"; 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 03:06: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 1oyka7-0003j9-NR for ged-emacs-devel@m.gmane-mx.org; Sat, 26 Nov 2022 03:06:15 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oykZj-0003BU-5J; Fri, 25 Nov 2022 21:05:51 -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 1oykZh-0003B7-Ai for emacs-devel@gnu.org; Fri, 25 Nov 2022 21:05:49 -0500 Original-Received: from mail-wm1-x32a.google.com ([2a00:1450:4864:20::32a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oykZf-0000JY-HI for emacs-devel@gnu.org; Fri, 25 Nov 2022 21:05:49 -0500 Original-Received: by mail-wm1-x32a.google.com with SMTP id 5so4651440wmo.1 for ; Fri, 25 Nov 2022 18:05:47 -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=RLgE6ixgqRDjT9kdbifbv9AUCXnCmeSmnMdBXvB1Kw8=; b=JyvA9r1Y/EF+XnzQEikigqa9n05+gjuHJ+EVr34iN70g1iq/2xamEycbfoFtBkhLrp SEe8Xhw81Cljmsyz+e9Pt3bRfWZTqup7/QPORBocDCsDiCxRoTiLArQGUNH/uYLNo7gS JIhPnY9MuExDExgTxgQeXe3ERmXiOpGv9sGh07pNwgHJ4Sl2H+nryCFID+wcaXStQx5F n6eTeTyixpBAgCvDt37wz915EwGXBOUN5tDvUPeLnjDUsbhNQK6ebFsSjjUhQL8UKBdq Fb4Oi3g89dH3IbYWuDvNnOSAvaprNGmusDITm0W5ppNZy6d0Q00HqV3YmRJrPVKEqSk5 Sn4w== 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=RLgE6ixgqRDjT9kdbifbv9AUCXnCmeSmnMdBXvB1Kw8=; b=g11RF8CBjUY71idYBzoquF33KduwwVWcfRtB5IC87pwP9m1/YZ049Wbjd1spEWWQd3 LHAtMQRZKwJbNZF6ZT0YUHIxi67cp4rcnUcGjvxwIW0NgIHTx4jPvtbAdNffZWIV6y1l KDdaRymr1DQqd3kRaz9+g7jGYZjzNPj+csBqc9Lsci7u6FAKCk10NXejDc0yXq29s7HN mhYqCdFQXY1TkOSj27TFsoVs3O6BKewn7hcfpQq0F6B0RpW/e+SvmqZtLZbx29hbsyv8 XFEbCQKfTbC6I+QyhqVpAb0Fhm/OHw8tTtuv5SZnSC6BwnO33vGaA8krLSMvtjqAiom7 ee7Q== X-Gm-Message-State: ANoB5pn/IrygbInvFgNYOfoNfXKGSC7BxAiOWDoRIasAL8+wkZDmieJn Fb4M66NpNHovi4Ly26TVOTNC9YLnXSs= X-Google-Smtp-Source: AA0mqf4EX7+mK8cn+b8jlAfPugzt1ccgWRheciYJUkVWPYqBHV/puoPIJF3pDuKc8dXkcmRVFL2d3Q== X-Received: by 2002:a1c:c918:0:b0:3cf:f2aa:3dc2 with SMTP id f24-20020a1cc918000000b003cff2aa3dc2mr20693103wmb.175.1669428345967; Fri, 25 Nov 2022 18:05:45 -0800 (PST) Original-Received: from [192.168.0.6] ([46.251.119.176]) by smtp.googlemail.com with ESMTPSA id s6-20020a5d4ec6000000b0023662245d3csm4801922wrv.95.2022.11.25.18.05.44 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 25 Nov 2022 18:05:45 -0800 (PST) Content-Language: en-US In-Reply-To: <87zgcesg8l.fsf@gmail.com> Received-SPF: pass client-ip=2a00:1450:4864:20::32a; envelope-from=raaahh@gmail.com; helo=mail-wm1-x32a.google.com X-Spam_score_int: -14 X-Spam_score: -1.5 X-Spam_bar: - X-Spam_report: (-1.5 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_FORGED_FROMDOMAIN=0.243, 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:300543 Archived-At: On 26/11/22 02:37, João Távora wrote: > Dmitry Gutov writes: > >>>>> I can't understand what is discourteous about this. >>>> That would be not following the procedure the maintainer has asked you >>>> to follow. >>> If that means silencing me on emacs-devel, then you're out of luck. >> >> Is that what you do when you ask somebody to use the bug tracker? > > I'll use the bug tracker when I think it's appropriate. Let's not > insinuate I'm some kind of inconsiderate delinquent for not moving the > discussion there as you would want. I'm not reporting a bug and I've > politely declined your suggestion, so stop beating this horse. Must be nice to be the person who gets to decide what is appropriate in any situation. >>>> I don't really know what "the user wants". People apparently find this >>>> discussion too scary or meandering to provide any additional >>>> input. The several who I asked to comment have walked away >>>> perplexed. Or perhaps it's just Debbugs. >>> People seem to be contributin a healthy amount of information here. >> >> Yes and no. Nobody has bothered to comment on the messages in the bug >> report, or on the patches in it. > > If they help the discussion, suggest you put your patches in a scratch > branch and announce it here. It's not much work for you, I suppose and > personally I find it simpler than finding your patches and applying them > to the right version. I suggest people look at the patches where they are posted. >> Note that it would also be possible to do through some other >> means. E.g. using some command in Xref result buffer which would >> filter by file names and hide the rest. > > *compilation* and *shell-command-output* are not in any kind of > structured Xref mode where that hypothetical command would operate. > Even if such a command could be devised, I don't find that don't find it > a very good solution. If one knows the where to look in, it's better to > grep only one haystack instead of the whole barn just to throw away most > of the needles. Sure. >>> Not all files that belong to the super-project necessarily belong to a >>> sub-project. Some of them _only_ belong to the super-project.n >> Do the files that belong to a sub-project belong to the super-project? > > Yes: in my view they belong to both. i.e. if you project-find-file in > the super-project, you can find a file in a subproject such that a > subsequent project command operates on the subproject. Okay, good. >>> Anyway, indeally I want these three main operations (find-file, grep, >>> compile) to run in the inner sub-project by default. By typing >>> something more, like, say, a negative prefix argument, I want to be able >>> to be given the possibility to operate on the super-project instead. >> >> See the 'project-parent' implementation I posted a couple of days ago. > > I've seen it. In fact, I posted the same code earlier. But how do I > plug in that so that M-- C-x p f, M-- C-x p c, etc, etc make use of it? By modifying each and every command. I don't think it would be appropriate for 'project-current' itself to react to the value of current-prefix-arg. As you are aware, some commands already react to prefix argument, and some third-party ones might even handle the negative value. Let every command deal with UI; we can make a helper that will make the code much shorter anyway. >>>> The idea of customizing the projects with a list of relative >>>> subproject directory file names solves those downsides, but comes with >>>> lack of automation: you have to do it for every relevant project, and >>>> not forget to update the settings as the project structure >>>> changes. Which might also be a pain e.g. when switching branches, if >>>> your dir-locals.el is not checked in. >>> As Juri mentioned, dir-locals-set-class-variables is the tool you >>> need >>> in those cases. There are ample tools to solve this problem. We should >>> first focus on the project.el infrastructure that enables the above use >>> case in the first place. >> >> What's missing in the infrastructure? > > Not much, I would say. But I think at least: > > * A way that I can add an element to project-find-functions that > understands that a super-project has been detected already in the > current search and proceeds to find sub-projects inside it. This is > what I posted code for. > > * A way for M-- (or similar) to consistently affect all (or most) of the > operations in the C-x p keymap so that we can choose if the operation > operates on the super-project, if it exists. Unfortunately some of > these commands (like project-find-files) already take a prefix > argument to mean different things. But it's not too bad. > > * A new project type, similar to the '(transient . "dir") project (and > inheriting most of its operations) that also keeps a record of the > super-project found. This might not be strictly necessary, but could > come in handy later for efficiency reasons. Sounds pretty complicated. See if the latest patch solves your immediate problems just as well. Aside from the 'M--' thing, which is a compatible but separate story.