minad / consult

:mag: consult.el - Consulting completing-read
GNU General Public License v3.0
1.13k stars 99 forks source link

The default value for consult-find-args breaks relative paths #885

Closed raundn closed 7 months ago

raundn commented 7 months ago

Hi!

I've been trying to supply consult-find with multiple custom paths (which I'm figuring out dynamically depending on the default directory of a buffer -- I have a huge code base and only want to search some of it). Something like this:

(consult-find (my-cool-dir-list-builder)) 

Surprisingly, this fails to find any files whenever my-cool-dir-list-builder returns more that one path to search.

Long story short, this is the command consult-find is eventually running:

find ../../.. ../../../../../some-side-dir -not ( -wholename */.* -prune ) -iregex .*my_filename_query.*

The -not ( -wholename */.* -prune ) part comes from the consult-find-args (it's the default). By the way, the paths I provide are absolute, but Consult rewrites them into relative form.

Now, the unfortunate thing is, a relative path like ../.. satisfies the -wholename */.* test (which I don't think is intentional).

I don't know what the correct fix is. Just thought I'd report this.

Thanks!