unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: wenbinye@gmail.com
Subject: Re: customize grep-find-command for each invocation
Date: 29 Aug 2006 19:00:52 -0700	[thread overview]
Message-ID: <1156903252.450557.24900@i3g2000cwc.googlegroups.com> (raw)
In-Reply-To: <1156881749.776533.238220@p79g2000cwp.googlegroups.com>

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.

  reply	other threads:[~2006-08-30  2:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-29 20:02 customize grep-find-command for each invocation weiqingh
2006-08-30  2:00 ` wenbinye [this message]
2006-08-30 20:55   ` weiqingh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1156903252.450557.24900@i3g2000cwc.googlegroups.com \
    --to=wenbinye@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).