-(defvar grep-all-files-history nil)
-
-(defvar grep-all-files-omitted-expressions
- '("*~" "#*" ".#*" ",*" "*.elc" "*.obj" "*.o" "*.exe" "*.dll" "*.lib" "*.a"
- "*.dvi" "*.class" "*.bin")
- "List of expressions matching files to be omitted in `grep-all-files-...'.
-Each entry should be a simple name or a shell wildcard expression.")
-
-(defvar grep-all-files-omitted-directories '("CVS" "RCS" "SCCS")
- "List of directories not to recurse into in `grep-all-files-...'.
-Each entry should be a simple name or a shell wildcard expression.")
-
-(defun construct-grep-all-files-command (find-segment grep-segment)
- (let ((omit-annoying
- (mapconcat #'(lambda (wildcard)
- (concat "-name '" wildcard "' -or "))
- grep-all-files-omitted-expressions
- "")))
- (cond ((eq grep-find-use-xargs 'gnu)
- (format "find . %s %s -type f -print0 | xargs -0 -e %s"
- find-segment omit-annoying grep-segment))
- (grep-find-use-xargs
- (format "find . %s %s -type f -print | xargs %s"
- find-segment omit-annoying grep-segment))
- (t
- (format "find . %s %s -type f -exec %s {} /dev/null \\;"
- find-segment omit-annoying grep-segment)))))
-
-(defun grep-all-files-in-current-directory (command)
- "Run `grep' in all non-annoying files in the current directory.
-`Non-annoying' excludes backup files, autosave files, CVS merge files, etc.
-More specifically, this is controlled by `grep-all-files-omitted-expressions'.
-
-This function does not recurse into subdirectories. If you want this,
-use \\[grep-all-files-in-current-directory-and-below]."
- (interactive
- (progn
- (require 'compile)
- (list (read-shell-command "Run grep (like this): "
- grep-command 'grep-all-files-history))))