Correct grep command.
authorOleksandr Gavenko <gavenkoa@gmail.com>
Thu, 18 Mar 2010 11:43:28 +0200
changeset 357 84c8c5f03fd4
parent 356 fd1af7a494de
child 358 a6fb477c0e19
Correct grep command. Move grep, find options to search options.
.emacs-my
--- a/.emacs-my	Thu Mar 18 10:57:52 2010 +0200
+++ b/.emacs-my	Thu Mar 18 11:43:28 2010 +0200
@@ -193,6 +193,14 @@
 
 ;; ----------------------------------------------------------------------
 ;; grep, find.
+
+;; Assume that we have GNU grep, so -H available.
+(setq grep-command "grep -nH ")
+(setq grep-find-command "find . '(' -name .svn -o -name CVS -o -name .hg -o -name _darcs -o -name .git ')' -prune -o -type f -name '*' -print0 | xargs -0 -e grep -nH ")
+;; Do not set t because some grep do not has --color options.
+(setq grep-highlight-matches nil)
+(setq grep-use-null-device nil)
+
 (global-set-key [M-f7] 'rgrep)
 
 ;; ----------------------------------------------------------------------
@@ -418,13 +426,6 @@
         ) )
 
 ;; ----------------------------------------------------------------------
-;; *grep*
-(setq grep-command "find . -name '*' -exec grep -nH '' {} ;"
-      grep-find-command "find . '(' -name .svn -o -name CVS -o -name .hg -o -name _darcs -o -name .git ')' -prune -o -type f -name '*' -print0 | xargs -0 -e grep -nH "
-      grep-highlight-matches nil ; do not set t because some grep do not has --color options
-      grep-use-null-device t)
-
-;; ----------------------------------------------------------------------
 ;; music.
 (setq gnus-audio-au-player "winamp.exe"
       gnus-audio-directory "D:\\music"