[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Subprojects in project.el

From: Dmitry Gutov
Subject: Re: Subprojects in project.el
Date: Sat, 26 Nov 2022 00:44:16 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 25/11/22 22:16, João Távora wrote:
Dmitry Gutov <dgutov@yandex.ru> writes:

I am indeed "fussy" about "bug reporting".  But here, Dmitry, I am
reporting a bug.  There's no minimum reproducible recipe, no error
to report, no surprising behaviour, etc. to speak of.  We're just
discussing Emacs development... in the emacs-devel mailing list.

You are making a new feature request. Or at least were (when you were
talking about "subprojects" as a new noun for project.el to have, with
new associated behaviors).

I'm discussing a limitation of project.el regarding subprojects.  If
that is solved with a new feature, a new package, or if it turns out
it's not a limitation at all, I think it's a worthy topic of

Like Stefan also explained, there are two different things one might be talking about when talking about "subprojects".

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 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.

People do seem it natural to express their custom project structures
via file markers, at least that's what I see in the wild as
project-find-functions customizations.

Yes.  Very often there are already such markers in place.  Other times
you can add them yourself.  Other time there aren't any and the people
controlling the projects don't want you to add them (maybe because they
don't use Emacs or care about your uses).

But that shouldn't matter.

My understanding of subprojects, or the operations I want to do with
them isn't affected by the method by which they may be configured:
that's a detail that relatively easy to solve.

Have you read the bug I linked to? You don't need to explain something I already know.

The technical solutions for this are plenty. The question is how to make a coherent solution from that, and to address the most common scenarios.

To be clear, here's my use case again: I have a complex hierarchy of
directories and files which call the super-project.  I sometimes want to
find files, grep for strings and run compile commands there.  project.el
allows this already (albeit with associated find-file slowness if the
project is really large).

Sometimes I will work for some period exclusively in one of the
super-projects's sub hierarchies.  When doing so, I will look for files,
grep strings and run compile commands in that hierarchy which I call the
sub-project.  Doing so cuts down on the noise of other files and grep
matches in other parts of the super-project that I'm not interested in.

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.

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?

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.

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?

reply via email to

[Prev in Thread] Current Thread [Next in Thread]