Node:Grepping directories, Next:, Previous:Using eshell, Up:Tips and tricks



Grepping directories with ECB

ECB offers in the popup-menus in the directories- and sources-tree-buffer commands for easy (recursive) grepping the current directory under point (directory-buffer) rsp. the current-directory (sources-buffer). In every case just the function of the options ecb-grep-function rsp. ecb-grep-find-function is called and the default-directory is tempor. set to the chosen directory so the grep will performed in this directory regardless of the default-directory of current buffer in the edit-window.

Other smart things beyond that are not done by ECB, see also ecb-grep-function!

So, how to exclude some subdirectories or files from the grep?

Basically this has to be done with the "-prune" option of the find-utility: If the standard-grep facility of Emacs is used then this is not easy but with the library igrep.el there is a convenient way to exclude things like CVS- or RCS-directories from the find-call: See the variable igrep-find-prune-clause of the library igrep.el.