help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

customize grep-find-command for each invocation


From: weiqingh
Subject: customize grep-find-command for each invocation
Date: 29 Aug 2006 13:02:29 -0700
User-agent: G2/0.2

hi there,

i want to set the grep-find-command differently based on each file.
(basically i need to search from a certain directory based on where the
file is). what's the best way to do it? i tried to write a new function
like this:

(defun rails-search()
  (interactive)
  ;; set grep-find-command based on value of root
  (rails-core:with-root (root)
  (setq grep-find-command (cons (concat "find " root " -name \"*.rb\" |
xargs -exec grep -i -n -s ") (+ 34 (length root))))

  (grep-find)
 )
)

when trying to run the new function, it gave me "wrong number of
arguments". i guess i need to pass arguments to grep-find. but how? i
wanted to grep-find to take the input for search string... 

thanks.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]