<div dir="ltr">[...]<div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">
3. For non-recursive searches, grep does not allow a directory to be<br>
specified instead of file. To work around that, we read the directory,<br>
back-parse all --include=*.x patterns, and match them manually.<br>
<br>
Proposition: grep -rl --include=*.c --exclude-dir=[^.]*<br>
--exclude-dir=.?* void . :)<br>
<br>
We pass our Directory as a workind  directory to spawn, and the<br>
recursive search already uses . as a grep FILE argument.<br>
--exclude-dir is supported since more than 5 years.<br>
<br>
</div></blockquote>
<br>
Is there any reason we cannot just walk the directory/subdirectories ourselves and search the files using GRegex stuff? The pattern syntax would then be the exact same as the other search dialogs and it would save having to not only spawn a subprocess but also remove the dependency on grep (only a problem on Windows). Also, as a future optimization, if any of the files to search are open in Geany, we could search their document buffer directly from memory rather than having to do any file IO for them. GIO/GFile has all the stuff needed to walk a directory tree and open files both asynchronously and portably IIRC.<br>
</blockquote><div><br></div><div>*Technically* the only issue I know of is that last time I looked PCRE was much less optimised than grep (partly because PCRE is more general) so searching a big tree of big files may be noticeably slower.</div>
<div><br></div><div>But this is more code that needs to be written, debugged and maintained.  Pull requests (with an ongoing support pledge) are welcome.</div><div><br></div><div>The benefits of control and consistency (and as you pointed out on IRC to search the buffers not the files for open documents) may not outweigh the cost of doing it.</div>
<div><br></div><div>Cheers</div><div>Lex</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
Cheers,<br>
Matthew Brush<div class="HOEnZb"><div class="h5"><br>
______________________________<u></u>_________________<br>
Devel mailing list<br>
<a href="mailto:Devel@lists.geany.org" target="_blank">Devel@lists.geany.org</a><br>
<a href="https://lists.geany.org/cgi-bin/mailman/listinfo/devel" target="_blank">https://lists.geany.org/cgi-<u></u>bin/mailman/listinfo/devel</a><br>
</div></div></blockquote></div><br></div></div>