Jump to content
PeterPanettone

GExperts Grep Search

Recommended Posts

The GExperts Grep Search is one of the most valuable CROWN JEWELS in the Delphi IDE! A big THANK YOU to its author and maintainer!

  • Like 1

Share this post


Link to post

I invoke the GExperts Grep Search dialog with the ALT+S shortcut. This is fast, as it can be done quickly with the thumb and forefinger of the left hand.

Share this post


Link to post

It is very useful that the GExperts Grep Search dialog automatically inserts the current selection in the code editor as its search term!

 

It would be equally useful if the GExperts Grep Search dialog would also automatically insert the name of the currently selected control as its search term when invoking the dialog in design mode!

Share this post


Link to post

Do you know how it can search through units that are not defined (used) in .dpr, but are used in the project? If I select All files in project it doesn't search in units not defined in .dpr.

Share this post


Link to post
Posted (edited)
1 hour ago, Mike Torrettinni said:

Do you know how it can search through units that are not defined (used) in .dpr, but are used in the project? If I select All files in project it doesn't search in units not defined in .dpr.

Enable the map file in the linker settings and then select "parse map file" in GExperts Grep. It will then search all files listed in the map file. Of course this only works if your project compiles or at least compiled at one time, so a map file exists. Also, the map file only contains files that contribute code to the executable, so e.g. units only containing ressourcestrings won't be searched.

Edited by dummzeuch
  • Thanks 1

Share this post


Link to post
Posted (edited)
1 hour ago, Mike Torrettinni said:

Do you know how it can search through units that are not defined (used) in .dpr, but are used in the project? If I select All files in project it doesn't search in units not defined in .dpr.

DO you create a MAP file? (Project Options ->Building -> Delphi Compiler -> Linking -> Map file). Shouldn't the GExperts Grep Search also search the unit files listed in the Map file?

 

EDIT: I was too late - Thomas was faster.

Edited by PeterPanettone
  • Thanks 1

Share this post


Link to post
8 minutes ago, dummzeuch said:

select "parse map file" in GExperts Grep

Thomas, couldn't you please add the feature that the "parse map file" checkbox is automatically disabled (grayed out) if no map file exists?

Share this post


Link to post

Yes, I do have Map file as detailed in Linking option, and it works when I choose Parse map file, thanks!

 

But now I get also RTL and other (Indy...) .pas files in search results, when searching for something that I guess appears in these source files, too. What setting could it be that doesn't include Delphi's source files?

Share this post


Link to post
Posted (edited)
8 minutes ago, Mike Torrettinni said:

What setting could it be that doesn't include Delphi's source files?

That would be a nice new option: "Parse file list". With this option, grep search would parse all files listed in a separate file list. (A simple text file). This would be very useful!

 

Or do a content search with EVERYTHING - it's very fast.

Edited by PeterPanettone

Share this post


Link to post
Posted (edited)

Or you could simply use the Exclude Dirs option in the dialog.

 

EDIT: Oh, I found out that the Exclude Dirs option works only when searching in directories.

 

 

Edited by PeterPanettone

Share this post


Link to post
4 minutes ago, PeterPanettone said:

Or you could simply use the Exclude Dirs option in the dialog.

 

 

I can only enable this option if I search Directories and not files. Do you know if this option (Exclude dirs) can be enabled and applied to search All files in project/All files in project?

Share this post


Link to post
1 minute ago, Mike Torrettinni said:

I can only enable this option if I search Directories and not files. Do you know if this option (Exclude dirs) can be enabled and applied to search All files in project/All files in project?

It would be nice if Thomas could enable this. Just add a checkbox in the Exclude Dirs option.

Share this post


Link to post
1 minute ago, PeterPanettone said:

It would be nice if Thomas could enable this. Just add a checkbox in the Exclude Dirs option.

True, but I'm not trying to put pressure on Thomas so I'm only asking what is possible right now and if I'm missing something really obvious like I did with option Parse map file.

Share this post


Link to post
40 minutes ago, Mike Torrettinni said:

I'm not trying to put pressure on Thomas

I am sure that Thomas doesn't feel any pressure. I am sure he loves programming as we others do and I am sure he is open to suggestions.

  • Like 1

Share this post


Link to post
7 hours ago, PeterPanettone said:

Thomas, couldn't you please add the feature that the "parse map file" checkbox is automatically disabled (grayed out) if no map file exists?

If i remember correctly that's already the case 

Share this post


Link to post

I guess that means a new feature request is incoming.

Another option would be to only search files in the search path, but not in the debug search path. That would exclude the RTL units as they only exist in dcu form there.

Share this post


Link to post
12 hours ago, dummzeuch said:

I guess that means a new feature request is incoming.

If this is a subtle request to not post a new feature request on this topic (this cannot be understood otherwise) then please say it loud and clear. Thank you! If not, then sorry for my wrong assumption.

Share this post


Link to post
4 hours ago, PeterPanettone said:

If this is a subtle request to not post a new feature request on this topic (this cannot be understood otherwise) then please say it loud and clear. Thank you! If not, then sorry for my wrong assumption.

It was a suggestion to file a feature request if you care to get this implemented. If not, don't file it.

Maybe it was too subtle, yes.

 

(I don't take anything from a discussion here as a feature request, unless I think it might be valuable for me myself. Or sometimes I actually remember it when I am working on something else and see an easy option to implement it. That's not the rule though.)

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×