Qkesslerr · 2022-03-01 20:52
Hi there!
Enrique here! The [consult-project-extra](https://github.com/Qkessler/consult-project-extra) package got recently accepted into MELPA. Nevertheless, expect to also find the package in GNU ELPA in the future, since it only requires packages either built into Emacs or on GNU ELPA (as is consult).
Please, try the MELPA installation process, and test the functions out. I really appreciate any comments.
Best,
lastnamebird · 2022-03-02 02:26
Two things of note. One, I believe your latest version will only work with the Master branch of Consult, given the recent changes to consult-project functions. I would highlight this in your README.
Also, the interest of integration I would suggest you look into the `project-files` generic and `project-read-file-name-function`. There may be some interesting approaches you can take with the various methods & generics. Though I’m pretty sure you can replace these three functions
consult-project-extra--project-with-root
consult-project-extra--project-files
consult-project-extra--file
just using the built-in functionality of `project.el` and something like this in:
(defvar consult-project-extra--source-file
`(:name "Project File"
:narrow (?f . "File")
:category file
:face consult-file
:history file-name-history
:action ,#'consult--file-action
:enabled ,#'project-current
:items ,(lambda () (project-files (project-current)))))
(defvar consult-project-extra--source-project
`(:name "Known Project"
:narrow (?p . "Project")
:category 'consult-project-extra-project
:face consult-project-extra-projects
:history consult-project-extra--project-history
:annotate ,(lambda (dir)
(if consult-project-extra-display-info
(progn
(format "Project: %s"
(file-name-nondirectory (directory-file-name dir))))))
:action ,(lambda (dir)
(let ((default-directory dir))
(funcall-interactively #'project-find-file)))
:items ,#'project-known-project-roots))
Qkesslerr · 2022-03-02 06:47
Thank you so much for the comments! Feel free to open a PR if you feel it’s best!
Will update the package requirements regarding the consult version.
Best,
Enrique.
jpe-90 · 2022-03-02 07:29
Any project.el support/tooling gets a thumbs up from me :) Nice work!