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: Re: customize grep-find-command for each invocation Date: 30 Aug 2006 13:55:41 -0700 Organization: http://groups.google.com Message-ID: <1156971341.667240.150750@p79g2000cwp.googlegroups.com> References: <1156881749.776533.238220@p79g2000cwp.googlegroups.com> <1156903252.450557.24900@i3g2000cwc.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 1156974108 24111 80.91.229.2 (30 Aug 2006 21:41:48 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 30 Aug 2006 21:41:48 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Aug 30 23:41:47 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 1GIXoe-0006nX-7z for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Aug 2006 23:41:44 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1GIXod-000526-R5 for geh-help-gnu-emacs@m.gmane.org; Wed, 30 Aug 2006 17:41:43 -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: 44 Original-NNTP-Posting-Host: 38.99.201.242 Original-X-Trace: posting.google.com 1156971346 25602 127.0.0.1 (30 Aug 2006 20:55:46 GMT) Original-X-Complaints-To: groups-abuse@google.com Original-NNTP-Posting-Date: Wed, 30 Aug 2006 20:55:46 +0000 (UTC) In-Reply-To: <1156903252.450557.24900@i3g2000cwc.googlegroups.com> 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:141450 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:37070 Archived-At: thanks for your reply. the root value is defined in the rails-core:with-root macro. call-interactively is what i was looking for. thanks a lot! wenbinye@gmail.com wrote: > When you write elisp code, you should always check you call the > function with right > arguments. You can use C-h f to see the arguments needed, or turn on > eldoc-mode, > the arguments will echo automatically. > > What is your root value? The local variable should use 'let' bind. > grep-find-command is a string, not a cons cell. > > after set grep-find-command, you can use (call-interactively > 'grep-find) > or (grep-find grep-find-command) to call grep-find > > weiqingh@yahoo.com wrote: > > 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.