emacscollective / borg

Assimilate Emacs packages as Git submodules
https://emacsmirror.net/manual/borg
GNU General Public License v3.0
259 stars 28 forks source link

Project commands with subprojects is to greedy #141

Closed PlasmaShift closed 1 year ago

PlasmaShift commented 1 year ago

When I use project tools like ripgrep affe consult-ripgrep or project.el or projectile deadgrep, I search for every lib/package in addition to my emacs config. It would be nice to limit by excluding everything in lib/*. This problem gets bigger and bigger the more packages you install, I have +100 packages

deadgrep will do a default search on project root but allow me to change the root search in its gui. This has been a workaround for me

This is also nice as I have a way to search all documentation on everything related to my Emacs config so it would by nice to have a limited search or greedy search

I know this is not a borg issue per say but it is an issue that I have ran into by using borg day to day

Ideas to fix or workaround this issues

  1. change lib/ to zlib/ to push those results to the bottom This workarounds the issue and might make it redundant. My results on top with others below could be the best of both worlds. The thing I don't like is paging down multiple times to get to my configs code
  2. configure tools to ignore lib directory I would need to find then configure, if they exist? project.el ignore directory ripgrep ignore

If you have a solution or thoughts about this problem it would be appreciated.

tarsius commented 1 year ago

For search just one file/buffer I would recommend using occur. If you split your configuration across multiple files, you might want to place those files in a subdirectory and only search in that. You could symlink init.el in there.

Renaming lib seems like an uglier kludge, because it does not prevent searching in there and just moves the results to the end. I think the manual has some hints about renaming that directory.

Informing the search tools about the situation, i.e., telling them to ignore the directory, seems like the best course of action.

PlasmaShift commented 1 year ago

For in buffer searching I had no issues because I knew about those commands πŸ˜€

  1. Renaming lib would also wouldn't fix stuff like consult-ripgrep so that wouldn't work
  2. For configuring tools
    1. consult-ripgrep --is greedy and don't know how to configure it
    2. RAK https://github.com/lizmat/App-Rak -- You could tell it to ignore in the cli but this tool has no emacs package 😐
    3. projectile-ripgrep -- is limited to the project directory only πŸ˜€ although I would like a consult-project-ripgrep as project.el > projectile.el and consult as consult is live updating.

A combo of commands for both use cases would be best

Regarding symlinking your init.el file into my site-lisp directory is a good idea. If I make this a git directory it should start working with project commands.

I am still testing packages and combinations. after i have it working with individual projects I will work on my my site-lisp personal lisp files

I might move my site-lisp folder into a git repo and use borg to assimilate it.

tarsius commented 1 year ago

I might move my site-lisp folder into a git repo and use borg to assimilate it.

That's what I do. Well I take it one step further and turn stuff into packages that others can use too, but I also have two packages kludges and wip, which I don't publish.

I know this is not a borg issue per say but it is an issue that I have ran into by using borg day to day

Yeah, I don't think borg is the place to address this.

PlasmaShift commented 1 year ago

I might move my site-lisp folder into a git repo and use borg to assimilate it.

That's what I do. Well I take it one step further and turn stuff into packages that others can use too, but I also have two packages kludges and wip, which I don't publish.

This sounds like a good solution, you could also have easily have a private unshared conifer and public part of your configπŸ˜€

Yeah, I don't think borg is the place to address this.

I got further along and am happier with it now so A tip in the docs might me nice.

I might make pull request or note here if I find a combo I am happy with

Thanks πŸ˜€

tarsius commented 1 year ago

I think this goes beyond what should be covered in the manual, but please feel free to start a "Tips and Tricks" wiki page with a note about this. (Similar to https://github.com/magit/magit/wiki/Tips-and-Tricks.)