On Jul 20, 2006, at 2:49 AM, Laurence Harris wrote: On Jul 19, 2006, at 1:57 PM, glenn andreas wrote:
The responses I'm getting seem to be making my point. So far I've gotten three replies to my question and each time someone points me to the Options window*, but no one has told me how to configure a search of the headers. I'm sure it can be done, but IMO, it would be obvious how to do so if Xcode's Find system were designed better, and it says something that no one has actually explained how to do it.
Let's take a quick stab at it - bring up the options window. We want to make a new "Find Set", so click "Add..." and type in "In Project Headers".
Click the radio button that says "Filter files using regex patterns:". Click in the first column next to the pattern "\.(h|H|hxx|hpp|i)$" so that the value is "=".
Close window. Done.
Now just select "In Project Headers" in the popup when you want to only search in the project headers.
Thank you. :-)
Now, while this does work, it is far less than ideal because:
- Amazingly enough, not everyone is comfortable with regexp. Something this basic shouldn't require regexp (or the use of a second window) IMO. This is one of the things I intensely dislike about Xcode: it just isn't user friendly. You can do what you need to do, but even simple things tend to be buried in some not-very-Mac-like interface that offers a lot of power and flexibility -- assuming you can figure out how to use it.
- An option that requires a visit to the Options window is an option that can't easily be added to another search. For example, suppose I have three find sets defined, and I use them when searching the headers sometimes and source files at other times. It sounds like Xcode is going to make me set up six find sets instead of just letting me set up three and turn a check box on and off in the main Find window.
Larry, either you're not reading what people write very carefully or not trying this at home. In three simple steps:
1) In any project, do Find in Project and click Options. 2) Click "Add..." and enter the name "Headers". 3) Set the radio buttons and check box to "Search in files and folders", press the (+) button under its list, and add "/usr/include" to the list.
Read carefully: - Note that no RegExes were harmed in the making of this Options set. - The Project Find popup now has an entry for "Headers" that you can use without ever clicking "Options" again. - The find set is stored in your user prefs, and is available for all projects.
There are admittedly a lot of things that suck about the Project Find window, but it is not hard to set it up to create searches in arbitrary folders.
Chris |