emacs-devel
[Top][All Lists]
Advanced

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

Re: Subprojects in project.el (Was: Eglot, project.el, and python virtua


From: Dmitry Gutov
Subject: Re: Subprojects in project.el (Was: Eglot, project.el, and python virtual environments)
Date: Thu, 24 Nov 2022 04:51:22 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 23/11/22 22:33, João Távora wrote:
   (defun joaot/sub-projects (dir)
     (let* ((super (project-current))
            (super-root (project-root super))
            (relative (file-relative-name dir super-root))
            (d (car (split-string relative "/"))))
       (when (member d '("lisp" "src"))
         (cons 'transient (expand-file-name (concat d "/") super-root)))))

   (add-hook 'project-find-functions
             'joaot/sub-projects
             t nil)

This will define two subprojects inside Emacs's tree.  The "lisp" and
"src" projects.  It's not particularly useful for Emacs, but I hope it
illustrates what I want to do.

So you're fine with having to specify the list of subprojects for every project manually? Via a hoook or generic override.

As opposed to having a globally configured list of (sub)project markers which would do a good job 90% of the time.



reply via email to

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