[Top][All Lists]

[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: Fri, 25 Nov 2022 00:11:29 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2

On 24/11/22 08:23, Eli Zaretskii wrote:
From: João Távora<joaotavora@gmail.com>
Date: Wed, 23 Nov 2022 20:33:04 +0000
Cc: Stefan Monnier<monnier@iro.umontreal.ca>,
  Danny Freeman<danny@dfreeman.email>,
  Eric Abrahamsen<eric@ericabrahamsen.net>, emacs-devel<emacs-devel@gnu.org>

   (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)))))
Is this okay for code outside project.el to know the internal structure of a
project object in general, and in particular cons "by hand" a 'transient'
project object?  I thought this was a closely-guarded implementation detail
that even doc strings are not allowed to divulge?

Joao's code here is not production-ready, but it wasn't intended as such either, I guess.

Any 'sub-projects' function would likely be generic with implementations belonging to a particular backend. And a backend knows how to construct its instances.

reply via email to

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