From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: weiqingh@yahoo.com Newsgroups: gmane.emacs.help Subject: customize grep-find-command for each invocation Date: 29 Aug 2006 13:02:29 -0700 Organization: http://groups.google.com Message-ID: <1156881749.776533.238220@p79g2000cwp.googlegroups.com> NNTP-Posting-Host: main.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: sea.gmane.org 1156884058 27029 80.91.229.2 (29 Aug 2006 20:40:58 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Tue, 29 Aug 2006 20:40:58 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Tue Aug 29 22:40:55 2006 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by ciao.gmane.org with esmtp (Exim 4.43) id 1GIANp-0001gO-NU for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Aug 2006 22:40:30 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIANp-00084c-4V for geh-help-gnu-emacs@m.gmane.org; Tue, 29 Aug 2006 16:40:29 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!postnews.google.com!p79g2000cwp.googlegroups.com!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 24 Original-NNTP-Posting-Host: 38.99.201.242 Original-X-Trace: posting.google.com 1156881755 13696 127.0.0.1 (29 Aug 2006 20:02:35 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Tue, 29 Aug 2006 20:02:35 +0000 (UTC) User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.6) Gecko/20060728 Firefox/1.5.0.6,gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: p79g2000cwp.googlegroups.com; posting-host=38.99.201.242; posting-account=5Kow_wwAAACEpwhwONj5tySlNAC9RogU Original-Xref: shelby.stanford.edu gnu.emacs.help:141427 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:37047 Archived-At: 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.