Ancestors

Written by Alan on 2024-12-24 at 16:44

I asked something about the #emacs package #projectile a few weeks ago (here https://github.com/bbatsov/projectile/discussions/1920). As I wrote, I have a project B that depends on a project A. It's a C++ program with all base classes in project A and specialized ones in project A. I was not able to make use project-vc-external-roots-function. I ended up creating a new function almost identical to projectile-find-file-in-all-projects, namely projectile-linked-project-files with a .dir-locals.el variable projectile-linked-projects.

As no one seems to answer to me on Github, anyone knows if it could be a good idea to do a pull request?

=> More informations about this toot | More toots from alan@piaille.fr

Toot

Written by Alan on 2024-12-24 at 16:47

The defvar

(defvar projectile-linked-projects nil
  "List of locations of linked projects.

Should be set in a .dir-locals.el")

The list of files for current and linked projects

(defun projectile-linked-project-files ()
  "Get a list of all files in current and linked projects."
  (cl-mapcan
   (lambda (project)
     (when (file-exists-p project)
       (mapcar (lambda (file)
                 (expand-file-name file project))
               (projectile-project-files project))))
   (list (projectile-project-root) projectile-linked-projects)))

=> More informations about this toot | More toots from alan@piaille.fr

Descendants

Written by Alan on 2024-12-24 at 16:48

And the callable function

(defun projectile-find-file-in-linked-projects ()
  "Jump to a file in the current or linked projects."
  (interactive)
  (find-file (projectile-completing-read "Find file in projects: " (projectile-linked-project-files))))

with

((nil . ((projectile-linked-projects . "/absolute/path/to/other/repo/"))))

in the .dir-locals.el

=> More informations about this toot | More toots from alan@piaille.fr

Proxy Information
Original URL
gemini://mastogem.picasoft.net/thread/113708817361811878
Status Code
Success (20)
Meta
text/gemini
Capsule Response Time
263.459071 milliseconds
Gemini-to-HTML Time
0.785789 milliseconds

This content has been proxied by September (3851b).