emacs-devel
[Top][All Lists]
Advanced

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

Re: Subprojects in project.el


From: João Távora
Subject: Re: Subprojects in project.el
Date: Fri, 25 Nov 2022 23:47:55 +0000
User-agent: Gnus/5.13 (Gnus v5.13)

Dmitry Gutov <dgutov@yandex.ru> writes:

> On 25/11/22 09:42, Juri Linkov wrote:
>>> 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.
>> There is no need to change dir-locals.el.  The project root can be
>> defined using 'dir-locals-set-class-variables'.  Then it can be
>> assigned to any directory using 'dir-locals-set-directory-class'.
>
> How would we fetch the exact root at runtime, if the value is applied
> to the whole directory subtree?

You can use dir-locals-set-class-variables to variable like the
hypothetical project-subproject-prefixes to the super-project's root.
This contains a list of strings or regexps that identify the subprojects
inside the superproject.  I don't see the problem.  Elements in
project-find-functions would be aware of this value and proceed
accordingly to find the subprojects.

João



reply via email to

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